Capturing ‘async let’ variables is not supported
Discovered this strange error in Swift, when using the sample code from the proposal which is supposed to have been accepted and implemented
Discovered this strange error in Swift, when using the sample code from the proposal which is supposed to have been accepted and implemented
I needed to show an alert in an async context and this is how I achieved it: The idea to throw a cancellation exception was inspired by DDDevicePickerViewController which is the only built-in async UIViewController I’m aware of.
I wondered why NSPersistentStoreRemoteChange doesn’t contain any info about what process made the change. For example it isn’t possible to know if the change even was made by the current process or not. This would be useful so when you Read more
I came across this interesting Stack Overflow question How can I make a simple circular button in SwiftUI in macOS? It’s interesting because all of the proposed solutions required hard-coding a frame size. I decided to experiment with how to Read more
First visit the Apple Events web page and find the link to the stream you want to download, e.g. the link for the iPhone 14 event from September 2022 looks like this: Now you need to install the yt-dlp command Read more
Update 10/4/2024: It appears in Xcode 15.3 nothing special is required and can use await right next to the hello world print. TLDR: add @main and rename main.swift To create a command line tool in Xcode 14.3 that uses async/await Read more
Learning SwiftUI can be tricky because it has a very different design to previous UI frameworks. Many make the mistake of trying to apply old design patterns which are not really compatible because of SwiftUI’s use of value semantics and Read more
Seems to me some developers think that @MainActor means “always main thread” and has the same behaviour as DispatchQueue.main.async which I don’t think is try. For example, the code below outputs: Because the Database class is not marked as @MainActor Read more
I came across an interesting Stack Overflow question about how to support List selection of different types when using NavigationSplitView when in regular width, e.g. on iPad landscape. This problem doesn’t arise with NavigationStackView because multiple ForEach can simply iterate Read more
If you need to show multiple sheets in SwiftUI it is best to use the framework features to your advantage. Rather than try to abstract the problem into a generic coordinator object, which you then have to unbundle again to Read more