IBOutlet is nil inside custom UIView (Using STORYBOARD)

前端 未结 7 1563
忘掉有多难
忘掉有多难 2020-12-25 13:22

I have a custom UIView class. Inside it I have declared an IBOutlet property for UIImageView.

#import 

        
7条回答
  •  自闭症患者
    2020-12-25 13:45

    Can you not use the setter for properties, that way you can do what you need when it's actually populated?

    @IBOutlet weak var xxx:UIKitClass! {
      didSet { 
        outletSetup() 
      }
    }
    

提交回复
热议问题