First of all, you need to add @objc from the definition of your protocol so that it looks like this:
@objc protocol DeletableImageViewDelegate { ... }
You may ask why you need it. This is because you want to add the delegate property to the storyboard, and in order to set any property visible in the storyboard, it must have the @IBOutlet prefix, and for this prefix it must be the Objective-C protocol.
So, the next thing you want to do is change the var delegate: DeletableImageViewDelegate? on the
@IBOutlet var delegate: DeletableImageViewDelegate?
Now, if you right-click on a view in the interface builder, you will get something like this, which means that we have expanded our delegate property for the interface builder. 
If you try to connect it to the owner of the file (for example, UIViewController ), this will not work, because the owner of your file still does not implement this protocol. To implement it, you need to write:
extension UIViewController : DeletableImageViewDelegate {
After that, you can connect the delegate property to the view controller, thereby receiving delegate method messages. In each case, the file owner must implement the protocol.
source share