Fragment tabs in ios - ios

I am new to objective C. As we have fragment tabs in Android, so that only a part of activity( background remaining same) changes, what is to be used to replicate the same in ios with tabs on top in a view controller ? Any suggestions would be great Thanks

You can use the Tab Bar Controller as described here : https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/TabBarControllers.html
Note that the tabs (fragments) are at the bottom as opposed to android

You could use TabBarController. In tabbar controller, each tab is independent
I dont know a lot about Android code but if in Android, you have Activity -> ios have ViewController and each TabBar could control a ViewController. So you could do a part of activities changes.
In other hand, you could custom the tabbar Icon for your self!! Refer to:http://felipecypriano.com/2012/02/27/how-to-customize-uitabbar-on-ios-5/

Related

xcode and iPhone simulations show weird top grey bar behind views after navigation, how to remove them?

I am trying to update an old Storyboard and viewControllers. in Interface Builder, my viewControllers has the following grey bar that I do not know how and why they are appearing, they were not there previously:
These are also visible when I try to simulate my apps in the iPhone simulator as follow:
When I start my app, the views are stretched with a tiny view of this space as follow:
However, when I start navigating to other viewControllers the space is visible as shown in the previous screenshot.
Any idea of how to stretch my views all the way to cover these areas?
I am currently using swift. The navigation is being done using Storyboard Segue.
Thank you.
This is just the storyboard showing the way the screen will be presented, that grey bar represents the view that will be behind that view controller. This kind of presentation is called modal (page sheet or form sheet) the two have different effects on iPad
Code Fix
To fix this, change the modalPresentationStyle to overCurrentContext on the view controller you're going to present. So in code do viewControllerToPresent.modalPresentationStyle = .overCurrentContext
Storyboard Fix
in storyboard select the segue (the line linking the two screens) and then on the far right menu select the item 3rd in from the right, you should see a section called presentation, change it to Current Context.

Storyboard tabBar not tinted

I'm developing a iOS app for iPhone. The app is all wrapped in a Tab Bar Controller (#0), also, each tab is wrapped in a Navigation Controller.
I have 4 views (#1, #2, #3, #4) for each one of the tabs, all of them are working perfectly fine. But when I see those views in the storyboard, two of the views (#3, #4) don't have the tab bar tinted correctly. I don't know what this can be due to, any help?
This can happen if your simulated metrics in storyboard is not in inferred state.
Hope this helps.

UITabBarController storyboard launch screen - initial tab?

I'm using a storyboard as my launch screen in my app, it contains a UITabBarController with 5 UINavigationControllers. The storyboard doesn't do anything but provide launch screens.
What I want to do is change the default selected tab. I'm currently stuck with this:
And once the actual view controllers load I get this:
As you can imagine it's a bit jarring to have the selection jump like it does. I don't know how to change the tab programmatically since I cannot attach a custom class to anything in a launch screen. Of course, I don't really care if I do it for real, if there's a way to fake it with icons of different colors, that's fine as well, but the system adds that tint to selected icon.
Is there a way to do this with a storyboard launch screen? Thanks.
Don't use a tab bar controller in your LaunchScreen.storyboard. Instead use a normal view controller and add a tab bar, then add tab bar items as required. That seems to be the only way to make a tab bar without any index selected.
Though this question was asked years ago, I've wrangled with it quite a bit and figured out a workaround that I'm satisfied with for my app TimeFinder.
The other answers here have made some good suggestions, but trying to build a replica of TabBarController sounds challenging and unsustainable, and I didn't have much luck with the User Defined Attributes hack mentioned by Akshay Agrawal 1.
Since the problem is ultimately that the wrong item is shown as selected in the launch screen, I decided to hide the selection entirely by changing the selected image tint color to light gray to match the color of the other unselected tab bar item icons 2.
This allowed me to copy and paste my project's top-level view controllers (view controllers embedded in navbarcontrollers embedded in a tabbarcontroller) into the Launch Screen storyboard, delete all the inessential connections and view controllers, and end up with a quality launch screen that makes the app appear to load faster than it does.
Here's my Launch Screen storyboard for reference 3, and here is my app which will have this launch screen update shortly 4.
TimeFinder on the App Store
Use this piece of code in your view will appear method.
yourTabBarController.selectedViewController=[yourTabBarController.viewControllers objectAtIndex:2]

In Xcode 6.1 I have two navigation buttons. But they are not visible on the Storyboard anymore. How do I get them back?

So I have been working on an app for a bit now. Very New to iOS Development and have started straight in with Swift. I have several view controllers with navigation buttons. The buttons were placed by me on the storyboards but have have since disappears from the storyboards. Although when I run the app they are still appearing in the application and still function as coded.
I can see them in the side panel but I can't see them on the story boards. I have included some screen shots..
Can any explain why they are not on my storyboard any more and how I can get them back..
"http://i.stack.imgur.com/fGmxM.jpg" - XCODE View
"http://i.imgur.com/1iwsmGd.png" - App View
Apologies for the links I can't post images on my first post...
Change your top bar simulated metric to Inferred
Top Bar: None
Top Bar: Inferred
Assuming that your UINavigationController was added via Editor > Embed In > Navigation Controller

STACKING OF TABS similar to iPad Chrome app

I need to develop tab bar similar to Chrome's tab bar functionality on iPad. If the user opens more then 5 tabs it displays the extra tabs as a stack:
stacked tabs http://uploads.hipchat.com/26718/169836/yfzwdgq80m4rzbw/Screen%20Shot%202013-04-10%20at%202.36.56%20PM.png
How can I achieve this?
There's nothing like that built into iOS, so you're going to have to implement it yourself. I'd suggest implementing the tab bar portion of the window as a separate view that knows how to draw the individual tabs, including the currently selected tab, and which sends an appropriate message to it's target or delegate object when one of the tabs is tapped.
You can build a UINavigationController like Controller, with its own stack. If you are targeting iOS 5.0 and above you can use childViewController. The controller will have a tab bar, and container view. You will add view controllers to the stack of the Controller. From the stack you can form the tab bar item View, using titles of respective vc and views can overlap.
When they are selected bring the tab bar item view to the front and add the respective viewController as childViewController to the CustomTabBarController.

Resources