Can't get the xcode storyboard modal buttons to change screen - ios

I've been following an ios tutorial where I'm required to create multiple view controllers with different screens and connect buttons with modals. I've set up the buttons propertly and even set up the modal settings, but when I run the iphone simulator, nothing happens when i click the button. Is this a bug or am i doing something wrong?
Thanks!!

its probably a problem with your storyboard connections
Open your storyboard
Open the right utilities panel in Xcode
Select the connections inspector tab
Select the different views/buttons involved in the failed interaction, and check the connections panel.
My guess is it's the button's connections - either it's missing or its trying to link to a connection that isn't existing

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.

Xcode Main.storyboard not showing what appears in the iOS simulator

I am working on a project with other teammates so we have be storing our project on the cloud as a zip file. After unzipping the file, Xcode does not display the main.storyboard correctly; won't show buttons, labels, images, etc. However, when built using the simulator, all of these display correctly. In Xcode I can access them and change them but am unable to delete or move them through the main.storyboard. Any ideas or suggestions to fix this inconvenience?
I think this is because the view controller is locked to prevent editing. Try unlocking it by
Select Identity Inspector of view and set Lock to Nothing

Why are all my view controllers square shaped?

I'm trying to get it to be an iphone project, but when I drag any view controller into the storyboard, it's just a weird almost-square, neither ipad nor iphone. What am I doing wrong here? Newest version of XCode.
This is a new feature called "size classes". You can use it to create a universal storyboard for iPhone and iPad at once.
But I don`t really like it so here is how to turn off: In storyboard, open utility inspector (right), then go to file inspector (left) and now disable "Use Size Classes". Then you will get the standard storyboard.
You're not doing anything wrong. The default is to design with UI constraints so that the actual output size doesn't matter.
What you can do is set the size you want to preview your controller at in the options in the right hand pane. E.g.

xcode 6.1 iphone/ipad storyboard

Trying to design iphone UI on xcode's new storyboard:
This seem's a little haphazard for designing just iphone UI.
I expected some form of 'iphone' 'ipad' 'extendable' boundaries or lines but all i can find is this one single storyboard. is it really just the single storyboard now or am i missing some additional controls?
Starting with XCode 6, the storyboards for the iPhone and iPad have been combined using a new feature called Size Classes. That's a good thing (most of the time), since it lets you design one interface that will adapt itself to different screen sizes.
Of course, there are situations where you may want to use different storyboards for the iPhone and iPad. After all, some apps just need a whole different approach on palm and tablet sized devices.
If you want to use the new Size Classes, see one of the growing number of tutorials, like this one by Ray Wenderlich: http://www.raywenderlich.com/83276/beginning-adaptive-layout-tutorial.
If you would like to use separate storyboards for iPhone and iPad, here's how:
Start with a new Single View Application.
a. Select File|New|Project.
b. Select iOS, Application and click "Single View Application."
c. Click Next.
d. Give the project a name, then click "Next."
e. Pick a location and click "Create" to create the project.
Convert the starting storyboard to an iPhone storyboard.
a. Select Main.storyboard, and select the file inspector (the document icon at the top of the right pane) if it is not already selected.
b. Uncheck "Use Size Classes."
c. A dlialog will appear. Select "iPhone" from the drop down menu, then click "Disable Size Classes."
d. Rename the storyboard as "Main_iPhone.storyboard."
Create the iPad storyboard.
a. Select File|New|File from the menu bar. From the dialog that appears, select iOS|UserInterface. Click on "Storyboard" and click "Next."
b. Rename the file as "Main_iPad.storyboard," then save it, typically in the Base.lproj folder of your project folder.
c. Add a view controller, and make it the initial view controller by clicking the "Is Initial View Controller" check box in the Attributes Inspector pane.
Convert the new storyboard to an iPad storyboard by following the same steps as #2, above, but this time select iPad rather than iPhone when you select the platform.
Link the storyboards to the app.
a. Open the Info.plist.
b. Change the name for "Main storyboard file base name" from "Main" to "Main_iPhone.storyboard".
.c Add a new property called "Main storyboard file base name (iPad)" and give it the name "Main_iPad."
That's it! You can now create separate UIs for iPhone and iPad the way you always did.
In Utility Area select your storyboard
Show the Atributes inspector > Simulated Metrics > Size > Select Size

iPad storyboard changes not happening?

I started a xcode project for iPhone and now I'm working it also for iPad (Universal App).
So in devices I put Universal and I create the iPad storyboard and make the necessary changes (in plist file and build settings) and now anything I edit in the ipad storyboard is done, obviously yes on code but not in the storyboard (I'm working without auto-layout so Its disabled in both storyboards).
What can I do? I've checked everything and it's in order.
Just a guess, but you might be getting an error showing up in your debug console. Make sure that the storyboard has an entry point. Select the viewContoller that is the entry point and check the checkbox for "is initial view controller" in the utilities pane.
did you check the target> General> their did you give the storyboard for ipad? if you look, you can see the selection on iphone and your iphone storyboards name below it. Change it to ipad and enter the storyboard?

Resources