Swift App - Did not run at iPhone resolution when reviewed on iPad - ios

I have a swift universal app that I submitted and was approve the first time. However, when I submit an update and it got rejected because did not run at iPhone resolution when reviewed on iPad.
I know that I need to use auto layout to fix the issue, but it will take me a while to learn that. I need to submit the update as soon as possible to fix some bugs in the first version. Is there quick way to fix this? My app is a simple app with only text, button, no images. My main target will be iphone users anyway rather than iPad. Is that possible to scale the screen up when it is run on ipad. When I changed the device from "universal" to "iphone" in my app setting, and launched the app on ipad in the simulator, it actually scales up. However, it doesn't when I choose the universal.
I know in swift, I can use the following code to detect users on iPad, but I don't know how I can scale the screen up to fit on iPad. Thank you.
UIDevice.currentDevice().userInterfaceIdiom == .Pad

I don't believe you will find a "quick-fix", but I'm not an expert on coding right now. This was the whole purpose of the Auto Layout features being implemented. AutoLayout allows your apps to scale independent of the device type you are using with a few caveats.
I know in SpriteKit game design you have a ScaleMode that can be set to .AspectFill, but I'm not entirely sure on just a regular View Controller without the AutoLayout.

Related

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 X scaling issue, can we scale existing apps to fullscreen mode without an app update

All my existing apps are not scaled to iPhone X, is there any way to make them to full screen without an update.
It will be really helpful if we don't have to go to the hassle of upgrading all the apps again.
And if not what are the options of doing it.
It is reminding me of days back to iPhone 6.
No, you can’t get your app out of letterboxed mode without at the very least updating your app to use a launch storyboard (and building it against the iOS 11 SDK).
Also, just doing that might not make your app work right on iPhone X — unless all your UI is built from only basic uses of system view controllers, you’re likely to have at least a few issues where you need to tweak your layout to respect safe areas. (Otherwise you end up with UI hiding under the notch or rounded corners.)

Does the app get auto resized?

Does the application get auto resized when uploaded to the AppStore to fit all devices like iPhone 5 and iPhone 7+ ?
I'm asking this because I'm about to release a new app for the Appstore but in the simulator and on a real device the application doesn't gets resized and all the buttons and label etc are not where they should be.
I am also developing an iOS app, so I understand your problem.
The application doesn't get resized.
The buttons/labels won't be put wherever they should be as Xcode doesn't know where to put them. This is because the screen size varies with each device.
You should use constraints (really good tutorial) to put your buttons/labels wherever you want them to be. Another good tutorial
It's not automatic. You need to design your app to handle layouts on different devices. It's a rather complex subject. You'll need to learn about AutoLayout and size classes, among other topics. If your app isn't handling this correctly, it's not ready for the app store.
Firstly check your application is universal application .
Then You need to look at your Auto Layout constraints inside your storyboard.
Understanding Auto Layout

How do you build apps for all iOS devices?

I have an app that is nearing completion. However, I don't know how to finish it so it will look good on all iOS devices. It's a portrait only app, and it is the same on all devices (bigger screens don't show anything extra or different from smaller devices).
How do I make constraints that will work on all devices? I know there are different size classes that Xcode has, but it seems tedious to go to each class and add specific constraints.
You should use Autolayout for all resizing of your UI. But if you still want to go with this, I found this thread What setting determines whether an app gets scaled for iPhone 6 and 6plus?
Again, try to use Autolayout, add constraints its very easy. If you wish to change your mind go through the tutorial and add constraints https://www.raywenderlich.com/115440/auto-layout-tutorial-in-ios-9-part-1-getting-started-2

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)

Resources