Search code examples
iosiphoneswiftuitapgesturerecognizertap

IOS swift app not working when using tap Gesture recognizer


em new to Swift and IOS while developing my first app i am using tap gesture , just dragging and linking it from storyboard to controler view using following code.

@IBAction func taped(_ sender: Any) {

        bgimage.isHidden = false
        butn.isHidden = true
        exit.isHidden = false


}

now app after loading just showing white blank screen and on Xcode screenshot pages can be seen while ruuning the app as u can see pic in following link 1 [chk here too]2any help would be appreciated


Solution

  • You have wired a button to action handleTap(_) but you aren't declaring it. Add it,

    @IBAction func handleTap(_ sender: Any) {
        bgimage.isHidden = false
        butn.isHidden = true
        exit.isHidden = false
    }
    

    Also see