I have the following screen:

X is an image UIButton, I add the corresponding action to the button. But when I click on the button, it never works on the code in action.
Here is the code:
@IBAction func CloseProfilePage(sender: AnyObject) {
self.removeAnimate();
}
This is the code that is used to run the observable controller of the form:
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
let selectedAppointment = self.dayDatasource!.appointmentAtIndex(indexPath.item);
let profilePageViewController = ProfilePageViewController.init(withAppointment: selectedAppointment);
profilePageViewController.view.frame = self.view.frame
self.view.addSubview(profilePageViewController.view)
profilePageViewController.didMoveToParentViewController(self)
}
The button is definitely associated in xib with the action:

When I look at the view hierarchy, there will be nothing on the button that will prevent the button, but will record clicks. I assume that imageView UIButtoncan be clicked as part of its button.

The X in the image is not a representation of the image that I added, it is a representation of the image that comes with UIButton. With that said, I also resorted to the following:
self.profilePageClosePopUpButton.imageView?.userInteractionEnabled = true;
. ?