iOS Launch Image without Storyboard or Images - ios

I am trying to programmatically set up a Launch Image without using storyboards or images. I understand the two ways to set up a launch image are 'Launch Image Source(image)' & 'Launch Screen File (storyboard)'. Within storyboard it launches a UIViewController then you drag and drop items into the storyboard VC. I don't want to do any drag and drops is there a way to just do it all in code. I am completely want to avoid storyboards I don't want to have an empty one then it launches a simple VC then I go do designated VC I want simple VC then designated VC. I am looking for an answer in Swift, I assume I would have to have code in AppDelegate but thats just a guess.

There is no way to do this. You either have to provide images or a storyboard file. You can choose to show a custom launch screen afterwards that is programmatic, but you cannot create the initial one programmatically.

Related

how to build a guidance after the launchScreen?

I want to build a SrcollViewController which has some imageView as a guide view after the launchScreen done. In appDelegate ,i want to use window.rootViewController. But the project is using JASidePanels,window.rootViewController has been used. And it seem hard to change this.Is there any other way to insert a viewController between the launchScreen and JASidePanels?
One option is to present it as a modal viewcontroller over the rootViewController

xcode: Problems connecting main storyboard

I am following the tutorial here. I just created my first storyboard and tried to set it as the main storyboard. After following the tutorial I clicked the run button and the simulator doesn't render any of the changes ive created.
I have a screen shot of my xcode project here(not sure how else to display it): https://app.box.com/s/okw7jlzq5zmcetd5cehu
What am I doing wrong?
Here is another screenshot of the storyboard itself: https://app.box.com/s/jt6i0an3maowwvgsamk7
Place a checkmark in the box "Is Initial View Controller" for the view controller you want to load.
I think your problem is the code in the app delegate. When you use a storyboard, you don't need anything in there except "return YES". The storyboard creates the window, so the code you have in there is making another window, not the one that your storyboard controller is a subview of.
Using this tutorial might teach you some things about the structure of an iOS app, but if you just want to make an app with a storyboard, you should start with the "single view" template instead of the "empty" one. It will give you a storyboard and an initial controller.

What's the proper way to use storyboards View Controllers and scene in iOS application?

I have been working on an iOS application for sometime now, and I think I am not using the View Controllers I have created properly with the storyboard file / scenes I have created for my application.
As it stands, I have two storyboard files, one for the iPhone, and another for the iPad. In the AppDelegate implementation file there is a method called,
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
I have been loading a ViewController from within this method to start the load process for my application.
Since I have two storyboard files now, I sourced some conditional code to load a specific storyboard file based on the device that is running the application.
What is the proper way to load the storyboard file?
After I load the story board file do I initialize the root view controller?
Once my root view controller is loaded should it load the elements specified in the root scene?
If I choose to load another scene from the root scene by clicking on a button in the root scene should I dismiss the root scene, and load the new scene, or is the new scene a subclass of the parent scene? What is the proper way to transition between scenes?
Basically I have a separate view controller for every scene in my application, and I have specified a view controller associated with each scene in IB.
Right now I have a button that can be pressed from the beginning / root scene to load another scene which is associated with another view controller. In this new scene I have a done button which segues back to the root view controller.
If I were click these two buttons repeatedly by clicking on the buttons over and over, am I creating new objects of my view controllers or I am reusing the objects that were already created?
I know this is more than one question but I am trying to get a good grasp on view lifecycles, and how view controllers relate to scenes, and the proper way to load the first view controller, which should load the first scene in an application I presume.
What is the proper way to load the storyboard file?
Click on your project in the class navigator. It is the uppermost thing you can click in there, and it has the name of your application on it. Some config files will open right where your source code used to be, and you need to find the one where you can specify a storyboard for different devices. I think it is the second tab from the left, but i cannot check that right now. You just specify a storyboard to use for iphones and a storyboard to use for ipads, and youll be fine.
EDIT: you also need to specify an initailView for both storyboard files. This can be done by simply opening the identity inspector (i think) in storyboards with the view in question selected and checking the box next to "is initial View". Try all four inspectors if my memory fails me. It'll be there, i promise ;)
What is the proper way to transition between scenes?
in most cases, you will use a segue. those thigs are new in storyboard, and they are the bomb. Theres a method you can implement called
-(void)prepareForSegue:(UIStoryboardSegue *) sender:(id)sender
where you can check for the identifier of the segue and then manipulate the destinationViewController-properties directly. Heres a good tutorial:
http://www.appcoda.com/storyboards-ios-tutorial-pass-data-between-view-controller-with-segue/
If you cant use a segue, however, you will need a rootViewController for anything that displays more than a modal view. Basically, rootViewControllers manage a stack of views, and its not your business how they do it. Depending on your UI you might need a NavigationViewController or a TabBarViewController, just google for both and see what suits you best.
Feel free to ask any questions you might have, ill be glad to help you.
Have fun

Do I need multiple view controllers for the iPhone & iPad storyboards?

I'm still relatively unfamiliar with all the new features of iOS 5, and what I can do in Xcode now. So, a good explanation would be appreciated.
I'm designed a single-view application and I have both an iPhone and iPad storyboard. I chose 'Single View Application' when I first started, so Xcode created a ViewController for me. Both storyboards list this view controller as their own.
Back in iOS 4 the way that I linked button actions to my view controller was to Right-Click on the button on the nib, pick the action that I wanted, then drag it over into the view controller's '.h' file, which auto-created a method/property for me.
I am confused about how to accomplish this now, since I have multiple storyboards but only one view controller. Do I need to have multiple links for each button; one for the button on the iPhone and one for the iPad? Or is there a better way to accomplish what I am trying to do now?
You do it the same way you did it in iOS4. But obviously you never built an universal app there ;-)
It's totally okay to have a single UIViewController class for two different nib files.
And if you use storyboards it's fine to use different storyboards and a single viewController too.
You can even use the same viewController for different scenes inside a single storyboard.
The connections to the viewController are saved in the nib or storyboard. So you can't overwrite them while designing the other user interface.
Open the iPhone storyboard, make your connections to actions and outlets. Then open the iPad storyboard and make totally independent connections.
In response to the first reply, I was under the impression that a view controller could only support two scenes in a storyboard layout. I say that because I found this thread.

set "default" UIViewController background image?

Basically I've got the same background image throughout my entire iphone application.
I don't use XIBs (nasty things :p).
So I was wondering if there was any way to add a "default" background image to all of my UIViewControllers?
I tried subclassing UIViewController and created the class UIViewControllerWithDefaultBackground, but changing over all my uiviewcontrollers to subclass UIViewControllerWithDefaultBackground just crashes my app. Plus half of my views are UITableViewControllers... but I'd be happy just having to change 2 classes... :p
Is there any way of doing this? I just don't want to have to copy and paste the same 3 or 4 lines of code into every single class I'm initiating. Plus, if I want to edit it at any point (take out the navigation bar and extend the view lets say) then I would have to change all my different classes.
Is there no easy way to do this programatically?
Thanks
Tom
If you add a UIImageView to your UIWindow in your app delegate (make sure it's below the root view), then make sure all your VC's are opaque, that should solve your problem.
This would be easier to do in IB, especially if you have a MainWindow .xib already created (albeit blank)--you just drag and drop the image into the UIWindow.

Resources