Skip to content

Instantly share code, notes, and snippets.

@somersbmatthews
Last active February 5, 2021 21:30
Show Gist options
  • Save somersbmatthews/20bb7f017033460d20ed470fd486f7c9 to your computer and use it in GitHub Desktop.
Save somersbmatthews/20bb7f017033460d20ed470fd486f7c9 to your computer and use it in GitHub Desktop.
view model in swift #swift #ios #swiftui
import Foundation
final class UserModel: ObservableObject {
struct User: Identifiable {
var id = UUID()
var firstName: String
var lastName: String
var email: String
var degree: String
var speciality: String
var verified: Bool
}
// init() {
// var exampleUser = (userid: "1234",
// firstName: "keith ",
// lastName: "rhoades",
// email: "keithr@gmail.com",
// degree: "engineering",
// speciality: "consultant",
// verified: true)
//
@Published var user = [User(
firstName: "keith ",
lastName: "rhoades",
email: "keithr@gmail.com",
degree: "engineering",
speciality: "consultant",
verified: true
)]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment