I have a UIView with 4 buttons on it and another UIView on top of the buttons view. The top most view contains a UIImageView with a <
@Magic Bullet Dave's solution but in Swift
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
var pointInside = false
if commentTextField.frame.contains(point) {
pointInside = true
} else {
commentTextField.resignFirstResponder()
}
return pointInside
}
I use it in my CameraOverlayView for ImagePickerViewController.cameraOverlay to give user ability to comment while taking new photo