MMDrawerController pan gesture behaviour when center controller has Scroll View - ios

I'm looking for help from someone who have used MMDrawerController.
I've downloaded example project and it has a table view as a center view controller. Pan gesture works correctly - it starts to open the drawer only if the gesture is mostly horizontal. Drawer does not open when you scroll table view. This is the desired behavior for me.
But when I set up my own project and there's scrollView or tableView - scrolling them up and down opens the drawer if the scrolling gesture has even the slightest horizontal component which is confusing and barely usable.
I've tried to understand what makes the difference in the example project looking through code, but with no success. I didn't find any gesture recognizer callback overrides or anything like that what is changing the gesture behavior.
I've looked through threads on SO considering MMDrawerController, but didn't find anything similar.
I do know that I can override some things in MMDrawerController subclass to change the gesture recognition completely and probably achieve desired behavior this way, but I don't want to reinvent the wheel here. Probably there is some easy answer that I overlooked.

I've found the origin of my problem. It has nothing to do with the MMDrawerController. In my project, I had a category which implements gestureRecognizer delegate's method which de facto overrides implementation in all ViewControllers. I should use subclass instead of a category in this case, this was a very bad design.

Related

Part of view with storyboard

So I'm working on a Google Maps-app, and I want a certain behavior. When tapping a marker I want the "Detail View", displayed below to popup. If swiping that detail view up I want it to cover the whole screen and make "MORE DETAIL" appear. If swiping down, it will close it.
I just can't figure out how to implement this behavior. Container View? Just a regular UIView wit gesture recognizer? Modal segue?
I'm not asking for code, just some words to get me on the right track.
Edit: For anyone else looking for this kind of behavior, every answer below is perfectly fine. I went with the container view, since the detail view is doing some network requests and UITableView work.
Can be done with Pan gesture and I would say by having Parent ViewController (Container) and Child ViewController instead UIView. Let me know if you would need more help :)
go with UIView and UIGestureRecognizer, it would be faster and simpler. Modal segue does not cover the whole page as you want, and container view is too much work to put on just a simple thing

How to implement page switch by scroll gesture which is already implemented in iOS7?

It's nice that back to previous page is so easy by swipe gesture in iOS7, Apple has implemented for you already. We like this feature, but how to implement it on iOS6? Any resource can take reference? Such as open source or design solution.
Please share and thanks in advance.
I'd probably be inclined to use UIPageViewController (which is a nice control that offers swiping between view controllers). If you really want to reproduce the UINavigationController iOS 7 UI (swiping from edges rather than anywhere on the page, all of the navigation bar UX, etc.), it might take a little work. But if all you need is a nice simple swiping between view controllers, UIPageViewController might be a good place to start.
See the Page View Controllers section of the View Controller Catalog for iOS.

How to implement navigation between UIViewControllers with forward and back transition in IOS7?

Let's say I have a list of articles I want to navigate through. With iOS 6 there were two simple solutions:
Using UIPageViewController
Using a custom solution with an UIScrollView, maybe a nested one
That's pretty straight forward but it lacks of flexibility regarding custom transitions. With UIPageViewController I only have two (Page Curl and Scroll), with UIScrollView there is only Scroll.
The transition effect I am looking for is the one introduced by Apple with iOS 7. The one we get by pushing a new controller to the stack, see the screenshot:
That comes with a really nice user experience in my opinion, but it only works the way back, not forward. But as the Safari browser supports also navigating in both directions, I am wondering how it is implemented there and, eventually, how I could implement it for my list of articles.
Thanks for any hints!
I looked at the exact same problem recently and built a working demo that uses UIViewController containment and a subclass of UIPanGestureRecognizer. It supports:
Gesture-based paging in both directions (tracks touch rather than simply triggers animation on swipe)
Ability to enable/disable wrapping (moving from page 0 to lastIndex and back)
Ability to enable/disable parallax paging (when disabled you just get standard UIScrollView like paging
https://github.com/alfiehanssen/ios-viewcontroller-containment
An alternative would be to build a pager based on the new UIViewControllerInteractiveTransitioning and associated protocols.
Hope this helps...
Have a stack of views or view controllers within your own container view controller, and use a pan gesture recogniser to track the finger swipes, and translate this into altering the frame/center of the top view.
There are plenty of iOS Slide Menu projects in github that will probably show you how to do the pan gesture recogniser.

xcode - pageviewcontroller override gestureRecognizers

I have used page-based application example shipped with xcode to build my app. The page view controller works fine, however, I have such problem:
In each view controller representing page data, I have some buttons, and clicking it leads to another view controller's view. I use this to add the view to view hierachy:
[self.view addSubview: self.articleViewController.view];
articleViewController just has a scrollview inside and show some text data. The problem is, if I swipe the view to scroll up/down, when it reaches the end page view controller takes this gesture and move to previous/next page, which not what I want. I want articleViewController receives no gestures from page view controller but only scrolling itself.
Hopefully I described good enough..
How can I disable gestures in my articleViewController? I have tried to study this post: UIPageViewController Gesture recognizers but haven't figured it out to solve my problem.
An example project to illustrate the problem: https://dl.dropbox.com/u/43017476/PageTest.zip
I know you cited the same question, but I don't like the accepted answer. Check out this answer, which is a bit further down the same post. I had the same issue and adding the block of code from that answer to the end of my viewDidLoad in my UIPageViewController fixed the issue I was having.
Basically what's happening is that the UIPageViewController is consuming all of the touch events, so you need to remove certain UIGestureRecognizers from the UIPageViewController so that it doesn't respond to those. It might be a little trickier than the example I posted as that is just removing UITapGestureRecognizer, but it's the same basic concept. You need to make sure that the UIPageViewController only advances to the next page on a right->left swipe gesture, and not an up->down swipe gesture.
Check out the UISwipeGestureRecognizerDirection documentation.

UITableView tracking touches on wrong axis

I have a uitableview controller which is a subview to a view managed by a uiviewcontroller. nothing really out of the ordinary but the tableview tracks gestures on the wrong axis(only on device).
Basically you scroll up/down table doesnt do anything, and left/right scrolls table up/down. its super weird. i was hoping somebody has seen this before and maybe know what causes it?
Edit: heres a video
http://c.drunknbass.com/EB7m
at the end i am scrolling a uiscrollview that scrolls normally and is a child of the same uiviewcontroller.view
UIKit relies on there being a key window, and that window having a root view controller, to be able to correctly handle events, and forward them to your code. I suspect that perhaps one of those things is not set up correctly in your app. (Such that the device orientation isn't matching up with the visual orientation of your UI.)
Also note that prior to iOS 5, making one controller's view the child of another controller wasn't really supported by UIKit. It can be done, and mostly works, but you are going to have to manage the forwarding of all of your lifecycle events. (See the notes on controller containment in the docs, and the description of -automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers as well.)

Resources