import UIKit final class MyViewController: UIViewController { func loadView() { view = MyView.fromNib() } } final class MyView: UIView, NibLoadableView { @IBOutlet private(set) weak var myLabel: UILabel! { didSet { myLabel.textColor = .blue myLabel.text = "This is my label" } } @IBOutlet private(set) weak var otherView: UIView! { didSet { otherView.backgroundColor = .red otherView.layer.cornerRadius = 3.0 otherView.layer.masksToBounds = true } } }