Questions tagged [ibaction]

IBAction is a type qualifier used by Interface Builder to synchronize with Xcode.It is available in iOS 2.0 and later. The tags [UIButton] should be used to ask about Apple's UIKit frameworks UIButton action. Use the related tags [ios] , [UIButton] and [IBAction] for issues specific to those platforms.

IBAction is a macro defined to denote methods that can be referred to in Interface Builder.

As indicated in Apple's documentation, it is defined as void:

#define IBAction void

Relevant Stack Overflow question: IBOutlet and IBAction

891 questions
2
votes
1 answer

UIViewControllers sharing 'generic' IBAction

I have an app with 6 UIViewControllers. ANY viewcontroller features a function like this one: @IBAction func onHelp(_ sender: UIBarButtonItem) { DispatchQueue.main.async(execute: { () -> Void in let helpVC = …
user5273262
2
votes
1 answer

IBAction Doesn't Get Called in Subview

I am creating a simple app that let's the user view movies after clicking buttons. The first screen you see is the Main Menu with 2 buttons. One of them sends the user to a sub view which I coded as this in an IBAction method: ViewConroller…
Link
  • 396
  • 1
  • 4
  • 15
2
votes
2 answers

How can I keep the image color of UIButton from resetting to default?

This question is about Swift 4, Xcode 9.3.1. The process to change the color of an image button is well documented. That's not the problem. This question is about WHY the color of an image button resets to the default color if the button happens to…
Dale
  • 5,520
  • 4
  • 43
  • 79
2
votes
2 answers

How to return(skip the rest of) a function in swift if conditions are met

I have a segue set up to perform when a button is pressed. I want to end the function and void the segue if the text field in the current view controller is nil. No luck so far. How would I go about doing this? Here is what I have: @IBAction func…
r405
  • 31
  • 4
2
votes
1 answer

View/Window won't update until @IBAction is complete

I have a button linked to an IBAction that takes around 5-10 seconds to complete. While the IBAction function is running I want to print progress messages in my view/window. The only message that prints is the last one, and it prints after the…
2
votes
1 answer

Swift App runs but no buttons appear

I wrote a Swift app but only the window appears when it runs. I can't see any buttons. Here is my code... I've tried removing the .white attribute thinking maybe it was hidden behind a layer. Nothing. // // ViewController.swift // …
yeeeeee
  • 163
  • 3
  • 16
2
votes
3 answers

how to display and hide the container view on button click

I have a view controller which consists of a container view which is half of the screen size over an image view, which is initially hided. the container is embedded with the tableView. i have a button which on click will display the container view…
gowtham
  • 73
  • 1
  • 11
2
votes
3 answers

Location of touch in UIButton action

I'm trying to get the (x,y) location of where a button is tapped. I've found answers but they don't work for Swift 2.3. Any suggestions? That's what I have tried: @IBAction func buttonTapped(sender: AnyObject, forEvent event: UIEvent) { let…
Marc Ibrahim
  • 299
  • 5
  • 18
2
votes
1 answer

UIButton event 'Touch Up Inside' not working. 'Touch Down' works fine

I've got a UIButton in a UIView, which is in a UIViewController that I've allocated and inited from a .xib file. When hooking an IBAction up to the 'Touch Down' event of a UIButton it triggers correctly. But if I hook it up to the 'Touch Up Inside'…
Rich Brooks
  • 521
  • 1
  • 6
  • 17
2
votes
2 answers

im getting error message "expected ')' in expression list" connected to @IBAction func createaccountButton

@IBAction func createaccountButton(sender: AnyObject) { !Expected ')' in expression list FIRAuth.auth()?.createUserWithEmail(emailField.text!, password: passwordField.text!, completion: { (user, error) in if error == nil { …
alex powers
  • 41
  • 1
  • 2
2
votes
1 answer

Missing argument for parameter #1 in call // Twitter

I am creating an app that generates a diferent quote everyday. I wanted to give the user the ability to Share with twitter the quote that was given. I was able to get twitter to pop up with the tweet box, but the quote was not showing up. I tried to…
DrPepperGrad
  • 361
  • 1
  • 4
  • 17
2
votes
3 answers

IBAction from a UIButton inside a UITableViewCell

I created a UITableViewCell in Interface Builder which I have added a UIImageView and a UIButton to. I have given the UIButton an outlet, and hooked it up to a IBAction with the touch up inside event set. I assumed it would call this method, as…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
2
votes
2 answers

Limit users action - Swift

I'm trying to implement a vote feature on my app. I would like the user to only vote once on my app after he presses the button. The user can't press button after it's pressed, however, when cancelled and reloading the app the user can still press…
Bachenenad
  • 65
  • 7
2
votes
0 answers

IBAction from (not to) my custom class

Remember typical situation: we have UIButton, we have some event triggered by something (in our case let it be UITouchUpInside) AND some IBAction somewhere (for example in our UIViewController) that will be called when event occurs. IBAction is…
Fyodor Volchyok
  • 5,610
  • 4
  • 28
  • 45
2
votes
1 answer

iPhone: “Unrecognized Selector Sent to Instance” Error

I’m trying to implement a partial overlay modal in my app with the code from “Semi-Modal (Transparent) Dialogs on the iPhone” at ramin.firoozye.com. The overlay functionality works and it slides the modal into view, but calling any IBAction from the…
Cuzog
  • 117
  • 2
  • 8