How to default “View as” Device in Xcode - Main.Storyboard - ios

Problem: When i start a new project in xcode, my Main.Storyboard opens by default with Iphone Xr artboard. But i do all my testing and build for iphone Xs. Because of that i have to change the "view as" device option to iPhone XS and also while i run the project, i have to make the change.
What i need: to default a device so when i open xcode, i get that as my artboard.

When you create a new project then first time need to setting your simulator or screen sizes via size classes. After that every time when you reopen it. then xcode open your simulator or storyboard according your settings.
Here you can look size classes tutorials. https://medium.com/#craiggrummitt/size-classes-in-interface-builder-in-xcode-8-74f20a541195

Related

Why doesn't the xcode simulator show full screen

I upgraded my xcode to version 12.3 and now when I create a new project, the simulator does not show full screen. The old projects however, does show simulator in full screen.
I checked this (very old) question and it says to add a certain file, how can I do that?
open the project in Xcode -> select Target -> General -> add Launch screen in Launch Screen File
In my case I removed launchScreen, and then added it back
So, to add launch screen if u accidentally removed it,
Press cmd + n
This is allow you to add new launch screen
Then in the general tab under
App Icons and Launch Images
Set your launch screen file
also in the deployment Info
set
Main interface
In the Info.plist file add key: Launch screen interface file base name and value: LaunchScreen

Xcode can't run iPad Storyboard

I have a Main_iPhone.storyboard which works great. Now I build a Main_iPad.storyboard. Now when I want to test the iPad App with the iPad Simulator. The Simulator Displays me the Main_iPhone.storyboard and not the iPad Storyboard. It's a Universal App but it does not work. The Main Interface for the iPad is the Main_iPad.storyboard. So I don't know where the mistake is :(
Anyone an idea?
Update:
i got it... my if/elseif doesn't work anymore so it picked always the Main_iPhone in the AppDelegate...
If you set up the app iPhone only when you created the project, and then added the storyboard for iPad, you need click on the root (blue icon) in the Project Navigator, then under General -> Deployment Info, make sure Devices is set to Universal. You will also see there 2 buttons iPhone and iPad. Select iPad and set main interface to Main_iPad. This should work.

How to deploy/run app on ipad simulator?

I'm having trouble converting my iphone app to the ipad. I already created a separate storyboard, and set the ipad storyboard to the new one from the build settings, however, whenever I run it on the ipad 6.0 simulator, it's not using the new storyboard I made (but still using the iphone's storyboard).
Is there some setting that I'm missing to deploy/test using the new storyboard I made for ipad?
In Project settings > (select your target) > Summary tab
You'll see iPhone / iPod Deployment Info, scroll down to iPad Deployment Info and put your storyboard in Main Storyboard field.

Update iPad application to universal application

If I release to appStore application which is compatible with iPad only.
Can I release update to this application which will be universal (compatible with iPhone, iPod, iPad..)?
Do I need only to recreate my app or I must to do something more?
Yes you can, I have done it.
Depending on how you have made your app, xibs or Storyboards will determine how you do it.
for Storyboards
If going from iPhone to iPad:
Duplicate storyboard rename it: MainStoryboard_iPhone.storyboard (include .storyboard)
Inside xCode: right click on the new storyboard -> “open as” -> “Source Code”
Search for targetRuntime line near the top ="iOS.CocoaTouch.iPad"and change it to targetRuntime="iOS.CocoaTouch"
This will create an additional iPhone storyboard. Adjust your artwork/views in the new storyboard as necessary to fit the iPhone screens
Check in the summary screen that the deployment info Main Storyboard is set to the correct storyboards for iPhone and iPad respectively
Submit as an update.
If your using xibs you can duplicate and rename them ~iPad if going from iPhone to universal or ipad app, not sure about the other way around for xibs
No new bundle ID needed

iphone to ipad conversion: some storyboard options missing

I'm converting an iphone app to an ipad app. I've changed the project's build target from "iphone" to "ipad" and the app compiles, builds, runs and displays the way I want it to.
However, I've noticed that some parts of Storyboard still believe this is an iphone app. For example, when I try to build a segue, it only offers me the "push" "modal" and "custom" options. A newly created ipad project also offers the "popover" and "replace" options.
Similarly, this converted app does not offer me the possibility of a Split View Controller.
So is there a setting or some way to get this "iphone" -> "ipad" app to have the full ipad storyboard options without restarting the project and copying everything over?
I had a similar problem to this awhile back. I fixed it by clicking on my main project on the navigation panel. If you go to summary and look under the iOS Application Development you will see a spot that asks which devices your app is targeted to. Make sure this is switched to universal
Next create an iPad storyboard under File > new > File... > User Interface > Storyboard > set Device Family to iPad (It sounds like you already did this though). Make sure you call it something different then your iPhone storyboard.
Lastly go back to your project settings and scroll down to the iPad Development Info you will see a drop down titled Main Storyboard. Make sure that is set to your newly created iPad storyboard.
If this still is not working for you the Standford ItunesU iOS course has a lecture on converting iPhone applications to universal ones.

Resources