Tab bar application without storyboard - ios

I want to create tab bar application which should also work on older versions of iOS. The problem is older version does not support storyboard. And when I try to create one project without storyboard it wont let me allow to access tab bar item in .xib file.
So how can create an application which is compatible with older versions of iOS and easy to design?
Thanks..

Application created with storyboard also support older iOS versions. But if you want to go by old xib way just uncheck the use storyboard option at the beginning when you create your project. You will then have to add UITabbarController manually in applicationDidLaunch method. Feel free to comment if you want detailed answer.

Related

Xcode Project Settings Preventing TabBar at Bottom of iPhone X Models?

I have an old project that I've been working on and off on for about 4 years now - the project has gone through many upgrades of XCode versions from 6 to 10 (I'm now using XCode 10.2.1 with 12.2 SDK). The main problem I'm having with it is that it utilizes a Tab View Controller to switch tabs, and no matter what I do, I cannot get the tab bar to appear on the bottom of an iPhone X family device correctly: it appears much higher than it should.
To try and finally narrow down the problem, I've essentially temporarily "replaced" all code and storyboard items from the project to see if anything will move the tab bar to where it's supposed to (if I just create a blank new project with a tab bar controller, the tab bar does appear where it should). I created a test storyboard with just a Tab Bar Controller going to one navigation controller (no constraints have been put in). There is no viewController codes attached to them. I've replaced the app delegate with a "blank" app delegate so there are essentially no extraneous code or restraints there at all. And I still get the tab bar moved:
This happens on the simulator and the device, and there is no code or storyboard setting that's doing this (this same setup on a new project puts the tab bar in the right place).
I've looked around in the Build Settings and other properties that I may have missed to see if I constrained something years ago that may affect this, and didn't see anything.
Is there anything I should be looking for in the project settings that would do this?
I don't want to rebuild the project in a new project - there are many linked libraries, certificates, cocoapods, storyboard items, and I know it would be horrible to try and put it all back in one piece.
My Deployment Target is set to iOS 11, Devices: iPhone, Base SDK: iOS
Any help would be greatly appreciated!
This is usually caused by not having a correct launch image for the iPhone X. The easiest way to fix this is to tell the app target not to use launch images (from the app bundle or from the asset catalog) but to use the LaunchScreen.storyboard instead. (If you don't have one, make one; be sure to set it as a launch screen storyboard by clicking Use As Launch Screen and configure your target to point to it. Examine a plain vanilla new project to see what I mean.) You might not want to keep things that way in the long term but at least it will allow your app to launch to the correct size on all devices.

Remove storyboard view controller iOS at build time

The fact is that I have a View Controller in my storyboard that is using StackViews. Now, I'm trying to make the application iOS 7 compatible but I don't want to remove that view controller. Is there a way to compile the project without that view controller? I tried to keep the build target of the storyboard to 9 but i would prefer if there is a way to hide that view controller at build time working with iOS 7 on the storyboard
Stack View came with iOS9 and you can't tell the Stack View to disappear depending on the running iOS. It's not possible to build the Storyboard depending on the iOS either. But it seems to be possible to select different storyboards depending on the used iOS. See this link. The cody is ojective-c, but it seems not that hard to transfer the logic.
You can either remove the Stack View or, what I'd suggest, build your App for iOS9, since some survey I've recently read, tells that up to 90% of all Apple Users upgrade to the newest iOS within a week. Your 3rd possibility is to build different storyboards depending on the iOS.
Edit: You may want to check out the OAStackView. Which implements most of the features from UIStackView and supports iOS 7+.

unable to embed Navigation Controller from storyboard in iOS

![enter image description here][1]How to embed in Navigation Controller as I am having two View Controllers with one of them as RootViewController and when I go to editor--->Embed-in--->no options are usable/Selectable !! Please suggest me the reason as I have used Navigation Controller earlier in previous sample app and it was working fine .
Please help on this!! Thanks in advance
Your screen shot shows a nib file, not a storyboard. You need to create a storyboard and then you will be able to embed your view controller.
You will also need to change your project settings to require iOS 6 as a minimum Upgraded app to iOS 7 - error "Auto Layout on iOS Versions prior to 6.0" (but want iOS 7 not older)
Also make sure you change your project to refer to your main storyboard rather than an xib How to convert a NIB-based project to a Storyboard-based?

storyboard and apple recommendations

im starting a new project now and I would like to build it with nibs and not with storyboard, apple removed the option in xcode 5 to build an app without storyboard, my question is that is there any recommendations by apple that developers should develop with storyboard and other xib files will not be allowed in the future? or its ok and apple will always support nib files without storyboard projects and allow it to be submitted in the future
thanks
Apple certainly seem to be pushing people to use Storyboards, but there's nothing to stop you removing Storyboards from a project and just using Xibs. I only use Storyboards sometimes, occasionally use Xibs, and often write entire apps programmatically (no Xibs or Storyboards at all). There are a number of important use cases which are only possible using Xibs, so they won't be going anywhere any time soon.
The only change Apple made was that project templates always include a Storyboard - but you can still remove it once you've created a new project.

Tab disappears when changing language in iOS

One of the tabs in my UITabBar disappears when I change the language of my iOS Simulator to Norwegian. Why is this? I have created the app with Version 4.6.3 of XCode.
There could be a lot of reasons for this. You need to provide more information. How do you define your UITabBar? Are you using Storyboards or Nibs? Your Norwegian localized Storyboard / Nib might have only 1 tab defined while your English version might have three tabs.
I have found the problem.
When I tried to get my app translated I added my own languange in the Localizations section under Project-Info.
When I did this there was an extra .storyboard file created for the spesific language, so when I change the storyboard I had in xCode that did not change the second storyboard created for my language. I found my second storyboard in the directory of my app, and deleted it, and now everything works fine.
So, if your app is weird with one spesific language, it may have a spesific storyboard that does not change automatic.

Resources