iOS viewDidLoad for UIView

If you load it from a XIB file, the awakeFromNib method will be called once loading finishes:

override public func awakeFromNib() {
    super.awakeFromNib();

    // ... loading logic here ...
}

Update; In the case of no XIB, you will probably have to infer it using one of the methods from the Observing View-Related Changes area of the docs (for example, didMoveToSuperview). However, a better way is to send a message to your views from the view controller’s viewDidLoad method if possible.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)