uiswipegesturerecognizer

Swipe Method is getting called twice

蓝咒 提交于 2019-12-12 01:42:11
问题 I have to use swipe functionality in my view controller. so, whenever Iam swiping, my swipe method is getting called twice and the NSlogs which I Wrote inside the (swipe:) method is displaying the content two times. Here is the code which i have used. UIView *swipeView=[[UIView alloc]initWithFrame:CGRectMake(405, 420, 265, 35)]; swipeView.backgroundColor=[UIColor clearColor]; [self.view addSubview:swipeView]; UISwipeGestureRecognizer *gesture; gesture=[[UISwipeGestureRecognizer alloc

UIPageControl - reload page on click of button

ぐ巨炮叔叔 提交于 2019-12-11 21:17:40
问题 I am using UIPageControl and UISwipeGestureRecognizer to switch between pages. This is an extension to this question UIPageControl - Change page on click of button The solution provided in the above mentioned thread enables me to change the page. In my application, the next page needs to be reloaded based on a parameter that is passed when the button is pressed. I am able to pass the parameter and I see it in when I do NSLog in the next view controller. But I am unable to understand why the

Access UITableView cell and swipe between them from DetailView using XCode 4

那年仲夏 提交于 2019-12-11 17:33:26
问题 I'm making my first app and I’m using XCode 4 with a Storyboard. Thanks to this place, lots of tutorials, Apple’s archives databases and a bit of me, I’m slowly getting the basics together. It’s an app populated from a plist. The plist is an array with dictionaries, the dictionarires containing stings with info about different red wines in Norway. First, the plist populates a TableView. I’m using NSSortDescritor to sort the TableView and added a button to the navigation bar for resorting if I

iOS - UIPageControl page indicator dots not changing with UISwipeGestureRecognizer

风流意气都作罢 提交于 2019-12-11 12:09:03
问题 I am using UIPageControl and UISwipeGestureRecognizer to switch between 2 view controllers of my application. I have modified this tutorial without using scroll view. I have 2 issues: 1) Using the swipe gesture is changing the view controllers/pages but not the dots indicating the current page. I have tried if (self.pageControl.currentPage == 0) { self.pageControl.currentPage = 1 } but I am not sure why it does not work. I have the outlet available @property (strong, nonatomic) IBOutlet

How to detect a flick gesture using UISwipeGestureRecognizer?

我与影子孤独终老i 提交于 2019-12-11 08:35:12
问题 I heard that UISwipeGestureRecognizer can be used to distinguish between a slow swipe and a fast flick. But I can't find any API to tell the difference. 回答1: Do you specifically need to use UISwipeGestureRecognizer , or can you use UIPanGestureRecognizer instead? UIPanGestureRecognizer gives you precise movement data whereas UISwipeGestureRecognizer is more basic and just detects whether or not a swipe happened (and in which direction). UIPanGestureRecognizer has a -velocityInView: method

Swipe Gesture Recognizer not working for me

梦想的初衷 提交于 2019-12-11 04:00:59
问题 Im trying to add Swipe Gesture Recognizer to my app so I can swipe to either left or right to get to another view controller. I drag the object to the viewcontroller that I want, link it up so when swiping right it should take me to another viewcontroller. I run the simulator but the swipe feature doesn't take me to the other view. When creating a new project, just adding 3 viewcontroller and swipe gestures I can swipe in the simulator and it takes me to another viewcontroller. But doing the

UISwipeGestureRecognizer not firing

那年仲夏 提交于 2019-12-10 22:28:04
问题 I have a UISwipeGestureRecognizer setup in IB linked to my view like so: Extremely trivial, done it a million times. However this time it never fires >:| Here is my method that should be called when a user swipes. However this never gets called. No it's not accidentally added to a subview Yes the Pan gesture works perfectly. I have another view setup almost exactly the same as this that works fine. Any ideas? 回答1: Try this delegate Method in your ViewController Returning YES is guaranteed to

Swipe gesture for back/forward in UIWebView?

孤者浪人 提交于 2019-12-09 17:56:09
问题 I have a WebView in my app. Because it is a tabbed application I'm not able to add buttons for going back/forward on the website. I want to go back/forward by swiping. Right swipe from the left side/edge is back… like in Safari browser for iOS. How can I do it? I think i should use "Screen Edge Pan Gesture Recognizer", right? 回答1: Why not just use a swipe gesture recognizer? UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector

How to detect a swipe event in a UITableViewCell with a UISwipeGestureRecognizer

*爱你&永不变心* 提交于 2019-12-08 12:57:56
问题 I have a UITableViewCell class where I want to detect the swipe event (delete) in order to hide some graphics drawn in the drawRect First I added a UISwipeGestureRecognice to the cell: // Init swipe gesture recognizer self.swipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeCell:)]; self.swipeRecognizer.direction = UISwipeGestureRecognizerDirectionLeft | UISwipeGestureRecognizerDirectionRight; self.swipeRecognizer.delegate = self; [self.contentView

How to swipe gesture segue back to previous view ios?

我的未来我决定 提交于 2019-12-08 06:19:02
问题 I'm trying to segue back to (QueryController) the view i came from. But no swipe actions occurs... Not sure what im missing. @implementation ProfileController4 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization UISwipeGestureRecognizer * Swiperight=[[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swiperight:)]; Swiperight.direction