Hi, new to Swift and iOS development. On page 31, XCode 8.1 (8B62) doesn’t seem to recognize that showAlert() should be a option under “Sent Events” in the menu that comes up after right-dragging the “Hit Me” button to ViewController. I’ve already added the showAlert() function mentioned on page 29.
Please see the attached link at imgur.
Thanks in advance for the help in what’s probably just a simple misunderstanding in learning a new tool.
The code looks fine. You can even tell that Xcode recognized
showAlert() as a valid action because there is a little circle next to it.
Maybe try restarting Xcode? It sometimes helps…
I’ve found the issue. You don’t seem to be able to CRTL+drag from the UIButton itself, but must first right-click to show the dark menu. Afterwards, you can drag from the circle to the right of “Touch Drag Inside” under “Sent Events” to the ViewController.swift.
Is there a method to suggest this addenunum to this otherwise awesome tutorial series? Using XCode 8.1 (8B62), which might just have some quirks.
It is strange that Ctrl-dragging from the button doesn’t work for you. Sounds like a bug in Xcode.
Same thing happened to me in Xcode 10.3. Closing it worked for me and reopening then it showed right up.