NEW: Learn to build amazing SwiftUI apps for macOS with my new book! >>

Running Simulator makes the resolution and window size look like an old iOS. How do I fix this?

Forums > SwiftUI

Hi Everyone,

I have no idea why this has happened (though it's obviously my fault), but whenever I run my app in simulator mode, it looks like an old iOS phone. It doesn't look like an iPhone 12 or anything more current. When I set the simulator it's iPhone 12.

I'm pretty sure this is an easy fix, but I can't figure it out. What have I broke? And how do I fix it?

This is what I'm talking about: https://i.imgur.com/yinfyk7.png So that even though I've set my simulator to iPhone 12, it looks really old.

Any thoughs?

Thanks gang!

1      

I recognized this yesterday on my installation as well. But it did work before. I didn't change anything, so perhaps it's a bug in Xcode.

1      

Go to (I think sorry do not have my Mac with me) Windows>Devices and Simulator then delete the incorrect ones and then Add New Simulator with which every iPhone and iOS version you want.

1      

I think its due to splash screen. if we havent set splash then it shrink all screen. this is one of the scenario. other we have to check configuration of project. check your info.plist into swiftui project And in UIkit is launch.storyboard.

Add this code into plist for SwiftUI if you dont have:

<dict>
    <key>UILaunchScreen</key>
    <dict/>
</dict>

@tylerlw82

1      

Hi everyone,

Thanks for the replies. I should have been more clear. This is a project done in swiftUI.

I'll try these out and report back!

Cheers.

1      

Did you create the project in Xcode 13? This would mean that it doesn't have an Info.plist file by default and it generates one while building. If you modify entries in the projects "General" and "Info" section (which normally reside in the Info.plist file), it will create an Info.plist file with just your custom amendments. All the basic setup (from "General") will still be enriched in the file by the build & package process depending on the project configuration in the "General", "Info" and "Build Settings" tab.

If you delete for example the "Build Setting" "Launch Screen (Generation)" you will end-up in an invalid setup showing exactly the sympoms you've shown in your screenshot (and mentionned by @vishalkalola1 above). You can simply set the value back to "Yes" and then it should work again.

1      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Spend less time managing in-app purchase infrastructure so you can focus on building your app. RevenueCat gives everything you need to easily implement, manage, and analyze in-app purchases and subscriptions without managing servers or writing backend code.

Get Started

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.