Created
November 16, 2017 02:33
-
-
Save douglastaquary/8ea21409710370c4b4193469b6e05781 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// | |
// StatusViewModel.swift | |
import Foundation | |
import RxSwift | |
public protocol StatusViewModelProtocol { | |
var titleOfButton: String { get } | |
var statusLabel: String { get } | |
var currentUser: NewUser { get } | |
var didTapLogin: () -> Void { get } | |
} | |
public struct StatusViewModel: StatusViewModelProtocol { | |
public let titleOfButton: String | |
public let statusLabel: String | |
public var currentUser: NewUser | |
public let didTapLogin: () -> Void | |
} | |
extension StatusViewModel { | |
public init() { | |
let user = NewUser() | |
self.init(currentUser: user, | |
didTapLogin: { _ in Log.debug("Login") }) | |
} | |
public init(currentUser: NewUser, | |
didTapLogin: @escaping () -> Void) | |
{ | |
//let style = Style() | |
titleOfButton = "Comprar" | |
statusLabel = "Você não possui créditos suficientes para participar" | |
self.currentUser = currentUser | |
self.didTapLogin = didTapLogin | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment