|
Here is the GitHub repository which contains the iOS app files and also a MacOS Command Line Tool file. Purpose of the app: Calculate yearly income based on established pay scales and multiple promotions in future years. The Command Line Tool code was the test bed and works great. It produces the following print:
I am attempting to transition from this Command Line Tool code to a iOS app. I want the above print content (year group, department, earnings and age) to be displayed in the iOS app In order to replace the notional sample data array with actual app user-input data, I expect a new array of year group, department, earnings and age must be generated within the
Once an array of the years since hired, income, departments and age is compiled, I should be able to interate through the array with a ForEach to replace the sample data in the Can you assist in creating a new userData array? |
|
In my GitHub repository MacOS code, there is the following function:
This successfully stores the yearly department and income data into an array. I've updated the
However, the following complier error is presented:
|
|
I can explain why you're getting a compiler error. Your But you call
You need to create an instance of
You do not declare any |
SPONSORED Ready to dive into the world of Swift? try! Swift Tokyo is the premier iOS developer conference will be happened in April 9th-11th, where you can learn from industry experts, connect with fellow developers, and explore the latest in Swift and iOS development. Don’t miss out on this opportunity to level up your skills and be part of the Swift community!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.