Skip to content

Instantly share code, notes, and snippets.

View isaac-weisberg's full-sized avatar
💭
🤔🤔🤔

Isaac Weisberg isaac-weisberg

💭
🤔🤔🤔
View GitHub Profile
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 }
class TransactionTable: CustomTableView {
override init(viewModel: TransactionTableViewModel) {
super.init()
viewModel.transactionViewModels.forEach { transactionViewModel in
let cell = TransactionCell(viewModel: transactionViewModel)
self.addCell(cell)
}
}
import RxSwift
import RxCocoa
protocol ASDFSmthElse {
func smthElse(void: Void) -> Single<Void>
}
class ASDFService {
let state = BehaviorRelay<Void>(value: ())
protocol WritingService {
}
class Database: WritingService {
func updateUser() { }
}
protocol DI {
// AKA "getDriver"
// // 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
class ProfileBasicCoordinator {
let view: UIViewController
let di: DI
let done = PublishRelay<Void>()
let disposeBag = DisposeBag()
weak var profileController: ProfileController?
init(view: UIViewController, di: DI) {
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 () }
}
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 () }
}
class Qutex<Value> {
var value: Value
init(value: Value) {
self.value = value
}
let queue = DispatchQueue(label: "net.caroline-weisberg.qutex",
attributes: [.concurrent])
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)
})