خرید بک لینک

Vote count: 0

I have begun building an app that lets a user sign up and create a family. Right now I am downloading the data for the user from the log in screen and, from the appDelegate if the user is already logged in. However, when the user data is downloaded from the appDelegate I get nil values.

Whats weird is that I have the following written in each of my three view controllers(controlled by a tab controller):

var user: User? {
 didSet {
   print(user!.name!)
 }
}

When the data eventually downloads from the appDelegate the correct name is printed. However, trying to use the user variable at any other time gives nil.

Also, when the data is downloaded from the log in screen it works perfectly. Very confused about this and would hugely appreciate any help. Thanks in advance.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 1 تير 1395 ساعت: 22:07

صفحه بندی