The type of enum constant for the kinds of control events possible for control objects.
Questions tagged [uicontrolevents]
104 questions
129
votes
13 answers
Passing parameters to addTarget:action:forControlEvents
I am using addTarget:action:forControlEvents like this:
[newsButton addTarget:self
action:@selector(switchToNewsDetails)
forControlEvents:UIControlEventTouchUpInside];
and I would like to pass parameters to my selector "switchToNewsDetails".
The…

Pierre Espenan
- 3,996
- 5
- 33
- 51
34
votes
1 answer
How can I send a "UIControlEventValueChanged" event from my custom control?
I've created a custom picker view type of control by subclassing UIView. I would like to be able to send a "UIControlEventValueChanged" control event from within this control, so that I can register for it in whichever view controller is using the…

Christian Gossain
- 5,942
- 12
- 53
- 85
28
votes
7 answers
UIDatePicker bug? UIControlEventValueChanged after hitting minimum internal
I've run into a weird effect that sure looks like a bug in iOS7 -- but often in the past, when I have thought I found a bug in Apple's APIs, it has turned out to be my own misunderstanding.
I have a UIDatePicker with datePickerMode =…

Joe Strout
- 2,634
- 2
- 28
- 39
27
votes
3 answers
Differences between `.EditingDidEnd` and `.EditingDidEndOnExit`
What exactly are the differences between the UIControlEvents .EditingDidEnd and .EditingDidEndOnExit, and how do they relate to each other?
The documentation on UIControl is pretty vague, and has no information of whether these fire for different…

Kazmasaurus
- 608
- 7
- 12
10
votes
3 answers
How to get the touch coordinates from a valueChanged event in Swift
Background
I've previously learned how to use a Gesture Recognizer or continueTrackingWithTouch to get continuous updates of the current touch location and to then use those to do something like this:
Now, however, I would like to learn how to do…

Suragch
- 484,302
- 314
- 1,365
- 1,393
10
votes
4 answers
UIButton Highlighted State not showing when clicking over a Selected UIButton
I want my UIButton to show up the highlighted state when I click over a button that is already selected.
Basically in the highlighted state I apply a *.png image as my UIButton backgroundImage to give a pressed down effect.
But if the button is…

luca
- 36,606
- 27
- 86
- 125
9
votes
2 answers
What control events start and end highlight state of UIButton
I am creating piano-like view with UIButton as piano keys. What UIControlEvents should I listen for to get callbacks when button gets and loses highlighted state?
I tried to make subclass of UIButton and add property observer for highlighted and it…

Kirsteins
- 27,065
- 8
- 76
- 78
9
votes
4 answers
Custom UIView addTarget?
I am creating a custom UIView. I am wondering how can I replicate the UIButton behavior on this UIView.
I would like to be able to call addTarget to it like an UIButton.
I know that I can subclass UIControl and call…

JayVDiyk
- 4,277
- 22
- 70
- 135
6
votes
1 answer
UIButton UIControlEventTouchUpInside does not fire, but UIControlEventTouchDown does fire
I am implementing UIButton and my UIControlEventTouchUpInside event does not fire, even though UIControlEventTouchDown does fire.
UIButton *btnClose = [UIButton buttonWithType:UIButtonTypeCustom];
NSString *filePathImage = @"img.png";
NSString…

iosdevnyc
- 1,873
- 5
- 25
- 48
6
votes
3 answers
How to create a custom UIControlEvent in Swift?
I'm creating a custom UI-Element and want to trigger a custom UIControlEvent. I already found out, that there is a range ApplicationReserved.
Sadly this doesn't work, because it "does not conform to protocol 'RawRepresentable':
enum MyCustomEvents :…

hendra
- 2,531
- 5
- 22
- 34
5
votes
2 answers
UIControlEventValueChanged event is not triggered for the UIPageControl consistently
Lets assume we have ten pages.
An event handler for the event is added as below:
Run the app.
Now in the ten pages, by default page 1 (index 0) is selected. Touch the second page or third page. The event wont be triggered. If the last page is…

RK-
- 12,099
- 23
- 89
- 155
4
votes
1 answer
Date Picker with UIControlEvents.valueChanged doesn't work on the first value change event
I'm using the code below to learn about Date Picker. It works, but the weird thing is the expected changes will not happen when I scroll the date picker for the first time. After that it will work normally. Wonder what happened.
import UIKit
import…

Hannah Han
- 79
- 1
- 8
4
votes
2 answers
How Do I Log UIControlEvents?
I am trying to figure out how to log the UIControlEvents so that I can see exactly which ones I want to add to my UIButton.
I can't seem to figure it out. Here is what I've tried so far:
[button addTarget:self…

daveMac
- 3,041
- 3
- 34
- 59
4
votes
4 answers
How to distinguish between fired events for a UIButton callback action
When defining a callback for a UIButton I listed several events for the same action
In the target I would like to be able to distinguish what event triggered the callback
[button addTarget:self action:@selector(callback:)…

Avba
- 14,822
- 20
- 92
- 192
4
votes
3 answers
Passing action to one uiview to another in IOS
I have created a UIView called ImageShowcase which has a UIScrollView and then i am adding UIButton inherited class call ImageShowcaseCell. Its working fine. One thing i am puzzled about is what is the best way to handle actions in a view controller…

Mirza Bilal
- 891
- 11
- 34