Diese paar Zeilen Code helfen schnell zu verstehen wie man einem Image die Tap Geste beibringt.
override func viewDidLoad() { super.viewDidLoad() self.imgPlacesPic.isUserInteractionEnabled = true; let tapGesture = UITapGestureRecognizer(target: self, action: #selector(self.tapGesture)) imgPlacesPic.addGestureRecognizer(tapGesture) } @objc func tapGesture() { performSegue(withIdentifier: "FromMainToImages", sender: self) }
Über den Autor