Hi guys,
I have declared some custom types with the struct like this in Swift
struct tUser {
var userId: Int
var name: String
var birthday: tDate
var location: String
var province: String
var email: String
var userPassword: String
var picture: Image
var favorites: tFavorite
}
struct tDate {
var day: Int
var month: Int
var year: Int
}
struct tFavorite {
var identifyer: Int
}
The problem is that I want to initialize a varible with information in these types but I always have the error "Expressions are not allowed at the top level"
What I want to do is the following but the syntax is wrong
var newUser: tUser
newUser.userId = 0001
newUser.name = ...
Can someone help me to do this implementation? I can't do it by myself.
Thanks