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