This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
// Depends on SP: https://github.com/albertbori/TestableCombinePublishers | |
import TestableCombinePublishers | |
final class ResultPublisherTests: XCTestCase { | |
func testSuccess() { | |
ResultPublisher<String, Error> { [weak self] in | |
self?.basicSuccess(completion: $0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Combine | |
public struct ResultPublisher<Success, Failure>: Publisher where Failure: Error { | |
public typealias Output = Success | |
public typealias Failure = Failure | |
public typealias ResultCallback = (Result<Success, Failure>) -> Void | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TestViewModel.swift | |
// Test | |
// | |
// Created by Adam Wareing on 11/8/2023. | |
// | |
import UIKit | |
/// Model for storing a section and its contents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// KeyboardLayoutConstraint.swift | |
// TemplateProject | |
// | |
// Created by Adam Wareing on 12/08/19. | |
// Licenced under MIT. | |
// | |
// Based off: https://raw.githubusercontent.com/MengTo/Spring/master/Spring/KeyboardLayoutConstraint.swift | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseViewController: UIViewController { | |
var loadingView: UIView? | |
/// Called when the interactive view controller popping gesture is attempted from the right hand side. | |
/// The view controller should override this if it wants to change its behaviour. | |
/// | |
/// - Returns: true if you want to prevent the interactive gesture. | |
func preventInteractivePopGesture() -> Bool { | |
let isNavBarVisible: Bool = navController?.isNavigationBarHidden == false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e -l Swift -- import MyNotesApp | |
e -l Swift -- let $syncView = unsafeBitCast(0x6000031550e0, to: SyncView.self) | |
// Read custom properties | |
e -l Swift -- print($syncView.syncState) | |
// Call your custom functions | |
e -l Swift -- $syncView.showSyncCompleted() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// We can also print it's constraints | |
e -l Swift -- print($label.constraints) | |
// [<NSContentSizeLayoutConstraint:0x6000031550e0 UILabel:0x7f913f90b7e0'All skills'.width == 95.5 Hug:251 CompressionResistance:750 (active)>, <NSContentSizeLayoutConstraint:0x600003155140 UILabel:0x7f913f90b7e0'All skills'.height == 33.5 Hug:251 CompressionResistance:750 (active)>] | |
// Or even modify its priorities | |
e -l Swift -- $label.constraints[0].constant = 100 |
NewerOlder