Posts

Post not yet marked as solved
1 Replies
448 Views
Hi guys,I have declared some custom types with the struct like this in Swiftstruct 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 wrongvar newUser: tUsernewUser.userId = 0001newUser.name = ...Can someone help me to do this implementation? I can't do it by myself.Thanks
Posted
by Rec.
Last updated
.