Beginner here.
I'm trying to make an iOS app using the Tab View Controllers, and I kinda ran into a problem , at least I don't know how to do it .
The Tabs Look like this : First Choice, Second Choice, Settings ( here I'll have some text fields and a save button , and everything will be saved in a plist. ) .
Basically what I'm trying to do is , the first time the App is lunched, i want to make an if statement to check if the plist file exists and the data is there. IF Yes , just load normally with the First Choice View Controller , if NOT , Load Settings View Controller .
Any ideas on how to do this?
Thank you
This is a relatively contrived example because no sample code was provided but it should work.
In your applicationDidFinishLaunchingWithOptions or you could do willEnterForeground, run your plist check.
Then depending on the success or failure set the selectedIndex which is a property of UITabBarController to whichever one you'd like.
Related
I have my WatchKit app (WatchOS1) set up in the following way (names have been changed to be project unspecific):
InitialInterfaceController - The main entry point of the watch app. This controller is only used to load several instances (using the same identifier repeatedly in the NSArray) of the next view using reloadRootControllersWithNames:contexts: (called from awakeWithContext:).
FirstInterfaceController - This Interface controller should be what is first displayed for the pages.
However this does not work - I get left with the blank InitialInterfaceController screen. If however I call [self presentControllerWithNames:contexts:] it works as expected, but includes the cancel button, which is not what I want.
I have seen people suggesting to use this method to dynamically create multiple page navigation scenes, but I cannot see why this doesn't work. The FirstInterfaceController's awakeWithContext: is never called.
Has anybody had this problem or is there a fix available?
Do you have the right value for the Identity in the interface controller's attribute inspector? (I have seen issues when the identity and class name are the same, make sure they are different)
Is that interface controller added to the right module in the identity inspector?
I am working on an application which allows users to work with a couple of workmodes. Main view of the app contains information common to all workmodes. I want to create a "subview" with ability to change its ViewController. This subview will be used to display information connected with specified workmode. It is important that app goes to MainViewController from WorkmodesViewController in which user chooses workmode to work with.
My question is:
Which tehnique should I use to acheave changeable WorkmodeViewController inside MainViewVontroller
I have found example git project with functionality I need:
https://github.com/mluton/EmbeddedSwapping
Well I am a big noob with xcode, and I have a question. Well basically, I keep watching tuts, about creating a outlet with a web browser or a image view, and all you do is open up the editor and ctrl + click/drag the "image view or web browser" into "view controller H" but every time I open up the editor and click my image or web browser it just goes to in the editor "UIViewConroller.H" and doesnt stay on "ViewController.h". I dont understand why its doing this and every tut i watch or read about, they say do this, and it's not working for me.
So, in your XCode, I assume you have it setup where you have:
A storyboard
Some sort of ViewControllers inside the storyboard
Some ViewController classes
What you need to do, is you need to make sure that the correct class is referenced inside your specific view controller in the storyboard!
Then, you will want to make sure that you select the Venn Diagram up top, representing a split view.
And then you want to make sure your pair window is set to automatic:
Let me know if it helps! PM Me if not.
You need to select class for your ViewController.
Select the ViewController >Open Utilities > Identity Inspector and make sure that the Class is ViewController
I am trying to create a new Swift project and am having some issues. I tried to create a new single page application but when I build I get an error saying:
2014-06-07 11:04:13.752 Matchismo (Swift)[2007:598021] Failed to instantiate
the default view controller for UIMainStoryboardFile 'Main' - perhaps the
designated entry point is not set?
But when I create the same single page application project with Objective-C as the language, it compiles and runs just fine. Is there some manual thing I must do in Swift to get a project up and running?
My understanding for this error is that I need the default view to be set, which is merely checking a box on your view controller's attributes (picture below). I tried the solution suggested in this stackoverflow post but it didnt help and I can't find much more help on the subject with Swift being so new. Any suggestions are appreciated.
Select the ViewController Scene. Now, select the inspector panel from the sidebar options. Check the “Is Initial View Controller” attribute option, save the project and build the project again.
Some times it doesn't take the initial view controller.Just create a new storyboard with anyname you want and set that name into the interface in your application setting.
Copy paste the code from previous storyboard and run the app.
The application will run fine.
Dont forget tocheck the initial scene in storyboard.
By following the below steps, it would work fine:
Select the Scene which is the type of ViewController/UICollectionViewController in Main.storyboard.
Select the Attribute Inspector in the right sidebar.
Click/Check the “Is Initial View Controller” attribute.
Re-Run of the project and this should solve the issue.
In creating an App, I want to achieve:
First Visit (if !setup):
1) SetupView [UINavigationController]
2) OverviewView [UINavigationController]
Second Visit (if setup):
1) OverviewView [UINavigationController]
I'm looking to use storyboards, but what is the best practice to use here? Should I
a) Create separate storyboards (one for setup, one for regular use) and change between those two
b) Have a single storyboard, with two separate UINavigationControllers, having SetupView as the initial and programmatically check setup? yes/no to forward to the OverviewView? If so, which transaction? I tried doing this, but the App crashes if I do a push segue to the new nav controller.
Looking forward to hearing from you guys!
go with option B, you just need to make sure in your app delegate to perform a check on which controller to show.
You can set in your Settings.plist a BOOL variable that show if the setup has already done or not. fetch that result from your settings plist and use it to call one or another view controller. ( if the BOOL hasSetup is TRUE ( you already have setted all up ) you won't even create the instance of the setup controller ).