Created
May 4, 2021 21:02
-
-
Save scott-lydon/515a8a2b586564e3094b2555cd2dc831 to your computer and use it in GitHub Desktop.
private setting variables.
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
struct CreateAccountViewModel { | |
var image: Image | |
var accentText: String | |
var choosePathVM: ChoosePathViewModel { | |
didSet { | |
self.currentHeader = choosePathVM.current | |
self.employeeDestination = choosePathVM.current.header == HeaderBody.employee.header | |
self.authViewModel = employeeDestination ? .employeeForm : .businessForm | |
self.formModel = employeeDestination ? .employee : .business | |
} | |
} | |
var buttonImage: Image = Image(systemName: .rightArrowLine) | |
var spacerHeight: CGFloat = 40 | |
private(set) var currentHeader: HeaderBody | |
private(set) var employeeDestination: Bool | |
private(set) var formModel: SignupFormViewModel | |
private(set) var authViewModel: AuthViewModel | |
init( | |
image: Image = Image.greenPhonePocket, | |
accentText: String = "Choose Account type", | |
choosePathVM: ChoosePathViewModel = ChoosePathViewModel( | |
index: 0, | |
explanations: [.employee, .business] | |
), | |
buttonImage: Image = Image(systemName: .rightArrowLine), | |
spacerHeight: CGFloat = 40, | |
formModel: SignupFormViewModel | |
) { | |
self.image = image | |
self.accentText = accentText | |
self.choosePathVM = choosePathVM | |
self.buttonImage = buttonImage | |
self.spacerHeight = spacerHeight | |
self.formModel = formModel | |
self.currentHeader = choosePathVM.current | |
self.employeeDestination = choosePathVM.current.header == HeaderBody.employee.header | |
self.authViewModel = employeeDestination ? .employeeForm : .businessForm | |
self.formModel = employeeDestination ? .employee : .business | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment