I have the code below, copyright Paul Hudson, from one of his lessons online. And it works just fine. But I tried to also capture the tapping gesture through Xcode's IDE ctrl-drag method.
That method only allows me to create an IBOutlet connection.
I was hoping there was a way to do this through the IDE, just to make things quicker? When I did someone else's lesson online, ctrl-dragging a button (with Asst. Editor) did allow me to add and @IBAction connection.
If anyone can tell me if there is something I am missing?
Thank you
That method only allows me to create an IBOutlet connection.
I was hoping there was a way to do this through the IDE, just to make things quicker? When I did someone else's lesson online, ctrl-dragging a button (with Asst. Editor) did allow me to add and @IBAction connection.
If anyone can tell me if there is something I am missing?
Thank you
Code Block import UIKit class MemoryViewController: UIViewController { @IBOutlet weak var textView: UITextView! var item: MemoryItem! var blankCounter = 0 override func viewDidLoad() { super.viewDidLoad() showText() // capture tap gesture from touchscreen let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(wordsTapped)) textView.addGestureRecognizer(tapRecognizer) } func showText() { // code to fill cell } @objc func wordsTapped() { ....misc code showText() } }