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
public class Payments: Controller<PaymentsRoute> { | |
public override func prepareTransition(for route: PaymentsRoute) -> Transition { | |
switch route { | |
case let .payments(d): | |
let m = PaymentsViewItem(d) | |
let v = PaymentsView() | |
return .show(v) | |
case let .payment(d): | |
let m = PaymentViewItem(d) | |
let v = PaymentView() |
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 Common | |
// HOME MODEL | |
class HomeViewItem: ViewItem<HomeResponse> { | |
// #MARK: Configurate Bar Button items... | |
override var bars: Bars { | |
[ |
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 | |
public protocol HomeNetworkServiceDelegate: NetworkServiceDelegate { | |
@discardableResult func requestUser(_ completion: @escaping Completion<UserEntity>) -> Self | |
@discardableResult func requestAccounts(id: String, _ completion: @escaping Completion<[AccountEntity]>) -> Self | |
@discardableResult func requestCards(id: String, _ completion: @escaping Completion<[CardEntity]>) -> Self | |
@discardableResult func requestOperations(id: String, _ completion: @escaping Completion<[OperationEntity]>) -> Self | |
@discardableResult func requestTemplates(id: String, _ completion: @escaping Completion<[TemplateEntity]>) -> Self | |
} |
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 Common | |
typealias HomeView = InsetTableView<HomeViewItem> | |
class HomeViewModel: ViewModel<HomeViewItem> { | |
@discardableResult | |
override func move(by c: C<HomeRoute>) -> Self { | |
service.s1.requestUser(weaks { _weakSelf, result in | |
switch result { | |
case .success(let user): |
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
@testable import Quick | |
@testable import Nimble | |
@testable import Common | |
@testable import SpecLeaks | |
class ViewControllersTests: QuickSpec { | |
override class func spec() { | |
describe("My base represented views on common target...") { | |
describe("call view events when your viewmodel subscribe your views events by .render(state:)") { | |
it("must not leak") { |
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
@testable import Quick | |
@testable import Nimble | |
@testable import Common | |
class MainTests: QuickSpec { | |
override class func spec() { | |
describe("staring to connect app for testing...") { | |
it ("will start from application didFinishLaunchingWithOptions...") { |
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 Common | |
@main class Main: App { | |
override var project: Presentable { | |
Business() | |
} | |
override var connection: Connector { | |
Connector(connections: [ |
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 Common | |
class PasscodeViewItem: ViewItem<PasscodeState>, ImageConvertable, TextsStyleConvertable, PasscodeDelegate { | |
// MARK: ImageConvertable & TextsStyleConvertable | |
private(set) var texts: [TextStyle] | |
private(set) var image: Image | |
override init(_ state: PasscodeState) { |
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 Common | |
class PasscodeView: ViewController<PasscodeViewItem, View> { | |
@IBOutlet weak var v1: Button! /// logo image view | |
@IBOutlet weak var v2: Label! /// logo title label | |
@IBOutlet weak var v3: Label! /// logo subtitle label | |
@IBOutlet weak var v4: Passcode! /// passcode fill view | |
@IBOutlet weak var v5: Button! /// biometric button | |
@IBOutlet weak var v6: Button! /// delete button |
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 Common | |
class PasscodeViewModel: ViewModel<PasscodeViewItem> { | |
@discardableResult | |
override func move(by c: C<AuthorizeRoute>) -> Self { | |
onSelect(weaks { this, event in | |
switch event { | |
case let .passcode(state): | |
switch state { | |
case let .set(passcode): |