Touch down / touch up in IOS using xcode and swift -


I have to apply a thumb print scanner fast with the encoded. I found the gesture identifier but I remember the point where I can respond to the "On-TouchDown" and "On-Touchup" events.

The underlying object is a UIImageView. I am quite new to this and I can not find the proper documentation on this.

Thank you very much

With current iOS devices, the following hardware is supported:

  • A screen which is multi-touch aware
  • A home button that is capable of reading thumbs prints.

So it is not possible to apply a thumb-print scanner to a UIImageView or any UIView. You can however answer the touch, multi touch, acceleration track, speed, movement etc.

Answer to touch the event:

There are some ways to respond to touch events

UIButton:

You can add a UIButton as a subview or in your view, shape it to take the size of the parental view size. Then use the [button addTarget: self action: @selector (some method) control event: UIControlEventTouchUpInside]

Use a UIPanGestureRecognizer: < / P>

Add a UIPanGestureRecognizer:

  _panHandler = [[UIPanGestureRecognizer alloc] initWithTarget: Auto Actions: @selector (panHandle :)]; - (Zero) Panhandle: (UIPNestiocessor *) Identifier; {If ([identifier state] == UIGestureRecognizerStateBegan) {// something else) and if ([identifier state] == UIGestureRecognizerStateChanged) {and some more] and if ([identifier state] == UIGestureRecognizerStateEnded) {// do something  

Lowest level / most flexible / more work:

In your UIView sub-class override:

< Pre> - (zero) touchesBegan: (NSSet *) touches with the avant: (UIEvent *) event {} - (zero) touches: (NSSet *) touches with the avant: (UIEvent *) Event {} - (zero) touch-edge: (nss K *) touches with Avant: (UIEvent *) event {}

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -