Post

Replies

Boosts

Views

Activity

Reply to SwiftData and command line
I'm not sure how to use CREATE_INFOPLIST_SECTION_IN_BINARY with SPM, but I've found that adding linkerSettings to the Platform.swift file works well. linkerSettings: [ .unsafeFlags([ "-Xlinker", "-sectcreate", "-Xlinker", "__TEXT", "-Xlinker", "__info_plist", "-Xlinker", "Sources/Builder/Info.plist", ]) ]
Nov ’23
Reply to SwiftData crashes the app
Add special linker settings to reference Info.plist and define that file. targets: [ .executableTarget( name: "MyProgram", dependencies: [], linkerSettings: [ .unsafeFlags([ "-Xlinker", "-sectcreate", "-Xlinker", "__TEXT", "-Xlinker", "__info_plist", "-Xlinker", "Sources/Resources/Info.plist" ]) ] ), ]
Nov ’23
Reply to Passkey against local server with self-signed certificate
The documentation is far less helpful than one would like. Here's what I've found to work so far. The apple-app-site-association file must reside on a publicly accessible web server with a valid TLS certificate. (see https://jaanus.com/universal-links/). I specified 'web credentials:mydomain.com?mode=developer' in Associated Domains in the Signing & Capabilities tab in Xcode. On the iOS device, enable Associated Domains for development. This is found under Settings > Developer > Universal Links: Associated Domains Development On the Apple Developer website, I have added an identifier for my application with 'Associated Domains' enabled to the Certificates, Identifiers & Profiles list of identifiers.
Nov ’22
Reply to What does @main generate for SwiftUI.
I had a similar question. I've since concluded that my mental model for SwiftUI application development needed to change. I now create a @StateObject in my @main struct / class. The initializer for this class performs any safe and quick initialization and then dispatches the remaining tasks to a background thread. The object will then publish (see Combine) a completion result. I subscribe to the object in a later view and deal with any failures there. Essentially, initialization should be though of as a piece of data in the application data model. The application proceeds with creating views and, possibly, interacting with the user until that information is needed. At that point, a progress bar or spinner may be necessary until it is available. Then either present the error to the user, kick off a fallback, or proceed with the application as appropriate.
Jun ’20