yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
6.88k stars 809 forks source link

Strange behavior of SwiftUI App #1458

Closed rsarv3006 closed 2 months ago

rsarv3006 commented 3 months ago

I created an empty SwiftUI project and updated the Content View so that it appears like so:

image

I then added my excodegen project file:

name: TestThing options: bundleIdPrefix: rjs.app.dev.TestThing targets: TestThing: type: application platform: iOS deploymentTarget: "17.2" sources: [TestThing] info: path: TestThing/Info.plist

And now the view appears as:

image

No other code has changed. I went through the docs and tried to see if there was anything specific to SwiftUI but I did not find anything.

I created a project reproducing the issue and an MR with the diff.

https://github.com/rsarv3006/TestThing/pull/1/files

I'm guessing I'm just missing something obvious but would appreciate any and all input. Thank you!

yonaskolb commented 2 months ago

This may be launch screen related. Try either of the following 2 info plist settings

UILaunchScreen_Generation: YES
UILaunchStoryboardName: LaunchScreen

Let me know how you go

kovs705 commented 2 months ago

I got the same thing, I fixed it that way, but I think @yonaskolb recommendation is better

...
    path: App/Info.plist
    info:
      path: YourProjectName/Info.plist
      properties:
        UILaunchScreen:
          UIColor: UIColor.black  #you can change to image as well

based on @yonaskolb answer:

...
    path: App/Info.plist
    info:
      path: YourProjectName/Info.plist
      properties:
        UILaunchScreen_Generation: YES
        UILaunchStoryboardName: LaunchScreen