iPad storyboard changes not happening? - ios

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?

Related

iOS Xcode LaunchScreen Storyboard not displaying

I'm trying to use Xcode's LaunchScreen storyboard as my launch screen? All the questions that have previously been asked about this refer back to the old launch image or .xib method - trying to do it now with the new LaunchScreen storyboard that Xcode automatically generates instead. I've selected the LaunchScreen storyboard as my launch screen file in my Deployment Info:
The storyboard itself confirms that it is set as the launch screen in it's file inspector.
And the info.plist file reflects this as well.
And yet, it doesn't work. The LaunchScreen storyboard never shows - it just goes straight to the first screen in my main storyboard. Using Xcode 7.2 and deploying to iOS 9.
Enable these two settings for the LaunchScreen.storyboard
If you are using xcode 11.2 you'll need to remove the app and execute it again to see the launch screen. I have to do this every time I modify the launch screen in order to see the new changes.
Another thing to make sure is that Launch Screen File is set to Launch Screen.storyboard
**Delete the app from the device. Re-run. **
In my case I had all the suggested settings set correctly but continued to have the original blank launchscreen. In the spirit of AmJa's suggestion regarding a "cache" problem, I deleted my app from my device and reinstalled. Reinstalling did the trick for me on both my devices and simulators.
In case anyone else runs into this issue, I resolved it by simply deleting the ViewController on my LaunchScreen storyboard (leaving me with an empty storyboard), creating a new ViewController and resetting the Storyboard entry point to that new ViewController. There may be some sort of bug with XCode 7.2 with respect to the LaunchScreen storyboard and default entry point into the auto-created View Controller, but then again, I've tried replicating this 3 times and it hasn't ever repeated itself, so maybe not.
In storyboard, in ViewController scene, I had to check Is Initial View Controller for storyboard to be seen as Launch Storyboard.
Suprisingly this is not checked when you add first View Controller. Xcode 11.
Just in case it helps someone.
Scenario, I created my new project and copied a old Launch Image from another project. And then started getting the launch image but when I wanted to change it to new image then still i was viewing the old image it was stuck for ever as launch image no matter what I do.
Then I reset my Simulator and restarted my iPhone and there you go I stared getting the new image. This looks like that somewhere in the documents or cache the devices store the old image until you reset the phone.
Thanks
As #abanet, mentioned in his answer, anyone who uses Xcode 11.2 and above, they have to delete their app and launch it again to see launch screen changes. It's not reflecting immediately. It looks like a bug from Xcode definitely not an intension.
How to fix for Xcode 11.0 and above:
Do this: https://stackoverflow.com/a/41287094/2190175 if you haven't already, and after that:
Delete app from device / simulator
Restart device / simulator
Reason: Launch Screen part of storyboard is cached during development and doesn't change until you remove app from device / simulator and reinstall it completely.
Other solutions didn't work for me, but this did:
Toggle on and off Device Orientation (e.g. support Upside Down) and Hide Status Bar in General.
I'm not sure which one did the trick, but it's working now.
If you don't see anything and your Launchscreen.storyboard only has an ImageView in it, then it might actually be showing the storyboard but not the image. Try putting a button in it or something. I've discovered that my Launchscreen.storyboard is actually showing but won't show any images and I don't know why.
The issue can be also that the "LaunchScreen.storyboard" is not added to this target.
To fix this open "LaunchScreen.storyboard" then press on "File Inspector" and under "Target Membership" add it to the needed target.
I tried everything mentioned here, the only thing that worked for me was creating a new LaunchScreen file. I'm using Xcode 12.1
(Don't forget to update the reference in the targets settings)
I was banging my head against a wall with this since Xcode 10.1 does not include a launch option for the new 11" iPad Pro when you create a new iOS Launch Image set, and without it, the iPad Pro doesn't display correctly, leaving me no choice but to get this working with a Launch Screen storyboard.
I tried combinations of so many things, but I wanted to post what ended up making it work 100% of the time (which was, in fact, a combination of a number of things).
As you have no doubt read, for the UIImageView within the Launch Screen storyboard, you should NOT include the extension (.jpg or .png). So many posts say that, but leave out that the reason is that you should create a new image set within Images.xcassets (NOT Launch Screen image set, but just image set) and name it whatever you want (for instance, "Launch-Default"). Then, drag and drop the desired .jpg or .png into the new image set. You will then use the name of that image set within the UIImageView in the storyboard and everything should work fine (the image should even show up inside of Interface Builder).
Also, within the General settings for the project, make sure to set the Launch Screen File to your new storyboard.
You need to add App orientation specific Launch Screen.
LaunchScreen Portrait: https://app.box.com/s/hfoeuvsy68iu913keb8p5hs1z9fdz3jk
LaunchScreen Landscape : https://app.box.com/s/o9q5nkrvk2ewdh57oiiar85zf658olgj
Drag LaunchScreen.storyboard & LaunchScreenBackground.png to Xcode sidebar. Then specify LaunchScreen in Xcode General page. See attach image
In my case, the problem was that the image for the logo was taken from a different target. Make sure that the image is from the main target of the application, and reset the simulator via menu Device/Erase All Content ad Settings...
In my case a few image views cover the whole parent view of the launch screen (e.g. pinned to the view edges). I had to uncheck the Resize view from NIB in the Attribute inspector for the launch storyboard and finally it worked for me (just do not forget to manually delete the old app from the simulator)
In my case the background color of the view (full screen) was set to a "missing" color literal! After trying all above of course ;(
A jpg image does a problem change the extension to png or use another png image
Worked like a charm for me
in xcode9 swift4 LaunchScreen storyboard, use .jpg image & uncheck clear graphics context for imageview. it's absolutly working.

XCode does not recognize iPad storyboard

I have two storyboards Main and Main_iPad. My problem is that, in both of iphone and ipad devices, only Main storyboard gets selected and executed. What I did is:
iPad storyboard selection
iphone storyboard selection
I dont know its usage
So, whenever I change Universal from Main to Main_iPAd my it is working on iPad but crashes on iphone. But when I change it to Main, then it works both on iPad and iphone but, does not recognize the model inside Main_iPad. What can be problem?
I've had this same problem. My conclusion is that you can't configure this correctly by editing the target (as you are doing). You have to go directly into the Info.plist file and set it up there, by editing the "Main storyboard file base name" and "Main storyboard file base name (iPad)" entries.

Converted Universal App doesn't show the iPad Interface

At the moment I'm building an iPhone App.
Yesterday I tried to convert it to an Universal App.
It worked, but it just shows me the tab bar, but nothing else.
I've created some Web Views and a Table View, but the iPad Simulator didn't show anything, only the tab bar.
The iPhone Simulator works great, I can see all the labels, web views etc...
I've created one Storyboard for iPhone and one for iPad.
I don't know why the iPad Simulator doesn't display anything.
Hope you can help me.
Regards
Check that you have changed the storyboard name in you target general settings, as shown in the picture below.
Use the right name for you app. Check also that the info.plist file for your project has been correctly updated:
(the second entry is for the iPad).
If that is ok, try and make a clean and rebuild.

Xcode storyboard: Why does the iPad storyboard show iPhone sized views?

I have a universal app that uses storyboards. There is an iPhone storyboard and an iPad storyboard. However, in interface builder, the viewcontrollers for the iPad storyboard are still sized for the iPhone. How do I get the iPad storyboard to show iPad sized view controllers?
I realize that the view controller display in interface builder is design-time-only eye-candy, but having iPhone sized VCs makes it really hard to lay out the UI correctly.
After some digging through the storyboard source code, it turns out that the iPad storyboard was copied from the iPhone storyboard. So, the question really became how do I convert an iPhone storyboard into an iPad storyboard?
The answer is surprisingly simple. I ran across this SO answer -- to convert an iPhone storyboard to an iPad storyboard, do the following:
From Xcode, right-click on the storyboard and choose Open As ->
Source code
Search for targetRuntime="iOS.CocoaTouch"and change it to targetRuntime="iOS.CocoaTouch.iPad"
Right-click on the storyboard again and choose Open As -> iOS Storyboard
The storyboard will now show all views in the correct size.
When you first create a storyboard you select a Device Family (iPhone or iPad) that the storyboard is targeted for. I don't know of a way to change the device family once the storyboard has already been created.
However, to solve your problem I recommend the following:
Create a new storyboard by going to: New -> File -> User Interface -> Storyboard (Be sure to select Device Family = iPad when choosing the options.)
Go to your old storyboard, select and copy everything by pressing Command-A, Command-C. Then go to your and paste everything by pressing Command-V. Your view controllers will now be iPad-sized.
You can then delete the old storyboard and rename your new storyboard to whatever the old name was.
This answer is not a solution, but will help to get one of the reasons why such things happen.
The issue occurs when you try to disable:
"Use Auto Layout"
When you uncheck it, the popup window appears. There is select:
"Keep size class data for: iPhone", by default is selected iPhone (no matter which iPad or iPhone project you created).
If you will not mention on it, your storyboard will be auto converted to iPhone sizes.
Do not forget to choose right device.
I used the suggested answer to convert an iPhone storyboard to an iPad storyboard and it worked great for most of my views. However, I realized that one of the views was still iPhone storyboard sized. The reason was because I had locked All Properties of one background image (because I did not want to accidentally move it). Removing the lock turned the view back into iPad sized. This might help someone stuck on this.
Make sure you set the right Storyboard in Target > General. This kinda stuff makes me headache for 3 hours before i realise i set the same storyboard for iPhone as my iPad storyboard.
In my universal app, I was using SpriteKit for the main viewcontroller. The SKScene.scaleMode was set to aspectFill. When run in the iPad simulator, the app started up iPhone mode. Solution was to set scaleMode = .resizeFill.
For me i have found it more easy by changing the view controller presentation to Full Screen rather than Automatic, I use Xcode 12.1

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