Questions tagged [uilongpressgesturerecogni]
147 questions
0
votes
5 answers
Swift - How to get the sender tag for an array of buttons using UILongPressGestureRecognizer?
I have buttons in the storyboard that I put into a Referencing Outlet Collection. I'm using UITapGestureRecognizer and UILongPressGestureRecognizer for all of these buttons, but how can I print exactly which button gets tapped? Bellow is what I…

Ryan Kanno
- 105
- 8
0
votes
2 answers
Recognize both UILongPressGestureRecognizer and UIPanGestureRecognizer on same UIButton
I want to make a UIButton that when you long press it, it will start recording video and if you pan your finger vertically up (while still long pressing), the video will zoom in.
To my button I added a UILongPressGestureRecognizer and a…

Micro
- 10,303
- 14
- 82
- 120
0
votes
1 answer
Trying to call a long tap gesture and run a command but running into a SIGABRT error with the selector in the function. What isn't connected?
My code:
override func viewDidLoad() {
super.viewDidLoad()
//Adding the long gesture
let longGesture = UILongPressGestureRecognizer(target: self, action: #selector(longTap))
//Adding the gesture to the button
…

Leo Marcinkus
- 78
- 1
- 7
0
votes
1 answer
Resolve UITapGestureRecognizer and UILongPressGestureRecognizer simultaneously and fire UIGestureRecognizer.State.began on finger touch down
First of all, none of the already answered questions didn't help me
Swift: Long Press Gesture Recognizer - Detect taps and Long Press
Using tap gesture and long press at the same time in Table View
Long Press Gesture Recognizer Only Fired When…

atereshkov
- 4,311
- 1
- 38
- 49
0
votes
1 answer
Longpress gestureRecognizer producing duplicate locations (SWIFT)
I am making an app where you can add pins to map locations via a long press. However, the long press appears to be duplicating the locations. Here is my code:
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations:…

DevB1
- 1,235
- 3
- 17
- 43
0
votes
1 answer
how show user selected cell of tableview on longpress
Hello i am adding UILongPressGesture in my tableview and i have added successfully but issue is that how to show that cell is selected i mean i want change color of selected cell and when i again do longpress on selected cell than i want to…

Vishal
- 57
- 1
- 7
0
votes
1 answer
Swift Programmatically Launch a UILongPressGesture
I would like to programmatically launch a UILongPressGesture when a user touches a button. This was asked years ago at How can I send a UILongPressGesture programmatically? but I'm wondering if there's a cleaner or more modern solution.
My existing…

Evan Kaminsky
- 695
- 10
- 23
0
votes
1 answer
UICollectionView Cell Button Long Press Gesture return self keep changing?
I'm having something like a shopping cart page, it shows the products the user selected in a collection view, with each cell having 2 button linked to the product that will increase/decrease the amount of product to a singleton cartManager.
So far…

Mango Lord
- 83
- 9
0
votes
0 answers
CABasicAnimation stops when UICollectionView is reloaded
I need help with an issue in Collection Views. In my collectionView I am using UILongPressGestureRecognizer to start CABasicAnimation in the items (images), but when I remove an item and reload the collectionView the CABasicAnimation is…

Afonso
- 87
- 2
- 9
0
votes
0 answers
Proper way to use LongPressGestureRecognizer
I am confused where and how to instantiate variables in the handler for a UILongPressGestureRecognizer (LPGR).
I create the LPGR with:
-(void) createLongPress {
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]
…

user1904273
- 4,562
- 11
- 45
- 96
0
votes
1 answer
Pass UILongPressGestureRecognizer between UIViewControllers
I've looked around on SO and other places online and haven't been able to find a solution yet. I have a UILongPressGestureRecognizer on one view controller which performs an animation on a UIView then presents another view controller (if the user…

Armand
- 15
- 3
0
votes
0 answers
LongPressureGesture won't grab the first cell
So i'm trying to create a way for users to block other users or report them.
I added the the LongPressGesture to my tableView cells, but for some reason, it only works from indexPath 1 and above. It won't grab the index or even recognize the first…

Adrian Navarro
- 135
- 2
- 10
0
votes
1 answer
Swift Long press results
I would like to intercept the value of the long press of this pod :
https://github.com/liyong03/YLLongTapShare
I am developing in Swift and this pod is only Objective-C.
I don't manage to catch the func that handle the end of the selection of the…

Bonilla
- 99
- 2
- 11
0
votes
1 answer
Get time pressed in UILongPressGestureRecognizer
I'm trying to get the time that a UIView is pressed, using UILongPressGestureRecognizer
But, the states of press:UILongPressGestureRecognizer are .began, .end, .cancelled, .changed.
But, I'm trying to know if has x seconds pressed to change the…

Benjamin RD
- 11,516
- 14
- 87
- 157
0
votes
2 answers
Passing uibutton tag through UILongPressGestureRecognizer?
I am trying to use the long press button function but am not sure how to pass the tag of the button to the function. I have an array of buttons called ChannelButton. The long button press works with the code below.
for button in ChannelButton {
…

Seth Haberman
- 131
- 1
- 13