When creating a class, some methods are automatically created with it. For example, initWithStyle, awakeFromNib, and others. After all, when using storyboards, are they needed? Can they be safely removed?
2 answers
awakeFromNib is called, for example, for UITableViewCell and UICollectionViewCell even if they are specified as prototype / static cells in the storyboard. They will also be called for any custom UIView / UIControl subclass that you use in the UIViewController assembled in the storyboard. Whether you need them or not is up to you, but this is a good callback for any initialization after loading an object from the xib / storyboard.
|
If you do not need them, you can delete.
|