UIViewA is defined in .xib and .swift. I would like to create a UIView with it own .xib that inherits from UIViewA with several extra properties.
So:
class UIViewA: UIView {
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var subtitleLabel: UILabel!
}
class UIViewB: UIViewA {
@IBOutlet weak var thirdLabel: UILabel!
}
Both UIViewA and UIViewB have titleLabel and subtitleLabel. They are just positioned differently in there xibs. Is there a way I could drag titleLabel in UIVIewB.xib to the titleLabel IBOutlet in UIViewA.swift?
Yes, you can do it. In your example, if you open
UIVIewB.xiband the file owner is the classUIVIewByou can open another editor window with the classUIViewAand you can drag the UI elements to the UIViewA properties.Like this: