I'm trying to make an app for iOS but I'm new to Xcode, and I'm having some problems. In my project file I have a "ViewController.xib", but I need a tabbed application so I created a storyboard and I moved the ViewController from the ".xib" to the Storyboard. In the storyboard I have a Tab Controller with two items, one of them is the ViewController (a photogallery) moved from the ".xib". I've changed the class, I've changed the "Main Interface" with "Main Storyboard" in the project Info, but when I run my application I can't see the Storyboard but the single View Controller, alone. It's like the Storyboard doesn't exist. Forgive my ignorance, I hope you can help me.
While creating app checkmark the Storyboard
Related
I have two projects in workspace, I want to navigate one project storyboard to another project storyboard.
Use storyboard references. Drag an drop a storyboard reference from the side panel and connect it with your respective view controller. Select the storyboard reference and edit it's properties like the first/main view controller of it. Name the segue as usual and you'll be able to switch between multiple storyboards
P.S: make sure the all your storyboards has their entry points set!!
I'm new to ios develop,I learned about storyboard recently and I'm trying to use it.But at last the storyboard file looks doesn't be loaded.
What I have done is:
1.add some ui elements like Button to initial xib file of storyboard
2.modify Main Interface in project - General page to Main.(my storyboard file name is Main.storyboard)
When I start the app,the screen is all white with nothing.Anyone can tell me why this happened and how can I solve this bug.Thanks!
Update1:As this image shows,I have set initial xib for storyboard.
Since you said you didn't created the project with a storyboard template, look for this line in your info.plist
This could happen because the subview frames are being created outside the view frame. Try setting some alignment constraints in your subviews.
You have to set your controller as initial view controller.
You can find it in your Main.Storyboard on the right site, if you select your first controller.
Here in 2021, a default Xcode project uses scenes, but that requires iOS 13 and I wanted to support iOS 12. I deleted the SceneDelegate file from my project and the scene delegate functions from the AppDelegate file, but then my storyboard wasn't loading either. The problem is that I also needed to remove the Application Scene Manifest section from info.plist.
Hi i'm just a bit confused on the linking things from the storyboard to the ViewController.h. I've created a new single view application project and when I went to the storyboard I made a button. Now I went to the editor view and ctrl-draged the button onto my ViewController.h which worked. But when i created another view controller on the storyboard with a button on it, ctrl-drag does not work anymore. I've tried typing in myself, -(IBAction)test:(id)sender;, but it wouldn't let me connect to the button on my second view controller.
You did not set your class name in the VC settings.
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.
I created a new singleView application without storyboard (say FirstProject) and another single view application with storyboard (say SecondProject)and then added a storyboard in the application which didn't have a storyboard previously.
Then I went in the FirstProject and changed the class of the storyboard to the viewcontroller class in identity inspector.
After that I opened other files in the two projects individually and made changes in the code to be same in the corresponding files in the two projects.
Now when I run the project which had storyboard at the time of creation shows a white blank screen but the other application (in which storyboard was added later) shows just a black screen with no errors and no warnings.. What is the difference in these two files?
What is it that I am missing. How to tell an application that it should now load its view from storyboard and not from a XIB file as there is none?
I second the "Good Job" building from scratch to truly Grok storyboards.
You need to delete the template code and just return YES; in application:didFinishLaunchingWithOptions:
Complete Process
Create a new project using the "Empty Application" template.
New File, User Interface, Storyboard
Set the storyboard in the targets summery (updates the info.plist)
Delete the template code and just return YES; in application:didFinishLaunchingWithOptions:
The way that a storyboard application knows to use the storyboard at launch time is that the Info.plist file contains an entry pointing to the main storyboard. You need to set that up. The "Main storyboard file base name" (UIMainStoryboardFile) must match the base name of the storyboard file; the system sees this and loads the designated storyboard file automatically as the app launches.
Also you need to make sure that the initial view controller in the storyboard is marked as the initial view controller.