How to add custom TabBarItem to Tab Bar Controller - ios

I am using the Storyboard in XCode to design my Views. Also im using the Tab Bar Controller in the editor, but i cannot seem to figure out how i can add a custom item which i can use for UIPopoverController.
Is it possible or do i have to create this controller programmatically and add it?

The apple documentation states that you shouldn't subclass UITabBarController, however, you could use a custom implementation like one of the ones found here:
http://cocoacontrols.com/platforms/ios/controls/altabbarcontroller
http://cocoacontrols.com/platforms/ios/controls/center-button-in-tab-bar
EDIT: This website appear to have exactly what you want - http://idevrecipes.com/2010/12/16/raised-center-tab-bar-button/

Related

How to put UIView in UITabBarController (Like Apple Music App)

I'm trying to replicate the mini player on the Apple Music app. It looks like this:
Right now I have a UITabBarController plus two UIViewControllers. Now I wanted to put a UIView in the TabBarController (for the mini player) so its always on top of the content of the ViewControllers that are loaded in the tabs. But it seems to be impossible to add any UI elements into a tabBarController.
So my question is, what am I doing wrong and how can I create a View that is right above the tabbar and is above all other views in the tabs?
EDIT: the suggested duplicate doesn't answer my question. Is it not possible to add Views to the TabBarController via Storyboards?
To answer your question: No, you cannot add a view to the UITabBarController via storyboard.
Though you can have a look at LNPopupController. https://github.com/LeoNatan/LNPopupController
It's a wonderful library which will enable you to do what you want to accomplish.
To answer your EDITed question: No, it is not possible to add Views to the TabBarController via Storyboards. That's not how TabBarControllers work.
Options:
Follow the direction in the 'possible duplicate' link posted and add
subviews via code, or
Subclass UITabBarController and add subviews via
code, or
Write your own "tab bar controller" and, using IBDesignable and
IBInspectable, provide for adding subviews in Interface Builder
You could probably find inspiration / ideas by searching the web for "custom UITabBarController"

Can't link my UITableViewController to my nested UITableView

I need to provide some background to explain how I got to where I am. I'm trying to create an interaction that involves different segues (slide up from the bottom, slide in from right) and, as far as I can tell I can't mix these two styles amongst scenes that are embedded in a Navigation Controller because the Show segue will only appear from right to left if I do.
The behavior I want is: Initial View Controller -> Settings (segue from bottom) -> -> detail for selected Setting ('standard' segue from right to left)
I also want to put a navigation bar in the Settings view so I can have a Done button that will close the view (slide out of sight from top to bottom) like this:
Interface builder won't let me add a navigation bar when I'm using a Navigation Controller and without one it looks like this:
So, I tried something from a thread that suggested nesting views. It almost works (the first screenshot above was taken from that code), but it resulted in a new problem. That problem is that I can't link the nested `UITableViewController' to my SettingsTableViewController.swift custom class. It's simply not an option in the dropdown list of classes and so I can't configure my table of Settings options.
Here's the hierarchy I now have based on the suggestion from that thread:
Also, I've confirmed that my SettingsTableViewController.swift is subclassing UITableViewController.
I'm stumped and would really appreciate some help.
If you try this,
Add a UIViewController and a UINavigationController(this automatically comes with a UITableViewController.
For example sake, add a button to the UIViewController, right click and drag to the UINavigationController and setup the segue to the following show in the image.
Add another UIViewController and right click drag from the UITableViewController to the new UIViewController and use a push segue, which you can reference when you do 'didSelectRowAtIndexPath'.
You shouldn't need to connect things, because your UITableViewController is the rootViewController of a UINavigationController. If you use a UITableViewController the only thing you should have in it's hierarchy is the UITableView, if you want other things, you need to use a UIViewController and add a UITableView, but I don't think you need this because you can achieve your requirements with the default options.
Comment if this does not make sense, good luck,

Create a picker view to use on multiple ViewControllers

My app has multiple screens all of which are different and not related however i must have a burger button which opens the same drop down menu on each screen.
Is it possible in iOS to create the menu once as a view and reuse it on each screen or do I have to create it on each ViewController and implement it.
Any explanation as to how to achieve this would be great.
The best thing would be to implement a custom view or custom control which you reuse in every Controller you want. The good thing is with the new storyboard and a xib file you can even see it in realtime in the storyboard (#ibdesignable).
Check out this: Creating a Custom View That Renders in Interface Builder (Apple Documentation)
Or a great tutorial: Custom UI components

IOS slide menu like facebook and path 2.0 that works with storyboard

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.

Configure UItabBar from view

Hi guys i am having trouble to find out a solution from this problem so i am posting it.
So basically in ipod application we can configure the tabbar items from the application and drag them to change and customize it for ourself.
Does anybody know how to do it?
see the attached image please, thanks.
You really don't have to do anything more. That feature is automatically available when you add 6 or more tabs to the tab bar controller.
UITabBarController has a customizableViewControllers property which is an array of all customizable view controllers. This is set to the viewControllers property so all view controllers can be customized by default. If you intend to limit it then set this property appropriately.

Resources