AEXibceptionView
This class is used for building nested XIB files (Xibception)
For example, imagine that we have next files:
- FirstView.swift, FirstView.xib
- SecondView.swift, SecondView.xib
- CustomCell.swift, CustomCell.xib
Our goal is to add FirstView and SecondView to CustomCell.xib, but to load these views from their XIB files instead from code.
These are the steps:
- FirstView and SecondView must inherit from
AEXibceptionView - In their XIB files File’s Owner must be set to their class (
FirstView,SecondView) - In their XIB files root view should be connected to File’s Owner
contentViewproperty - In cell’s XIB file File’s Owner and Cell itself must be set to
CustomCellclass - Add views to CustomCell.xib and set their class to
FirstViewandSecondView
-
View outlet that should be connected from the File’s owner in storyboard.
Declaration
Swift
@IBOutlet public lazy var contentView: UIView! =
-
AEXibceptionViewwill add representation of self from XIB as thecontentViewproperty.Returns an object initialized from data in a given unarchiver. (required)
Declaration
Swift
required public init(coder aDecoder: NSCoder)Parameters
aDecoderAn unarchiver object.
View on GitHub
AEXibceptionView Class Reference