Post

Replies

Boosts

Views

Activity

Reply to Using a timer when the watch goes in sleep mode
For the count down, I used this code and it solves the problem perfectly. 				.onReceive(NotificationCenter.default.publisher(for: WKExtension.applicationWillResignActiveNotification)) { _ in 						print("Moving to the background") 						notificationDate = Date() 				} 				.onReceive(NotificationCenter.default.publisher(for: WKExtension.applicationDidBecomeActiveNotification)) { _ in 						print("Moving to the foreground") 						let deltaTime: Int = Int(Date().timeIntervalSince(notificationDate)) 						timeRemaining -= deltaTime 						percent += Double(deltaTime) / 1.2 				} But when the count down reaches 0, I need to provide a sort of Haptic Feedback to the user in order to tell him/her that the resting time is over. I have an issue when the watch is in sleep mode (wrist down). I am thinking on using User Notification for this purpose. I used a simple test notification with a 5 second timer. It works perfectly when I quit the app before the 5 sec countdown, but not when I stay in the app with a wrist down (to put the watch in sleep mode) How should I use local notification to work even if I stay in the app in sleep mode? I am not too familiar with the UserNotifications framework :( Thanks for your feedback
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’21
Reply to BERT-SQuAD: Question Answering not working anymore on iOS15.4
Thanks for the feedback. After checking the loadVocabulary() method, the Dictionary(uniqueKeysWithValues: zip(words, values) is never initialized and the thread runs forever. The 2 arguments -> word: [String.Subsequence] and value: Range<Int> seems correct after printing them. Thus, the issue might come from the Dictionary(uniqueKeysWithValues: ) initialization. I'll give a try to see how long it takes to build the dictionary. Alexis
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’22