This is my first app and I'm very new to coding. I started out with enthusiasm until becoming overwhelmed with Swift coding language...
The app I'm trying to design is very simple and will go hand in hand with the work I do. I attached a screenshot of the UI of what I'm trying to achieve.
All I need the app to do is to let me input the appropriate information, and save it to the table.
The problem is that:
Swift doesn't import source files like C#, whenever I create a new swift file and try to import the file called User.swift, "no file exists named User"
I've looked all over and the examples I'm seeing don't make sense, I dont understand why Xcode/Playground doesn't see it.
Instead of using the UI, I'm writing out:
TextField(Name, text: ???)
I've tried defining a variable in my User.swift file (I can't import which might be the problem).
Even if I could import the User.swift file, I'm not even sure of what would go after the "text:____" spot - I've tried using the $name or changing it to "self.name" and there's always a problem
I realize this may be trivial to some of you but I appreciate your input.
What I'm writing in my User.swift file:
import SwiftUI
struct User {
var name: String
var phone: String
var company: String
var userid: String
var clientid: String
var errorid: String
var notes: String
init(name: String, phone: String, company: String, userid: String, clientid: String, errorid: String, notes: String) {
self.name = name
self.phone = phone
self.company = company
self.userid = userid
self.clientid = clientid
self.errorid = errorid
self.notes = notes
}
}
6
0
1.4k