Loading UIViewController from instantiateViewControllerWithIdentifier - nil outlets

前端 未结 1 732
温柔的废话
温柔的废话 2021-01-29 03:28

I honestly can\'t understand what am i doing wrong.

I have this shared Instance of my UIViewController :

static let sharedInstance = UIStoryboard(name:\"         


        
相关标签:
1条回答
  • The outlets aren't set up initially. The standard way to deal with this is to store your data in properties and then move that data into your outlets in viewDidLoad.

    Since you are loading this in a Singleton, viewDidLoad will only be called once. Instead, copy your data from your properties to your outlets in viewWillAppear.

    0 讨论(0)
提交回复
热议问题