Questions tagged [uilongpressgesturerecogni]

147 questions
0
votes
2 answers

How to define a single UILongPressGestureRecognizer for all buttons? In swift 3

I have 20+ buttons and I want to define a single UILongPressGestureRecognizer for all, is it possible? So far this doesn't work: let longPressGestureRecognizer = UILongPressGestureRecognizer(target: self, action:…
iOSNewbie
  • 85
  • 1
  • 9
0
votes
0 answers

How to implement Swipe and Hold gesture recognizer in Objective-C?

I am working on an application which works like a remote control of different devices like Game Console, Set-top Box, etc. Application contains different type of controls like gesture and buttons to perform events as remote. Single gesture view…
0
votes
4 answers

How to handle touch events and gesture events on a UIButton?

In the app, I have couple of dynamic buttons which is created and added to UITableView, each buttons having a touch event (UIControlEventTouchUpInside) and a long press gesture (UILongPressGestureRecognizer), I want to perform any one action at a…
0
votes
1 answer

How to change color of a UIButton while pressed ONLY and cancel color change if released before x amount of seconds?

I'm trying to make a button change color while being pressed for 3 seconds. Once timer reaches 3rd second the color change is permanent but if user releases button before time is up the button goes back to its original color. What I have so far is…
ioskaveen
  • 196
  • 1
  • 4
  • 14
0
votes
1 answer

UILongPressGestureRecognizer not working after archiving application

When testing in iPad, I can successfully call the method attached to UILongPressGestureRecognizer in UILabel. After I have archived the application for Enterprise deployment, UILongPressGestureRecognizer does not work anymore. I have already added…
Lie-An
  • 2,563
  • 3
  • 17
  • 20
0
votes
2 answers

UIButton not going changing text color when there is long-press gesture recognizer

I have the following code: deleteAllButton.setTitle("Delete", forState: .Normal) deleteAllButton.titleLabel?.numberOfLines = 2 deleteAllButton.setTitleColor(UIColor.blackColor(), forState: .Normal) …
Foobar
  • 7,458
  • 16
  • 81
  • 161
0
votes
1 answer

How to disable the long press gesture of a QLPreviewController

I have a UIView as the main view and add a QLPreviewController as the subview over that while previewing the document. I want to restrict the long press gesture so that no one can copy contents from the document. I have tried the following…
0
votes
1 answer

UICollectionView within UIScrollView: Long Press

I have added a UILongPressGestureRecognizer to my UICollectionView that is within a subclass of UIScrollView. (The UIScrollView is paged so there are 3 horizontally stacked UIViewControllers). My code to add the…
Raesu
  • 310
  • 2
  • 15
0
votes
2 answers

Pass collectionview from function to Selector (UILongPressGestureRecognizer)

So I am using a function that a user can do a long press on a UICollectionView (note: I have multiple collection views on my screen). This triggers an action, but when I try to pass the collection view from my longPressFolder function to the…
0
votes
2 answers

Detect LongPress when certain condition is met

I am using UILongPressGestureRecognizer in my collection view, i want long press gesture recogniser should work only if certain condition is met. NSString *check; if([check isEqualToString:@"Enabled"] { //long press should be detected. or…
Developer
  • 822
  • 9
  • 23
0
votes
0 answers

UILongPress Drag into a UIView within a ScrollView

I have a scrollView called sidebar. When I drag my finger on the screen close to the edge of my phone the sidebar pops op. Within the sidebar are UIViews that are subviews of sidebar. Additionally, each view is associated with a viewController. So…
user5194501
0
votes
1 answer

iOS Long Press is not working on Map

I am trying to get the location after a long press to dray an overlay around that location. However, the action I set on the long press is not firing. -(void) viewWillAppear:(BOOL)animated{ [super viewWillAppear:YES]; //add the long press…
Igal Flegmann
  • 582
  • 1
  • 8
  • 19
0
votes
0 answers

UILongPressGestureRecognizer not running function

within my viewdidload() I initialized the longpressgesturerecognizer like so override func viewDidLoad() { super.viewDidLoad() let lpgr = UILongPressGestureRecognizer(target: self, action: "action:") lpgr.minimumPressDuration = 2.0 …
maz
  • 349
  • 2
  • 3
  • 15
0
votes
1 answer

Swift UILongpressGestureRecognizer

I has create a job for Long press button but how can I set long press button and add number at to Label like 1+1+1+1+1 import UIKit class ViewController: UIViewController { var Step : Int = 0 var timer = NSTimer() @IBOutlet weak var CounterLabel:…
高小高
  • 37
  • 7
0
votes
1 answer

Swift, UILongPressGestureRecognizer Not working in UIlabel

I am trying long press Gesture in Swift for Copy Option. But it is not working. It is not identifying the Gesture in UiView Or UILabel either. Below is my Code In View DidLoad let copyLongPress = UILongPressGestureRecognizer(target: self,…
dhaval shah
  • 4,499
  • 10
  • 29
  • 42