I’m attempting to learn Swift/SwiftUI and have written a small test app to learn some techniques. I have a couple of Swift functions that are called back to back in the Action of a button that could take some time to complete as they import over 4,000 files that contain binary data.
I would like to change the cursor to display the system ‘busy’ cursor while the functions run. I’ve spent several hours looking for solutions but have not found any solutions such as looking at all the cursor types that are in NSCursor.
Here’s a code snippet from a view. BTW the variable images do not refer to formatted images such as PNG.
Button(action: { // this could take a little time.
NSCursor.closedHand.push() // Want 'busy' or 'wait' cursor here
images = getImageList(folder)
importImages(images)
NSCursor.pop()
}) {
Text("Import Images")
}