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
protocol TransactionCellViewModel { | |
var icon: String { get } | |
var name: String { get } | |
var amount: NSDecimalNumber { get } | |
// Added in the following updates | |
var shouldShowAcceptButton: Bool { get } | |
var shouldShowAddFriendButton: Bool { get } | |
var subtitleText: String? { get } | |
var auxilaryTagIcon: String? { get } |
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 TransactionTable: CustomTableView { | |
override init(viewModel: TransactionTableViewModel) { | |
super.init() | |
viewModel.transactionViewModels.forEach { transactionViewModel in | |
let cell = TransactionCell(viewModel: transactionViewModel) | |
self.addCell(cell) | |
} | |
} |
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 RxSwift | |
import RxCocoa | |
protocol ASDFSmthElse { | |
func smthElse(void: Void) -> Single<Void> | |
} | |
class ASDFService { | |
let state = BehaviorRelay<Void>(value: ()) |
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
protocol WritingService { | |
} | |
class Database: WritingService { | |
func updateUser() { } | |
} | |
protocol DI { | |
// AKA "getDriver" |
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
// // Given a = "23" b = "24" | |
// // Returns = "47" | |
func sumMaker(a: String, b: String) -> String { | |
let a = a.reversed() | |
let b = b.reversed() | |
var resultString = String() | |
var index = 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
class ProfileBasicCoordinator { | |
let view: UIViewController | |
let di: DI | |
let done = PublishRelay<Void>() | |
let disposeBag = DisposeBag() | |
weak var profileController: ProfileController? | |
init(view: UIViewController, di: DI) { |
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
func a() { | |
let first = Observables.just(()) | |
let second = Observables.just(()) | |
// will use the super-prime implementation | |
// because both are sync and all sync | |
// schedulers and synchronized in relation | |
// to each other | |
_ = Observables.combineLatest(first, second) { _, _ in () } | |
} |
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
func a() { | |
let first = Observables.just(()) | |
let second = Observables.just(()) | |
// will use the super-prime implementation | |
// because both are sync and all sync | |
// schedulers are always equal to each other | |
_ = Observables.combineLatest(first, second) { _, _ in () } | |
} |
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 Qutex<Value> { | |
var value: Value | |
init(value: Value) { | |
self.value = value | |
} | |
let queue = DispatchQueue(label: "net.caroline-weisberg.qutex", | |
attributes: [.concurrent]) |
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
controller.viewModel.authError | |
.bind(onNext: { [unowned controller] error in | |
let authController = AuthErrorController.instantiate() | |
authController.viewModel = AuthErrorViewModel(presenter: error) | |
authController.viewModel.logIn | |
.bind(onNext: { [unowned controller] _ in | |
controller.dismiss(animated: true) | |
}) |