Post

Replies

Boosts

Views

Activity

Reply to Disable automatic InfoPlist.xcstrings generation
Hi, Thank you for you response! I've followed your instructions and I've created a xcstrings file per each Info.plist file that I use. Now, for example, I've created Info-dev-InfoPlist.xcstrings, which works as intended and picks up the content of my Info-dev.plist file and let's me localise every purpose string as well as the name of the app. The problem now is that the app is not showing the correct language when showing the purpose string. If I change the language of the device to Spanish (as well as the language for the app) I still see the purpose strings in English, which was the language I wrote them initially in the plist file. Am I missing something? Is there any configuration that I should modify so that the language is correctly picked up by the device when showing the purpose strings? Thank you in advance.
Jul ’24
Reply to Migrating SwiftUI lifecycle to UIKit's
Thank you both @Claude31 and @DTS Engineer for the quick response. This is how my Info.plist file is looking right now" I am not using Storyboards, so I am not including the Storyboard name property. Also, the schema/target that I am running has a name like my_app-stg, for what I've seen, $(PRODUCT_MODULE_NAME).SceneDelegateproduces the value my_app_stg.SceneDelegate which, for what I've tested, does not exist, whereas my_app-stg.SceneDelegate does exist. Because of this I am relying on the AppDelegate to create the proper configuration this is why I do the following in the application(application:connectingSceneSession:options): func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { let configuration = UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) configuration.delegateClass = SceneDelegate.self return configuration } This indeed allows me to set the correct SceneDelegate for my app, but as this method is not called, the SceneDelegate cannot be set correctly. I've also tried to replace $(PRODUCT_MODULE_NAME).SceneDelegate by my_app-stg.SceneDelegate to not avail.
Aug ’24
Reply to Migrating SwiftUI lifecycle to UIKit's
After a lot of debugging and messing with the existing code, I've found a way to circumvent the problem. It seems like using the SwiftUI lifecycle and attaching the SceneDelegate does work. At least partially, because right now I am using an EmptyView as the root of my app in SwiftUI even though I then initialise the app in the SceneDelegate correctly. This allows me to partially use the UIKit lifecycle, but I cannot abandon SwiftUI's lifecycle completely. I like the solution if it can be used as a partial update for the app that should be followed by another update that really uses only UIKit's lifecycle. When I check the UIApplication object in the AppDelegate, I see that it has an openSession already configured, and I've seen that it has a AppSceneDelegate associated (which presumably is created by SwiftUI). Now, my question is, is there a way to remove this opened session? It will be great as a final update for my app, because having a hybrid SwiftUI-UIKit's lifecycle is a solution I don't really love right now.
Sep ’24
Reply to Migrating SwiftUI lifecycle to UIKit's
After messing around with it I've found the problem and how to fix it. The problem was that there's an option in the Build Settings of Xcode called Application Scene Manifest (Generation) by default when the project is created with SwiftUI (I don't know about UIKit) this option is set to YES. This configuration seems to override whatever values you set in your Info.plist regarding the Scene Configuration, thus leaving the app with a black screen with no content. The solution wat setting that configuration to NO and, magically, the screen appeared correctly on my device. As I've not seen anything related to this setting anywhere on the internet, I'll mark this post as the answer in hopes that anyone fighting with this behaviour can find this post and, maybe, make their lives easier.
Sep ’24