|
I'm very grateful for all the help that this friendly community has provided me over the past few weeks! I think it is time to start transitioning my employee-promotion project from a Command Line Tool project to an iOS app project. Here is the GitHub repository which contains both the working Command Line Tool and my iOS app framework. Specific challenge to overcome: learn what coding principle is appropriate to apply to the ForEach loop in the Results tab of the iOS app. In Command Line Tool, the following code provided print results showing promotions and income changes:
In my iOS app framework I have a ProfileFormView which enables the user to select their current department, monthly hours , etc. I have a ResultsView where I want to show the results. And I have a viewModel which should contain the back-end communication/formulae between the two. What I don't know is how to translate the above Command Line Tool code into the viewModel in a package that is readable by the ForEach loop of the ResultsView. My current ResultsView also contains a struct of SampleData expressly for the purpose of showing how I would like the true user data to be displayed. In the past I've used a computed property array but that was burdensome and massive. I'm hoping y'all could point me in the direction toward a coding principle that facilitates a more streamlined process. Perhaps provide an example I could replicate. |
|
I have made some progress but still need help. My GitHub repository is updated with new I'm having difficulty finding the right place to put my
The errors are:
|
|
Hi,
I opened the
I was able to remove the other 4 errors making the following changes: for the first 2 errors i changed the let to a computed property:
for the other 2 it should read EmployeeViewModel().retireDate:
Hope it helps |
SPONSORED Let’s face it, SwiftUI previews are limited, slow, and painful. Judo takes a different approach to building visually—think Interface Builder for SwiftUI. Build your interface in a completely visual canvas, then drag and drop into your Xcode project and wire up button clicks to custom code. Download the Mac App and start your free trial today!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.