Error that I'm getting
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[App.DetailController tap]: unrecognized selector sent to instance 0x109803800'
My view controller called 'DetailController' has a small imageView and when the user clicks the image, I want the image to enlarge to full screen, then when clicked again to return to the default image size it had before the full screen.
Problem is that my app is crashing when the imageView is being clicked.
ViewDidLoad
override func viewDidLoad() {
super.viewDidLoad()
iconImage.isUserInteractionEnabled = true
let tapGesture = UITapGestureRecognizer(target: self, action: Selector(("tap")))
iconImage.addGestureRecognizer(tapGesture)
}
func tap() {
let screenSize: CGRect = UIScreen.main.bounds
let screenWidth = screenSize.width
let screenHeight = screenSize.height
iconImage.frame = CGRect(x: 0, y: 0, width: screenWidth, height: screenHeight)
}