I have created a class "DeletableImageView" (.swift + .xib) which uses the protocol I defined as "DeletableImageViewDelegate" through a property I called delegate.
Example for sake of clarity:
DeletableImageView.swift
protocol DeletableImageViewDelegate {
func deleteImageWithTag(tag: Int!) -> (Bool)
func addImageOnViewWithTag(tag: Int!) -> (Bool)
...
}
class DeletableImageView: UIView {
var view: UIView!
var delegate: DeletableImageViewDelegate?
// Some random methods + some use of the delegate protocol's methods
...
}
My problem is that now, when I try to use my class in a controller from the associated .xib file (which means that I drag and drop a view in interface builder and assign the DeletableImageView class to this view) I cannot link the delegate property (even if I declare this property as an IBOutlet).
What I want to be able to do is to directly link the view's delegate outlet to the "File's Owner" in the .xib
The exact same thing you do when you link datasource and delegate from a tableview directly in the .xib file.
But when I control-drag they won't link together.
Does anyone have any idea of what is happening ?
Thank you very much.