Make Universal (iPhone+iPad) app run on iPhone storyboard on iPad (simulated size) - ios

I have a universal app that I've previously designed for both iPhone and iPad, now I don't want to work with the iPad storyboard. I know that I can't withdraw iPad support as I've previously published the app as universal. I need to keep my app "Universal" (so that I can update my app without failing verification), but make iPad use the iPhone storyboard in simulation mode. How can I use my iPhone storyboard with iPad in simulation mode? I've deleted the iPad storyboard, and changed the main interface of iPad also to the iPhone storyboard, but now iPad stretches all the view constraints to 768x1024 to fill the screen, giving it an ugly look. I just want to simulate the "iPhone app" (with the 2x button at the corner) but for obvious reasons, I need to keep device mode in "Universal" in project settings. If it's not possible, what is the best practice to programatically limit the whole storyboard to some limited size on the screen to manually make my app run at the same size (or double) of iPhone?

You can't do what you are asking. Once an app is universal it stays universal. You can't suddenly make the app appear to be iPhone-sized on the iPad. The universal app on the iPad will always be full screen. You need to continue properly supported the iPad screen size.
Your only other solution is to create a new iPhone-only app with a new bundle id. Of course this is bad for your existing users.

When you make your app only for iPhone and run it on iPad, there will be 2x scaling button. If you make your app universal, then your view will be stretched on iPad unless you use constraints, or create your screens programmatically regarding iPad and iPhone UI element sizes.

Related

IB Storyboard for App Extensions: iPad Icons Not Present, Sizes Don't Change, Orientation Not Working

I need to update a 3 year old iPhone-only, portrait only (NOT universal) camera/photo app that worked with iOS 8 that contains a Share extension that now (with 10.0???) crashes at times (but works many other times), and I'm trying to debug the issues and update to iOS 9.0.
The first issue I found and fixed was the lack of Privacy strings for access to the camera and photo library.
But I also found that the extension does not work with Photos on an iPad with layout issues (in the Simulator so far). As the docs say, extension targets must be made for iPhone/iPad and my build setting for the target extension are set to 1,2, and I use Auto Layout.
The storyboard, the Extension scene, a View Controller Scene, all view controllers, views and subviews all are set for Auto Layout as well as Safe Area Layout Guides, but the only devices shown in IB are iPhones with no iPads available, when selecting other devices no change is seen in size, and the iPhone is constrained to portrait mode.
I've tried setting the main app as Universal, allowing every orientation, building, and still no iPad icons in IB to test the UI for the extension (and trying to get Landscape mode in IB doesn't work either).
Is there a way to get IB to show and allow iPads/iPhones, particularly iPads, and change orientation during development for app extensions?
Selecting "Use Trait Variations" made the iPad icons appear.

UIView shows perfect on iPhone but not on iPad

I am pretty new to iOS development and I am able to create views and controllers. I have been testing using my iPhone and other sizes of iPhone and they look great. I tried once on an iPad but it was a border around the screen like in this image.
I constrained to margins and I did not give any height or width constraints so it could stretch properly. It also looks good on the storyboard viewing so what could I be doing wrong? Can't seem to find any resource online to help.
This is default behaviour when you run iphone app in ipad
This happened because your app is supported iphone only .
Tap on your project and select universal if you want to add support for both iphone and ipad.
Other option is you can check requires full screen check box but it will still show black bar
Note: However you are developing iPhone Only app but it is compulsory to check that everything works fine in ipad because apple review team will also check that in ipad and your app may be rejected if something is not proper
May be you have made an iPhone app. Try to change the setting to Universal app in the xcode settings. Normally iPhone app shows scaled on iPad, which is same as in your case.
Select Projet in xcode -> General Setting

iPhone app does not work correctly on iPad after change from universal to iphone only

How can I run iPhone apps on iPad after changing the target from an initial 'Universal' to 'iPhone'?
I'm working on a game for iOS (iPhone) using Swift and SpriteKit. The game got rejected today for this reason:
Reasons for Rejection: 2.10: iPhone apps must also run on iPad without
modification, at iPhone resolution, and at 2X iPhone 3GS resolution
After searching on StackOverflow I found out that it might have something to do with my info.plist file because at first my app was 'universal' and later I've changed it to iPhone-only.
It seems like there's something wrong with the aspect ratio of all the nodes. Take a look at the screenshots below. At the left side is the iPad-simulator and on the right there's the iPhone-simulator.
Maybe the game still thinks it is running on iPad because the nodes appear in 4:3 ratio?
How can I run iPhone apps on iPad after changing the target from an initial 'Universal' to 'iPhone'?
Please help. Thanks!
I've also added a screenshot of my info.plist file.
Apple requires that each app targeted on iPhone should run on iPad in the specific manner.
This usually looks like the app on iPad is not full-screen, it's surrounded by black frame that resembles the situation that the iPad is simulating iPhone.
My suggestion is to use size class now to make the app run full-screen on iPad and this should fix your issue with Apple.
Simply choose in your storyboard Regular Width and Regular Height, delete the existing constraints and set new ones.
More help here and apple docs also might come in handy
Darvydas' comment solved my problem.
What size does your background node have? Also if you whant your app
run only on Landscape delete those 2 (Item 0, Item 1 PORTRAIT)

Adding a Launch Screen changes the display of my whole app

I tried adding a launch screen to my app. I tried the simplest : just add a new file of type Launch screen to my project (and do nothing more). But this seems to change the resolution of my whole application. Here are sample screens of the same controller of my application with and without the Launch Screen :
without the launch screen :
with the launch screen :
Strangely, once I have used the Launch Screen once, I need to quit and re-launch the simulator to re-obtain the original resolution.
What should I do and which resolution is the correct one to work with ? Does it have something to do with retina ?
I can copy-paste the code generated in the LaunchScreen.xib if needed.
From Apple's documentation:
You use a launch XIB or storyboard file to indicate that your app runs
on iPhone 6 Plus or iPhone 6.
By adding a launch screen you activated native support for iPhone 6 and iPhone 6 Plus. That means that your app is no longer scaled up to adapt the larger screens of the iPhone 6 and 6 Plus, but uses the full resolution of those larger screens (which IMHO is a good thing that you should do).

IOS 8 iPad make only Launch Screen portrait only

I know how to make an iPad app portrait only for the whole app and how to make particular views portrait only, but not how to make the launch image portrait only. How do I do it?
Currently I only have "portrait" checked under "iOS 7.0 and Later" in images.xcassets. The reason I want the launch image portrait only is I tried getting landscape to work but despite multiple attempts and asking about it here, I had no luck.
Clarification:
I want the app to handle both portrait and landscape iPad and iPhone. But the landscape image for iPad does not display so I want to force the launch image and just the launch image to be Portrait only.
No idea if you checked this but here is something often overlooked.
In the Workspace, if you choose your target project, in Deployment Info, there are two things to check there. First, make sure the Device Orientation is set to "Portrait" only. Then, open the drop down menu on "Devices". Choose each separately and do the same thing. For some reason for me, universal does't apply it to iPhone and iPad simultaneously.

Resources