iOS Swift - Swift Language Essentials
You want to create a Swift type to represent a user profile that can be shared and updated across your app without copying. Which should you choose and why?
struct UserProfile {
var name: String
var age: Int
}
class UserProfileClass {
var name: String
var age: Int
init(name: String, age: Int) {
self.name = name
self.age = age
}
}