Questions tagged [uicontrolevents]

The type of enum constant for the kinds of control events possible for control objects.

104 questions
0
votes
2 answers

How to check for specific events in method touchesBegan:withEvent:

How can I add a check in the method below so that the method will only respond to the event "UIControlEventTouchUpInside"? -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { } Can I check the event? Like if (event ==…
Zhen
  • 12,361
  • 38
  • 122
  • 199
0
votes
2 answers

Draggable UIButton does not respond to UIControlEvents

When creating a Draggable UIButton, the dragging events work as they should, however, I am unable to figure out why the UIControlEvents do not respond when the button is simply pressed and not dragged. Creating the Button DraggableButton * camera =…
WrightsCS
  • 50,551
  • 22
  • 134
  • 186
0
votes
0 answers

Find UIControl.Event that produced an action

In iOS you can assign an action method to several UIControl events, eg. ........... self.addTarget(self, action: #selector(onTouch(sender:forEvent:)), for: .allTouchEvents) …
cyanide
  • 3,885
  • 3
  • 25
  • 33
0
votes
1 answer

UIViewContorller's touch event is still received even a view has added

There is a simple UIViewController with two buttons, every time a button is pressed, a full screen view will be added to the viewcontorller's view, as its size is the same as the viewcontroller. We know that if a view is overlapped its parentview,…
Sayaka
  • 21
  • 2
0
votes
2 answers

UISwitch value changed event fires before UITextField editing did end

In my application there are many UISwitches and UITextFields displayed in a list of UITableViewCells. When the user starts editing a UITextField and then taps on a UISwitch the order of the events causes the UITextField to display the value of the…
Peter G.
  • 7,816
  • 20
  • 80
  • 154
0
votes
1 answer

Set the current Value of UITextField to a property when UITextField's "editingDidBegin" control event fire

How to set the current value of UITextField to a property(through a custom setter) declared in category which extends UITextField class when firing editingDidBegin control event of UITextField?
0
votes
1 answer

How create target for UIButton with long-time press(repeating handler)?

I try to create UIButton, which will increase some variable with long-pressing. So, when user touch button for long time increasing handler repeats. I have something like this: Swift 4.0 @IBOutlet var increaseButton: UIButton! var someVariable =…
Golovanov Dmytrii
  • 527
  • 1
  • 6
  • 20
0
votes
2 answers

Adding multiple UIButtons to an UIView with a selector action

I've added some buttons to an UIView (via addSubview) programmatically. I’ve added to this button an @selector with a function. However, they appear in the view but when I do click, the last button works only. Into my .h: @property (nonatomic,…
user3745888
  • 6,143
  • 15
  • 48
  • 97
0
votes
1 answer

How to disable UIControlEventEditingChanged

I have a UIViewController with several UITextFields. When tap one text field, it should present the barcode scanning view controller. Once the scanning is completed, my barcode scanning viewcontroller is disappearing (used "dismissViewcontroller")…
swift droid
  • 107
  • 1
  • 14
0
votes
1 answer

What does the term 'session' mean in layman terms for the editingDidBegin property of the UIControlEvent object?

While following a tutorial, I prejudged the next step of the tutorial and decided to try it on my own. The objective is to connect an IBAction function to a touch event so that once we begin editing a UITextField then it will update a UILabel. I…
Laurence Wingo
  • 3,912
  • 7
  • 33
  • 61
0
votes
5 answers

Subview button is not working

masterBtn.addTarget(self, action: #selector(self.masterBed), for: UIControlEvents.touchUpInside) i have used above code in subview but it doesn't fire function masterBed. the button within subview is not clickable Full code: let button =…
Rushikesh Welkar
  • 143
  • 1
  • 2
  • 8
0
votes
0 answers

Swift: Execute closure prior to UIRefreshControl start

We have this: self.refreshControl?.addTarget(self, action: #selector(MyController.userRefresh(refreshControl:)), for: UIControlEvents.valueChanged) func userRefresh (refreshControl: UIRefreshControl) { sync() } Is there another UIControlEvents…
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
0
votes
3 answers

Swift add target for paste action UITextField

I have a UITextField that has a target added which performs checks on the field as the user is typing. I currently have an issue however when my code adds text to the textfield in that the text doesn't get checked. Is there a way I can solve this…
user7684436
  • 697
  • 14
  • 39
0
votes
0 answers

UIControlEventTouchUpInside not called after separate touch event

I have an interface where you can hold a button down with one hand, and manipulate settings with the other hand via a pan gesture or a pinch gesture. The problem is that the UIControlEventTouchUpInside callback for my button is never called after…
Cbas
  • 6,003
  • 11
  • 56
  • 87
0
votes
2 answers

Touch Drag Inside a UIButton after 5 pixels instead of default 1 pixel

I have a single UIButton on a storyboard. The UIButton is connected to a Touch Drag Inside action myTouchDragInsideAction. The action is triggered when a user drags the button from inside (UIControlEventTouchDragInside). The problem is that the…
user4806509
  • 2,925
  • 5
  • 37
  • 72