Posts

Post not yet marked as solved
1 Replies
872 Views
I'm creating a pure SwiftUI app. I wish to use a background task to keep my data up-to-date while in the background. I've found the BGTaskScheduler documentation (https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler). In the section titled Register, Schedule, and Run Tasks, the document states: During app startup, you register a launch handler, a small block of code that runs the task, and an associated unique identifier for each task. Register all of the tasks before the end of the app launch sequence. For more information, see About the App Launch Sequence. I know you can do this in application(_ :, didFinishLaunchingWithOptions:) method of the AppDelegate. However, in a pure SwiftUI app there is no AppDelegate. So, how do I register my background task in SwiftUI? If I can't, then how do a retrofit an AppDelegate into an already existing SwiftUI app? Thanks, Alan
Posted
by bb1999.
Last updated
.
Post not yet marked as solved
8 Replies
1.9k Views
I have an app which requires the user to have direct interaction with a view when VoiceOver is enabled. In iOS 12 and 13 my code worked as expected. However, in iOS 14, whenever the user tries to interact with the view requiring direct interaction, the view responds with the audible message: "Direct touch area. Use the rotor to enable direct touch for this app." This is a bit of an awkward user experience for a visually impaired user. The user now has to enable something which was working just fine in previous versions. In addition, anytime the user navigates away from the app and then returns, they must re-enable direct touch again. In my code I was able to enable direct interactions with the following code: view.isUserInteractionEnabled = true view.isAccessibilityElement = true view.accessibilityTraits = UIAccessibilityTraits.allowsDirectInteraction However, this no loner seems to be enough. How do I tell my app: "Yes, please use direct interaction all the time and don't bother the user?"
Posted
by bb1999.
Last updated
.