Converting Storyboard from iPhone to iPad
I found out a kind of solution:
Duplicate your iPhone-Storyboard and rename it
MainStoryboard_iPad.storyboard
Close Xcode and then open this file any text editor.
Search for
targetRuntime="iOS.CocoaTouch"
and change it totargetRuntime="iOS.CocoaTouch.iPad"
Change the code in the MainStoryboard_iPad.storyboard from:
<simulatedScreenMetrics key="destination" type="retina4"/>
to<simulatedScreenMetrics key="destination"/>
Now save everything and reopen Xcode. The iPad-Storyboard has the same contents as the iPhone-file but everyting could be disarranged.
This saved me hours - hopefully this will help you
How to migrate from iPhone/iPad storyboards to universal storyboard
I adapted this tutorial and a similar solution by @tharkay to create this solution below.
- Rename
Main_iPhone.storyboard
toMain.storyboard
- Delete
Main_iPad.storyboard
- ***If you want to use the iPad storyboard instead of the iPhone, rename the
Main_iPad.storyboard
toMain.storyboard
and delete theMain_iPhone.storyboard
file. You will then need to go to the File Inspector and right-click your storyboard, then select “Open as Source Code”. This will display all that XML code. ChangetargetRuntime
from"iOS.CocoaTouch.iPad"
to"iOS.CocoaTouch"
From:
targetRuntime="iOS.CocoaTouch.iPad"
to:
targetRuntime="iOS.CocoaTouch"
- In the project file, under general settings, select
Main.storyboard
for both iPhone and iPad.
- On
Main.storyboard
, on the right-hand panel choose theShow the File inspector
icon.
- Check the box named
Use Size classes
- XCode will prompt with an Xcode 5 compatibility message, Select YES.
- Compile and run.
- Of course, all your views should be messed up and you'll need to redo auto-layout.
What is the best way from universal app and converting storyboard in ios
What I want to know is, what is the best way
That depends on your needs. Do you want the interface to be the same on iPhone and iPad, except sized differently? Then you may be able to use a single storyboard and rely on autolayout to adapt to different devices. If you want different interfaces on iPhone and iPad, perhaps to take better advantage of a much larger screen, then use different storyboards for each device type. You should still use autolayout in each storyboard, though, because within each device type there are several different screen sizes.
is it a problem to have two storyboards one for iphone and another for iPad
No.
Real device not showing changes as per iPad storyboard in Xcode 7.3.1
Friend if you want to do proper universal changes please follow below steps
Open application in Xcode. Select Project Navigator.
Select your Project Target.
In Deployment Info section, select Devices. Here you will see 3 options – iPhone, iPad and Universal. Change from iPhone to Universal.
It will prompt you an alert Copy “Main” to useInnovationM-iPhoneOnly-To-Universal-App as main iPad interface. It is prompting to use the name of the Storyboard (Main here) to create another iPad group. Normally, you would select to copy.
It will add new iPad group.
Add new Storyboard file under the iPad group in Project Navigator. Name it Main_iPad.storyboard.
Change name of iPhone storyboard as Main_iPhone.storyboard from Main.storyboard.
Update entry in plist. Main storyboard file base name – Main_iPhone
Add entry in plist. Main storyboard file base name (iPad) – Main_iPad.Now add your controller, outlet, action to Main_iPad.storyboard.
Make changes to Main_iPad.storyboard to make it utilize the complete screen. This would involve making changes in position, height and width of components.
Also, you need to provide images for iPad.
In order to all this work please you should check your xcode version before doing any of it ?
Making two storyboards for iOS (iPhone and iPad)
create two different storyboards and name them so they are easily specified which is which. Then click on the file that allows you to change settings for your actual app. and change the build to universal
, then specify which storyboard you want to use!
there is a storyboard setting for iphone and ipad
iPhone
iPad
Make sure the names of the storyboards are correctly set though
Scenes - Use dedicated Storyboards depending iPad or iPhone
Now I seem to have lost the ability to use different storyboards for iPad from iPhone
It's quite simple (and, as you say, not documented). You need two completely separate scene manifest entries in your Info.plist, i.e. UIApplicationSceneManifest
and UIApplicationSceneManifest~ipad
. They just specify different UISceneStoryboardFile
values, and you're all set just as before scenes came along.
Related Topics
How to Check How Long Ago Was the App Last Opened
Why It Shows "Ld: Framework Not Found Bolts"
How to Develop or Migrate Apps For Iphone 5 Screen Resolution
How to Access a Specific Field from Cloud Firestore Firebase in Swift
How to Record Video of Front and Back Camera At a Time in Ios
How to Add Pagecontrol Inside Uicollectionview Image Scrolling
React Native App Crashes on Launch Screen on Device
How to Get the Root Directory of My iOS App
Wkwebview Not Loading Webpage - Renders Blank Screen in Swift
How to Center Horizontally Uicollectionview Cells
How to Create a Custom Pop Up View With Swift
Iphone/Ipad: How to Make Uitextfield Readonly (But Not Disabled)
How to Add Constraints Programmatically Using Swift
How to Develop For Iphone Using a Windows Development Machine