Disable gesture recognizer iOS - iphone

i'm developing a application for gestures recognizer for iPad and i want to disable the default gesture recognizer of the iOS. When i ask a way do disable the gestures recognizer is using my own application, so i need a way using some functions of the api and not using the settings way.

I don't completely understand your question.
You can add UIGestureRecognizer to objects. You can also remove them.
- (void)removeTarget:(id)target action:(SEL)action
For example:
[imageView addGestureRecognizer:singleTap];
[imageView removeGestureRecognizer:singleTap];

The four- and five- finger gestures are not officially part of iOS, and may never be.
Though it would be best to figure out an alternative, you should be able to use these gestures for now and not fear conflicts (save on the iPads of developers who have specifically turned on this feature, whose users know that said features may conflict with apps.)

One alterative is to change your design to avoid 4-5 finger swipe. From what i know, the 4-5 gesture setting is for end-users to return home screen/open up multitasking bar and you can't do anything about it till Apple releases it for developer, right now it's still on the stage of experimenting for end users.

You can use a UITapGesture and set the number of touches in the Attribute Inspector if you want multiple touches. Doesn't this do what you want?

when you go to gestures in the assistive touch menu, to disable it you swipe to the right like you would to delete a song or a note.

Related

Using UITapGestureRecognizer rather than manually calling tapCount

I've been checking for multiple taps, whether it is 2 or 10 by simply calling tapCount on any touch:
[[touches anyObject] tapCount]==2
This simply checks for a double tap.
It works fine. I'm wondering if there is any particular reason to instead start using UITapGestureRecognizer.
It would seem that the UITapGestureRecognizer API provides wrappers around the same functionality as just inspecting touches directly, as above. Things like tapCount and the number of fingers on the screen don't require UITapGestureRecognizer.
For things like swipes, I can see the simplicity in letting UIKit handle recognizing those, as they are harder to code manually, but for a tapCount? Where's the real gain here, what am I missing?
Gesture recognizers provide for coordination in processing multiple gesture types on the same view. See the discussion of the state machine in the documentation.
If a tap is the only gesture of interest, you may not find much value, but the architecture comes in handy if you want to coordinate the recognition of taps with other gestures provided either by you or system supplied classes, such as scroll views. Gesture recognizers are given first crack at touches, so you will need to use this architecture, if you want, for example, to recognize touches in a child of a scroll view, before the scroll view processes them.
The gesture recognizers can also be set to defer recognition, so, for example, the action for a single tap is not called until a double tap has timed out.
In general, the gesture recognizer approach is a good one to adopt because it allows gestures to be managed in a consistent fashion across apps and code sources. If Apple wanted to add an assistive technology preference that allowed the user to select a longer over which a double tap would be recognized. they could do this without requiring any changes to the code of developers using standard gesture recognizers.
I should add that gesture recognizers can be added directly to your storyboard or nib, so in most cases you only need to code the target action, which could be a time saver in new code.
UITapGestureRecognizer provides a cleaner, easier to use API, but no new functionality. So for your case, no reason.

Confining a swipe gesture to a certain area (iPhone)

I have just managed to implement detection of a swipe gesture for my app. However I would like to confine the area where the gesture is valid. Thinking about this I came up with a possible solution which would be to check whether the start & finish coordinates are within some area. I was just wondering if there's a better or preferred method of doing something like this.
Simply create an invisible UIView (= with transparent background) and set its frame so it encloses the region you want to detect the gesture into.
Then, simply add a UISwipeGestureRecognizer to that view, and you are done.
Read the generic UIGestureRecognizer Class Reference and the part of the Event Handling Guide for iOS that talks about UIGestureRecognizers for more info.
Of course you could also manage the detection of the swipe gesture by yourself using custom code like explained here in the very same guide but why bother when UIGestureRecognizers can manage everything for you?

how to stop user use more than two fingers to touch

in my app, I want users only use one finger to touch the ipad, it means, when you touch the screen, others touches won't respond events......
any helps?
try disabling multitouch throug IB or through code.
keep a track of count of touch, and then implement it accordingly.

Springboard-like scrolling/view switching with snapping on iOS

Is there a way in cocoa touch to implement view switching behavior like the one in iPhone's springboard? I mean horizontal scrolling with 'snap to view' animation (views are switched only after certain 'scrolling' threshold has been reached)
Look at the 'pagingEnabled' property on UIScrollView.
SpringBoard, App Store and Mobile Safari use a UIPageControl in conjunction with a UIScrollView to provide the little dots you see at the bottom of the screens, that you swipe across with that snap effect.
What views you want to swipe through depends on your application, though, as you're essentially swiping through a UIScrollView.
This isn't an answer, but I know it's possible. I have seen this behavior in "Twitter for iPhone" and asked myself the same question. If you use that app, check out what happens when you swipe the individual tweets to reveal more controls underneath.
This looks like it's part of TableCellView and some touch drag combination. As for the implementation of that... well, im too novice right now.

Drag & sweep with Cocoa on iPhone

I'm about to start a new iPhone app that requires a certain functionality but I'm not sure if it's doable. I'm willing to research but first I just wanted to know if I should at least consider it or not.
I haven't seen this in an app before (which is my main concern, even though I haven't seen too many apps since I don't own an iPhone), but an example would be the iPhone shortcuts panels: you can hold on an app, and then drag it to another panel, sweeping while still dragging it. But this is the core app, is it possible to reproduce something similar within a normal app?
I only need to be sure it can be done before I start digging, I don't need code examples or anything, but if you have some exact resources that you consider helpful, that would be appreciated.
Thanks!
Yes. If you have your custom UIView subclass instance inside a UIScrollView, your view controller just needs to set the UIScrollView to delay content touches and not allow it to cancel touch events.
[scrollView setCanCancelContentTouches:NO];
[scrollView setDelaysContentTouches:YES];
When the user taps and holds in the custom view, the event goes to that custom view, which can process the touch events to drag an item around, but if the user quickly swipes, it scrolls the view.
The "panel" view that you're referring to appears to be a UIPageControl view — although, perhaps, the specific incarnation of this view that Apple uses for the iPhone's home page may be customized.
Instances of generic UIView views that you might touch-and-drag will receive touch events. By overriding methods in the view, these events can be processed and passed to the page control, in order to tell it to "sweep" between pages.
If I wanted to do what you're asking about, that's how I might approach it. It seems doable to me, in any case.
Start with this: Swip from one view to the next view
Try using a UIButton that tracks the time since the state of the button changed to "highlighted". You may need to do this in order to track the dragging and move the button around:
Observing pinch multi-touch gestures in a UITableView
Check to see if the button starts overlapping one side of the screen while being dragged. If s certain amount of time elapses since the button first started overlapping the edge and then manipulate the UIScrollView so that it switches to the next page on the corresponding side of the screen
You may need to use NSTimer to keep track of how long the button is held down, etc.
In any case there's no reason why this couldn't work.
If UIButton doesn't work then perhaps try a custom subclass of UIControl (which tracks the same touch down actions etc.). If that doesn't work then use the window event intercept thing to track everything.