Interface Builder, @IBOutlet and protocols for delegate and dataSource in Swift
Can't connect delegate property of CustomView declared as @IBOutlet to ViewController in Interface Builder – simply can't establish a connection. Here's the code class CustomView: UIView { @IBOutlet var delegate: CustomViewDelegate? } @objc protocol CustomViewDelegate { ... } class ViewController: UIViewController, CustomViewDelegate { ... } @objc is used because of swift protocol, IBOutlet property cannot have non-object type , don't know why protocol CustomViewDelegate: class {} doesn't work. Anyone else came across something like that? From the Xcode release notes: Interface Builder does