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
7
votes
1 answer

Any differences between @objc and IBAction when programmatically creating UIButton event?

When creating an eventhandler from a UIButton from the Storyboard, Swift adds @IBAction before func. When adding an event programmatically to a UIButton to a func, Swift gives a error and says I need to add @objc in front of my method, but when I…
J. Doe
  • 12,159
  • 9
  • 60
  • 114
7
votes
6 answers

How do I call a button function when the button is not being pressed

I have an IBAction connected to a button, and I wanted to know if there is any way to run that function even if the button is not being pressed. This is what I tried... Note: I am using swift for this project. //I get an error when I type this…
nachshon fertel
  • 145
  • 1
  • 1
  • 11
7
votes
3 answers

Calling IBAction from another method without parameter

In my program 2 functions (IBAction player.Move(UIButton) and autoMove()) are supposed to be called by turns till all of the fields (UIButtons) has been clicked. For this I've created a function play(). However, I don't know how can I put the…
Dandy
  • 929
  • 2
  • 14
  • 23
7
votes
6 answers

Using IBAction Buttons to Zoom MapView

I have an issue. My current location is displayed and centered in a map view however the map region doesn't get zoomed in to. I tried taking Rob's advice by taking span and region out of the didUpdateToLocation method but I must not have implemented…
JBeesky
  • 309
  • 2
  • 14
7
votes
3 answers

IBAction in Xcode 4.5

Anybody experiencing no response for IBAction touchUpInside in Xcode 4.5, deployment target iOS 5 as well? It works in simulator for me having iOS6, but not iOS5.
Michal
  • 15,429
  • 10
  • 73
  • 104
7
votes
5 answers

Use IBAction from UIButton inside custom cell in main view controller

I have created a custom cell with its own .m, .h and .xib file. In the cell, I have a UIButton that I added to the xib in IB. I can receive the IBAction from the UIButton in this custom cell's .m, but really, I'd like to be forwarding that button…
6
votes
2 answers

How can I capture a table row press action in Swift WatchKit?

I currently have a table with some dynamic rows. When I run the probject the rows display on the screen and even have a press animation but xcode won't let me wire up the table row as an IBAction to its controller. I can't use a segue in this…
Evernoob
  • 5,551
  • 8
  • 37
  • 49
6
votes
1 answer

iOS, unrecognized selector sent to instance?

I got a mainscreen with a imported custom actionBar. I created this actionBar in a separate .xib file, with a .m and .h file. I do some graphic setup in my actionBar.m's viewDidLoad like backgroundColor and some other stuff. I also got a button on…
user2408952
  • 2,011
  • 5
  • 24
  • 26
5
votes
1 answer

Connect object in .xib to existing IBAction

I am quite new to iOS Programming. This is my question: I want to connect a new object to an existing IBAction method. For example, I want to buttons to perform the same function. But when I "control-drag" it, it will always ask me to insert as a…
LKS
  • 673
  • 2
  • 10
  • 21
5
votes
3 answers

iOS: Include sender in IBAction declaration?

I have a best practices/stylistic question. Let's say I have an IBAction method and I have no need for the sender parameter (I'm aware how to use the sender parameter if I do need it). Do folks recommend leaving the (id)sender in the method…
Joel
  • 15,654
  • 5
  • 37
  • 60
5
votes
2 answers

Programming a Universal App in iOS

When I am programming a universal app, lets say I have an IBAction like so: (IBAction)magicCode:(id)sender { textField1.text = "TEST"; } Do I need to create a new IBAction for each view (iPad and iPhone). I can't have textField1 twice in…
ios85
  • 2,104
  • 7
  • 37
  • 55
5
votes
3 answers

Why is the IB Action set to exit as object?

I am creating an app that requires notifications. I created a settings page with a switch to toggle notifications for the application. I tried to link the switch to ViewController2 using an @IBAction, but it keeps connecting the object to Exit,…
user10166622
5
votes
1 answer

How to connect outlets and actions in Swift / MacOS programaticly

I have a simple example. I connected the left button1 and label1 with ctrl-draging it to the contollerclass. How can I do the same for the right button2 label2 programaticly (without ctrl-draging) That´s my code: class ViewController:…
mica
  • 3,898
  • 4
  • 34
  • 62
5
votes
1 answer

Can't create IBAction ctrl-dragging UIButton to ViewController (Xcode Version 7.2)

In the middle of my creating the app, xcode quit allowing me to ctrl-drag UIButtons to VCs for creating IBActions. This happens on every VC (nine in all). It does allow for creating Outlets, though. (Pls see image -> no Action selection is…
sakumatto
  • 157
  • 1
  • 9
5
votes
3 answers

UIButton not responding after animation

I would prefer first download the project from below link and then continue with question (only 36kb) Download Link At start what I have is like below. When I click My Office button, I am calling action actionSeenButton which will print…
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
1 2
3
59 60