Skip to content

Instantly share code, notes, and snippets.

@douglastaquary
Created November 16, 2017 02:33
Show Gist options
  • Save douglastaquary/8ea21409710370c4b4193469b6e05781 to your computer and use it in GitHub Desktop.
Save douglastaquary/8ea21409710370c4b4193469b6e05781 to your computer and use it in GitHub Desktop.
//
// 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