Creating custom menu at top like Real Simple Recipes does - iphone

I want to create tabbar controller placed at the top like Real Simple Recipes in iPad has done. I suspect that it is not UITabBarController as I have tried so many ways to place tab bar on the top by setting its view frame as
self.tabBarController.tabBar.view.frame = CGRectMake (0,0,768,self.tabBarController.tabBar.view.frame.height);
But it is not working.
Is it custom tabbar controller created or it is managed manually ? Any sample code or direction would be appriciated.

You want to make a custom view switcher of your own. This blog post has a nice tutorial for doing so. It uses a segmented control to do the switching, but you could adapt it to use a row of buttons if you needed a custom look.
(If you are OK requiring iOS 5, this gets easier with the view controller containment APIs, and it'd be a completely different implementation to the one suggested in that article.)

Related

Swift UIKit integrate side menu to existing app

i am struggling to add a side menu to my already existing app.
i've read all kinds of tutorials, but almost each and everyone of them uses a container ViewController, which I'd try to avoid to use..
I got a single page app, with thousand of code rows, embedded into a navigation controller (for a additional settings page)
I've added a UIBarbuttonItem on the top left to toggle the visibility of the menu.
now I created the side menu in a different ViewController on the Storyboard / InterfaceBuilder, and just can't find a way to easily slide that ViewController in from the left side.
one approach was to create single view behind my app and push the main view aside to reveal that view, but the result was not as sexy as I wanted it to be, and designing a view in the background of another view would not be that easy to work with too...
I'd just use a container View Controller if I absolutly have to, and I don't want to use any cocoa pods...
does anyone know how to proceed? any push in the right direction'd be greatly appreciated!

Best Way to Achieve Slide-Out Navigation IOS

I have used a fairly common design pattern for a standard IOS slide out navigation. I based the design off of the example found here: http://www.raywenderlich.com/32054/how-to-create-a-slide-out-navigation-like-facebook-and-path. The basic design takes four view controllers, a center view controller, a left view controller, a right view controller and a main container view controller to hold and manage the three other views. The main container places the center controller on top and when the user slides his or thumb left or right, the view slides over to display the appropriate controller beneath. I recently adapted this to a project that has almost thirty different controllers. I have it working with the initial view but am wondering what is the best way to scale this feature? I want this slide-out navigation to be available on every single page so the user can just slide and navigate to anywhere at all times. The right and left view controllers will always be the same no matter what controller your on, is there a way to have a common main container that dynamically loads the center controller depending on the view the user is on? Or do I need to go and implement a container controller for every single controller I want to have the slide-out navigation functionality? Obviously I would think the first method would be the most efficient and scalable, but I have no idea how I could do that or if it is even possible.
An easy way to have a side slide out navigation is to intergrate opensource code into your project. The code normally comes with directions on how to implement it and a demo app.
Here is an example of an opensource slide nav like facebooks
mfsidemenu
The website this link takes you to (www.cocoacontrols.com) has some great opensource iOS controls as well!

Replacing UINavigationControllers NavigationBar with UIView

I am developing app that has multiple skins and I have a dilemma on how to implement this.
One of the solutions would be to have separate nib files for every skin, and load it depending on which skin is currently selected. Problem with this is that I can't edit navigation bar of navigation controller (which my app uses), and I have to change it's background image and back button image etc.. I came up with an idea to hide this navigation bar on every screen and replace it with custom UIView in Interface Builder which will act as navigation bar and custom back button with IBAction for popping current View Controller, so that user won't see any difference.
Is this approach acceptable and if I make it this way, will I have problems with rejection in App Store?
If you choose to hide & replace the UINavigationBar with your own UIView it's no problem as far as Apple goes.
However, I can tell you that you will have to spend some time trying to replicate some visual effects that come naturally with UINavigationBar.
For example, when you push/pop a new controller, you will see that the navigation bar title will slide & fade beautifully. The same applies for left and right bar items.
Personally I would not completely hide the UINavigationBar, but customize it. In the end it all depends on what you want, but by default the UINavigationBar is pretty customizable.
You can add your own buttons or even entire UIViews as left and right bar items. Also, you can add your own UIView as the title (with your own label, custom font or whatever) or change the background.
EDIT:
To easily customize the looks in your entire application, you can subclass UINavigationController and create your own CustomUINavigationController. Then, in viewDidLoad method you can change whatever you want to the navigation bar and this will be accessible in the entire application.
No way, what you are doing is perfect. This will work & no way it will get rejected from app store (just based on this approach). I too have explored several ways to provide skins & what you wrote seemed to be the least hassle-some. Plus its way more easier to create UI elements in Interface Builder hence the separate nib files for different skins.
I am saying this so confidently 'coz I have done the same thing & app store approved.
Best of luck.

How to make a horizontal scrollable UITabBar in iOS?

The UITabBar in my app consists of 10+ items, but the width is enough to put all 10+ items.
How to make a horizontal scrollable UITabBar in iOS ?
Thanks.
You'll have to roll your own to at least some extent.
What might work, would be to create a UITabBar view (not the controller) and embedded it in a UIScrollView. You could then use that in place of your regular Tab Bar control by adding it to your TabBarController.view/tabBarView or something. Of course you'd have to play around to get it to look right, and I'm not sure if just setting the view to something wider will actually make it display more items or not.
Of course, for best results you'd probably want to do something entirely custom.
From Apple's Developer Portal:
If you add more than five items to the viewControllers property, the tab bar controller automatically inserts a special view controller (called the More view controller) to handle the display of the additional items.
Source
Seems like you will need to make a custom tab bar.
They also said this in the next paragraph:
Although the tab bar view is a key part of your tab bar interface, you do not modify that view directly.
You might be breaking Apple's design guidelines by doing this.
You can certainly go and create a custom class of the UITabBar (embedding it into a scrollview etc.)..but why re-invent the wheel? After searching around I found several third-party classes already created that work well and are easy to use and highly customizable..In order of personal preference:
M13InfiniteTabBar -
https://github.com/Marxon13/M13InfiniteTabBar
JSScrollableTabBar -
https://github.com/jasarien/JSScrollableTabBar
InfiniTabBar -
https://github.com/iosdeveloper/InfiniTabBar

view based and navigation based system

what is difference between view based and navigation based system in iphone . which one better to use and when?
if you have hierarchy of views, use navigation based else use view controller based.
You're talking about default templates that Xcode offers you to start your project with. It's not like they're different "systems" per se, they're just different starting points.
A view template is good if your app is one screen, or maybe a couple screens. Movement between those screens is up to you (and there are some pretty easy and good tools for animation screen changes, but you have to hook into those yourself).
A navigation template is good if you're going to be navigating a hierarchy of data, possibly with lists, sublists, detail screens, etc. Shifting between views is done with a call to UINavigationController, that handles all the transitioning business for you.
navigation based system is used if you want to use something like moving from main view to its inner view
like parent to child then subchild and so on...
While if you have no such hierarchy then you can use view based..
Navigation Based gives you a flexibility to reverse back to the view controller which you have already visited. like say for example you move 1->2->3->4->5 now if you want to go to 2 you can go easily. Navigation adds a top bar while view based is used if you dont want any kind of hierarchy..
hAPPY cODING...