iOS Customizing PKRevealController to work like Google Maps - ios

I'm trying to imitate the new Google Maps app where there's a button with 3 dots that you can pull to the left to reveal a new view controller on the right side with some settings for the app.
I have the default implementation of PKRevealController working..but since my front view controller has a map that takes up the entire screen's bounds... i can't tug left (instead, the map moves). I know it works because I have a button on the map that I can tug to the left to reveal my view controller that's on the right.
How do I change the way PKRevealController works so that it will only show a right view controller if and only if a tiny button is pulled left? Since I have multiple buttons on top of the map... is there a way to disable a few of them so they cannot be pulled left..but only leave one button that can be pulled left? Or is there any other solution?
Thanks!

I figured it out. I set the options for the PKRevealController as follows...
NSDictionary *options = #{
PKRevealControllerRecognizesPanningOnFrontViewKey : #NO
};
and then I set the gesture panning property on my view object of the view controller. The below shows how to add the gesture panning property to a navigation bar.
[frontViewController.navigationController.navigationBar addGestureRecognizer:self.revealController.revealPanGestureRecognizer];

Related

iOS / Swift - Swipe/Drag between ViewControllers like Telegram/iOS Settings

so I already searched a lot but maybe I missed something.
I would want to be able to drag a view to the side and drag a new view from the left.
Like in Telegram where you can slide between chats overview and a chat itself or in the iOS Settings where you can slide right and drag the detail view to the right and the overview is coming from the left.
I do know how to do segues with a slide animation, that's not what I am asking. These segues are started ones and can not be controlled by the user.
I did not use a navigation controller behind my bottom bar controller so I had the wrong transitions. When using the native Navigation Controller on all subviews of the bottom bar navigation controller you can control toolbar items and the "slide" I mentioned.

How to implement swipe views with CollectionView/TableView Controllers?

I am creating an app using Swift, and I'm still trying to figure out what the best configuration would be.
What I'd like to have is 3 screens (the left screen would have a side out panel) that users can access via the navigation bar menu or just by swiping left/right the screen for more accessibility.
I could easily create my TableViewControllers/CollectionViewController and the menu, but I'm struggling at making the screen able to detect users gestures at the same time, and I'm not sure whether I should use 3 View Controllers and then add the Collection View/Table View via the Storyboard, or directly use the CollectionViewController/TableViewController
I added a picture here describing what I'd like to accomplish:
Also, I wonder whether I should use storyboards or not for my project.
I know that's a lot of questions !
Any ideas please ?
Thank you very much and have a good day,
J.
You need to add 2 "swipe gesture recogniser"s to your middle screen(your second screen in your attached image) , and set one for identifying left swipe and another for right swipe. Create action methods for both in your view controller and add code accessing left screen and right screen in respective methods.
note - you need to drag "swipe gesture recogniser" to top bar of your view controller scene to add it.
You can use a scrollview as a container, put three ViewController in it.

Using RealmSearchViewController with a UITableView

I'm developing my first app in swift, which has a table that shows data stored using Realm. I've managed to add stuff to the Realm and show it in a table. Afterwards I wanted to add search capability and stumbled upon these two guides: http://www.raywenderlich.com/81615/introduction-to-realm and https://realm.io/news/building-an-ios-search-controller-in-swift/. I would like to use RealmSearchViewController, but I can’t seem to fit it to my setup. I tried using a UITableViewController embedded in a Navigation Controller, but I need a button at the bottom of the screen, where the user should tap to add an entry to the list. I tried using a tableFooterView with a button, but it can only stick to the bottom of the table and not the bottom of the screen. I also tried using a Tool Bar and a Tab Bar in the Navigation Controller, but it doesn’t show as the table takes up the whole screen.
What I would like to achieve is something like Airmail for iPhone, where there’s a Tab Bar at the bottom that is hidden when the user scrolls. Above the Tab Bar I’d like a table with content from the Realm, and then a Search Bar, which is directly below the Navigation Bar. I’d like to use RealmSearchViewController as it makes searching a lot easier, but how can I adapt it to be used with a Table View and not a Table View Controller?
Any other suggestions as to how I can achieve the same functionality?
Thanks!
My recommendation would be to create a parent view controller that arranges the the view of RealmSearchViewController so that it doesn't cover the entire screen, and then arrange a UIButton at the bottom.
You can do this in a Xib/Storyboard by arranging a view and a button with autolayout and then simply add the view from RealmSearchViewController as a subview to the view in this parent view controller.

what do I need to use to change controller when sliding left?

I want to create a touch control, where I slide left and the view scrolls in a paged mode (like in Photos app where you slide between photos) but instead of a view in a current controller coming in, I want a new controller to come in with it's own view. What control should I use to build something like that?
You can use UIPageViewController to navigate between different ViewController like a scrollView
You can follow this tutorial
1-http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/
2-http://www.appcoda.com/uipageviewcontroller-tutorial-intro/
3-http://www.makemegeek.com/uipageviewcontroller-example-ios/
hope it will help you

JASidePanel Swipe doesn't work after push new controller on navigation stack

I use JaSidePanel to achieve effect like in Facebook App. But I have some problem with it.
(1) is subclass of JASidePanelController, Navigation Controller is added as center panel. Everything works fine, but after I push new View Controller to Navigation Controller I'm not able to make swip gesture to show Table View (4 - Left Panel). Is there some way around or I'm doing something wrong.
[EDIT]
Ok I found why this did occur, JaSidePanel has property panningLimitedToTopViewController that has to be set to NO in order to allow swipe gesture on diffrent view controller that one on top.
jaSidePanelController.panningLimitedToTopViewController = NO;

Resources