I have a requirement where i need to add a slide menu inside a tabbed content is it possible to add a slide menu inside a UITabBarController and parent of this UITabBarController is a UINavigationController ?
Without knowing more about your project it will be hard to provide a more in-depth explanation, but this should work:
Basically, I would recommend finding any one of the many open source "Swipe to Reveal" menus that are out there on places like Github. With a quick google search I found an example that might be useful to you.
Really all you should need to do is set the whatever "Swipe to Reveal" class you use as the root to the selected tab that you are in (If the initial viewController of the selected tab is a NavigationController then you probably want your slide menu to be the rootViewController of the NavigationController), and then you should be able to configure the menu to work within the selected tab just fine.
Please let me know if you need any additional help, and I can update my answer. Hope that helps!
Yes, you can do that.
I have done a similar thing for UINavigationController. And it is working for me.
I have created it as a re-usable component and added to GitHub, you can find it here: https://github.com/Midhun-MP/MMP_DrawerController
You can find a lot of controls here, better than my control ;)
Related
I am making an app that has multiple view controllers that has a side view that you can go to navigate to each one, etc. I have everything set up and you can navigate to the side view by swiping from left to right to revealViewController, and that works splendid; however, what I would also like as well is to have a button that looks like 3 rectangles (not important to this, as I already designed the button) like on most apps, that you click and it would take you to that side view as if you where swiping like I have it set up right now. Does anyone know how to do this? I know it's pretty easy, but I am not quite sure.
An example of what I am trying to do, is in the Chase Mobile App. Even though this is a function that is in MANY different apps.
This is EXACTLY what I am trying to do in the example/image above
All help is gladly appreciated!!
I need to have that button open up the side menu just like this. Right now I have it were you slide from one side to the other to get this.
Please try this code to toggle the sideview appear and disappear as :
[self.revealViewController revealToggleAnimated:YES];
and
-(void)backButtonPressed {
[self.revealViewController rightRevealToggleAnimated:YES];
[self.navigationController popViewControllerAnimated:YES];
}
This is called a hamburger menu (or sidebar menu) and is typically frowned upon for iOS design. There are a number of reasons for this, but they are still used in many applications. Basically, they hide links and information from the user that should be quickly accessible.
Disney recently recreated the navigation in their Disney World app. Previously they used this method to navigate the app, but they changed it up pretty well. I personally like the change and that they were able to fit a large amount of information and features into their app without a sidebar.
While I don't recommend using this design, it is a great method to learn if only to better understand making custom views. There are many tutorials that will help you set this up online. A good example is at Appcoda.
Basically, you will need a root view controller with two views in it: the menu and the content. You will switch the content view controller with the view that is selected and active in the menu. You can show and hide the menu a number of ways, but one of the easiest is to move the menu left or right to place it in the frame or out of the frame. The tutorial linked above will get you pretty far. I would have gone into more detail, but there are so many resources regarding this that I don't see the point in copy/pasting it here.
What I ended up doing was from each tableView cell, instead of connecting it straight to the view I want it to show when you click that table cell, I had it go to a navigationaController with a segue (reveal view controller push controller) and then from that NavigationController I connected it to the view that I wanted it to display and connected it to that view controller by having a segue (root view controller), and then having the button in each view, and in each of the files .swift for those view controllers I connected the button up as you normally would, and for the code inside of the ViewDidLoad I have "menuBars.target = self.revealViewController()" and "menuBars.action = #selector(SWRevealViewController.revealToggle(_:))"
So i'm using this(Xamarin.SideBar) component in my project.
The biggest problem that i need to have SideMenu on all my main pages(that are represented as tabs,each one have an navigation controller,see pics).
So my pages looks like on the screen:
where A,B,C,D,E,G are tabbed pages,which contains a navigation controller.(green circle means that were located now at page A)
And now i'm opening my SideBar
Menu are opened and the first button clicked,bam and we're on another ViewController that holds Navigation stack with button Back to ViewController(page) that called A(same for other pages from tab).
My storyboards looks like:
And i'm so confused how to achieve my goal !?
Seems that i need to make an BaseController that will create ONEs this MenuController of SideBar , but architecture of Xamarin.SideBar component scares me,because i need to put everytime a NavController and ContentArea...
Any advice? Thanks!
First of all, do not use the Xamarin Component, instead use the nuget package that is more updated. Here the link. Don't worry it's the same library, it seems they will not update the Component, but who needs a Component when you have a nuget!
Regarding your question, yeah you are correct, you will need to create a BaseViewController that will be holding the side menu. Your main controllers (A,B,C,D,E,F,G) will all be deriving from this it so you don't have to be repeating code.
I have a few simple apps that are single view. I want to add a 'Info' tab for some instructions, support details, etc.
What is the easiest way to do this? Create new Tabbed Apps and copy the existing code in, or edit the current single view apps? I would prefer if the latter was possible.
Thanks.
I achieved the same in <5 seconds with the below xCode menu option: Tab Bar Controller.
I kept my ViewController classes so my main.storyboard looked like this:
Without understanding more about your current setup your question can't really be answered with any kind of accuracy.
Having said that it's easy enough to add a UITabBarController to an existing app, really all you need to do is change the initial view controller.
I presume you haven't tried searching for an example...
Implementing UITabBarController in code: http://simplecode.me/2011/12/05/tab-based-ios-apps-uitabbarcontroller/
Storyboards: http://mobile.tutsplus.com/tutorials/iphone/ios-quick-tip-creating-a-uitabbar-application-with-storyboards/
I try looking everywhere for opensource but couldn't find a cocoa control that has the following combination.
Slide Menu
Story Board.
Navigation controller.
TabBar controller.
I found one open source control that works with 1,2,3 but doesn't work with uitabbarcontroller.
http://www.cocoacontrols.com/platforms/ios/controls/saslidemenu
I used IIViewDeckController in a project that involved all of the things that you list.
I made a video (3 parts) on youtube on how to make a sliding menu like the on you are looking for. I show you how to set up the project and get everything linked up.
http://www.youtube.com/watch?v=tJJMyzdB9uI
The way this is set up, you should be able to just select UINavigationController instead of UIViewController when creating your files from the first video.
I use ECSlidingViewController because its the easiest to customize.
Hope this helps!
Here is a simple one I wrote. It's built on top of UINavigationController so you can use all UINavigationcontroller functions as well as slide function. No need to inherit any base class for your ViewControllers like other libraries require. Works both on Storyboard and in code.
I haven't tried, but I'm pretty sure if you set a tab-bar-controller as the root view controller of this custom navigation controller it should work as expected.
https://github.com/aryaxt/iOS-Slide-Menu
https://github.com/arturdev/AMSlideMenu
You can use this simple library.
Just connect your menu (tableViewController) to your tabBarController with a custom segue of type AMSlideMenuContentSegue.
So all I want to do is create an App that has two pages: one with a button that opens up a UIWebView in the second. It seems simple enough, yet I have spent the past two days trying to figure it out.
I create the object and put in the code for the link and ctr - drag the web-view to the controlview.h but nothing will work.
Does anyone know a tutorial or can explain this to me? I have been searching the web for the pat two days and have gotten nowhere. thank you.
Each "page" should be a separate view controller. You open the storyboard editor, drag a view controller to it, drag a web view to your new view controller, then drag a segue from the appropriate control on the first page to the second page.
You will also need to create a UIViewController class for the second page, and set the controller's identity in the storyboard editor. (Select the second controller, type command-option-3, enter the view controller's class name in the "Custom Class" section.)
In the second view controller you will need some code to make the webview do something, obviously, so you probably will want to create an outlet for the webview.
Maybe you should start out with this general guide on View Controllers. You'll learn how to use View Controllers and how to present Modal View Controllers.
After that you go on with the documentation about UIWebView.
If you do a quick search for UIWebView you'll find tons of tutorials, but basics are important :)
CONTROL+DRAG does not work on storyboard. When I click view and drag to UIWebView, it opens a black popup but I cannot see my web value. I just see "view".
It does not work on storyboard either. I tried it on xib and it works with that.