uigesturerecognizer

iOS 13 UIPanGestureRecognizer behave differently from iOS 12

泪湿孤枕 提交于 2020-06-26 08:44:48
问题 I have a custom scroll view that works well before iOS 13 that uses UIPanGestureRecognizer: _panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; _panRecognizer.delegate = self; - (void)handlePan:(UIGestureRecognizer *)gestureRecognizer { UIPanGestureRecognizer* pgr = (UIPanGestureRecognizer*)gestureRecognizer; if (pgr.state == UIGestureRecognizerStateChanged) { // do something } } Now it didn't work well with iOS 13. The handlePan function does

UISwipeGestureRecognizer and ShareExtension: Different behaviour on iOS 12.4 and 13.0 and latest (bug or undocumented?)

对着背影说爱祢 提交于 2020-06-26 05:56:23
问题 I am creating a Share extension and faced with a strange behaviour during my tests on iOS 13.0 and later. I use UISwipeGestureRecognizer to interpret user's swiping gestures on the main view on my extension. This simple code provides below as an example of that I want and works perfectly on 12.4 and older: @interface ShareAndSwipeRootController () @end @implementation ShareAndSwipeRootController - (void)loadView { [super loadView]; [self.view setBackgroundColor:[UIColor redColor]]; [self.view

iOS Simulator Not Recognizing Gestures

柔情痞子 提交于 2020-06-01 07:15:06
问题 I am adding a UISwipeGestureRecognizer and a UITapGestureRecognizer to a view in a view controller's viewDidLoad method. - (void)viewDidLoad { [super viewDidLoad]; [self.view addGestureRecognizer:[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(cardSwipe:)]]; [self.view addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cardTap:)]]; } - (void)cardSwipe:(UISwipeGestureRecognizer *)sender { //get the card. set faceUp to false. CGPoint

How to slow down the speed of UIPanGestureRecognizer?

坚强是说给别人听的谎言 提交于 2020-05-15 07:38:27
问题 I have a method that I would like to call when a 2 finger pan gesture is recognized. I have it setup and working ok, but the problem is that there is only about 15 times I need the method to be called (it filters through images), and by the time I've panned about an inch, the method has been called a hundred times and the images went by so fast I didn't know what was going on. What can I do to slow down my gesture recognizer? UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer

How to slow down the speed of UIPanGestureRecognizer?

喜欢而已 提交于 2020-05-15 07:38:17
问题 I have a method that I would like to call when a 2 finger pan gesture is recognized. I have it setup and working ok, but the problem is that there is only about 15 times I need the method to be called (it filters through images), and by the time I've panned about an inch, the method has been called a hundred times and the images went by so fast I didn't know what was going on. What can I do to slow down my gesture recognizer? UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer

Add UIGestureRecognizer to individual letters of UILabel

て烟熏妆下的殇ゞ 提交于 2020-03-05 03:39:33
问题 Right Now I am making an iOS app and I would like to implement the ability to remove letters in a UILabel by simply "Dropping the letter". The part That I am having an issue with is adding a gesture recognizer to individual letters of a UILabel. I have already searched the web for this and have nothing.Just to be clear, I am NOT adding a gesture recognizer to the whole label, I am only wanting to add it to individual letters. Any help is greatly appreciated. Thanks 回答1: It seems that the

UIPageView Page turn gestures got disabled when used inside UIScrollView

偶尔善良 提交于 2020-03-04 18:37:10
问题 I need to add a UIPageViewController inside UIScrollView. My view hierarchy is UIVIewController (UIView) > UIScrollVIew > UIVIew(ContentView) And inside that, I added my UIPageViewController programmatically. UIPageViewController is loaded perfectly as expected. Scrollview is scrolling as well. But its page gestures got disabled by I guess scrollview. Basically, i need UIPageView inside scrollview. I want the scrollview to scroll only vertically. And horizontal swipes should only work for

(转)iOS手势UIGestureRecognizer

风格不统一 提交于 2020-03-01 08:19:16
UIKit中包含了UIGestureRecognizer类,用于检测发生在设备中的手势。UIGestureRecognizer是一个抽象类,定义了所有手势的基本行为,它有下面一些子类用于处理具体的手势: 1、拍击UITapGestureRecognizer (任意次数的拍击) 2、向里或向外捏UIPinchGestureRecognizer (用于缩放) 3、摇动或者拖拽UIPanGestureRecognizer 4、擦碰UISwipeGestureRecognizer (以任意方向) 5、旋转UIRotationGestureRecognizer (手指朝相反方向移动) 6、长按UILongPressGestureRecognizer 对于不同类型的手势识别器,具有不同的配置属性。比如UITapGestureRecognizer,可以配置拍击次数。界面接收到手势之后,可以发送一个消息,用于处理响应手势动作后的任务。当然,不同的手势识别器,发送的消息方法也会有所不同。 [代码] 一个手指,拍击两次手势 // 创建一个手势识别器 UITapGestureRecognizer *oneFingerTwoTaps = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector

super respondsToSelector: returns true but actually calling super (selector) gives “unrecognized selector sent to instance”

旧时模样 提交于 2020-02-13 04:09:51
问题 OK, I am a little confused. I have a subclass of UIScrollView, which is my attempt at a horizontally scrolling "table view" like UI element. UIScrollView itself sets up UIGestureRecognizers it uses internally, and it appears to set itself up as the delegate for those UIGestureRecognizers. I also have my own UIGestureRecognizer setup on my horizontal table elements/cells and my own class set as delegate for my own UIGestureRecognizer. Since my class is a subclass of UIScrollView, at runtime,

super respondsToSelector: returns true but actually calling super (selector) gives “unrecognized selector sent to instance”

巧了我就是萌 提交于 2020-02-13 04:09:13
问题 OK, I am a little confused. I have a subclass of UIScrollView, which is my attempt at a horizontally scrolling "table view" like UI element. UIScrollView itself sets up UIGestureRecognizers it uses internally, and it appears to set itself up as the delegate for those UIGestureRecognizers. I also have my own UIGestureRecognizer setup on my horizontal table elements/cells and my own class set as delegate for my own UIGestureRecognizer. Since my class is a subclass of UIScrollView, at runtime,