unable to embed Navigation Controller from storyboard in iOS - 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?

Related

Storyboard Not Loading View Controllers

I have updated my Mac to High Seirra version 10.13.1. After the update a storyboard is not working correctly.
The views in the storyboard are shown as blue outlines instead of showing the view detail.
I am using Xcode 8.2.1.
It's a temporary issue, just quit the XCode and reopen again.

Trouble with creating a popover withs storyboard in Xcode

I cannot create a popover with storyboard.
The settings are as follows:
The github repo: https://github.com/li354886/iOSProjects/tree/v1.1/testPopOver
I viewed this video: https://www.youtube.com/watch?v=j5XFMpXLwZQ
The popover view controller just behaves as modal.
Make sure that your app is Universal. You won't see any popovers, by default, on an iPhone-only app. (You can see them in iOS 8, with some extra work, but by default you won't.)

Window's root view controller is not Split view controller

I am trying to modify my existing app to use a split view controller. I've followed the sample master/detail project structure by adding a split view controller into my storyboard, made it the initial view controller and everything seemed to be working fine, until I tried to run the app in an iOS 7 simulator. All of a sudden when I hit my breakpoint in application: didFinishLaunchingWithOptions self.window.rootViewController is now the type of my master view controller, not the split view controller itself.
I thought maybe then I just need to get the split view controller off of the root view itself and tried rootViewController.splitViewController but that is nil. I must have missed some set up step in enabling this split view controller, but I have no idea what it was.
It is because UISplitViewController isn't supported in iPhone in iOS7, only in iPad.
If you run your code in iPad iOS7 you will see your UISplitViewController.
Only in iOS8 Apple added support for iPhone as well.
So this ended up being a pretty obscure issue. It seemed to be caused by the way that the iOS 8 SDK and Xcode 6 handle storyboards and size classes. I intend to file a bug report with apple but the repro steps to get this to present are simple:
Create a new master/detail application
Set deployment target to below 8.0 (7/7.1 works)
Change application type from "Universal" to "iPad"
You have to comment out this line from the generated app delegate, it will crash in an iOS 7 target:
navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem;
Run on iPad simulator for iOS 7.1
The fix to this issue is to disable size classes on the storyboard. I theorize that the way that Xcode 6 and the iOS 8 SDK are handling size classes for iPad versus universal app builds causes this to not work on iOS 7 targets, but turning off size classes fixes the issue.

Weird Bug in XCode StoryBoard after upgrading to iOS SDK 7.1

Last night I updated XCode and the iOS SDK.
It looks like it messed up the UINavbar on the storyboard, here is a pic:
It shows two titles overlapping, if I delete the title , then there is still another one in the background, Im not able to remove that second one.
The strange part is it magically disapear, if I run the app.
XCODE version --> Version 5.1 (5B130a)
iOS SDK---------> Version 7.1
Yes, there's a new property for the uiviewcontrollers named "exteded edges" you must uncheck this in the interface builder inside the uiviewcontroller preferences. Or by inserting this code in your view did load. This will tell the controller not to draw the view under the navigation bar.
if ([self respondsToSelector:#selector(edgesForExtendedLayout)]){
self.edgesForExtendedLayout = UIRectEdgeNone;
}
I checked again and there was an extra navigation bar, its weird that It shows only after I upgraded, I think something happen with that view because I embedded it into a navigation controller.

Tab bar application without storyboard

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.

Resources