Hi.
I know that UIApplication#keyWindow is deprecated since iOS/iPadOS 13.0.
But now (iOS/iPadOS 16.5), UIWindow#isKeyWindow and didBecomeKeyNotification seem deprecated, too.
isKeyWindow is always true and didBecomeKeyNotification is never triggered.
Is my understanding right?
And if so, since what version of iOS/iPadOS are they deprecated?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi.
I implemented a broadcast upload extension and it requests local notifications.
The local notification works normally on broadcastStarted(withSetupInfo:), but the Banner of the local notification does not work on processSampleBuffer(_: with:) though its Notification Center works normally.
What am I missing?
Here is my code snippets.
container app
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
requestAuthorization()
...
}
private func requestAuthorization() {
let center = UNUserNotificationCenter.current()
center.requestAuthorization(options: [.alert]) { granted, error in
if let error = error {
// Handle the error here.
print(error)
}
if granted == true {
center.delegate = self
center.getNotificationSettings(completionHandler: { setting in
print(setting)
})
}
else {
print("not permitted")
}
}
}
}
upload extension
class SampleHandler: RPBroadcastSampleHandler {
override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) {
super.broadcastStarted(withSetupInfo: setupInfo)
notification(title: "Upload Extension", body: "broadcastStarted")
...
}
override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
super.processSampleBuffer(sampleBuffer, with: sampleBufferType)
...
if some condition {
notification(title: "Upload Extension", body: "processSampleBuffer")
}
}
private func notification(title: String, body: String) {
let content = UNMutableNotificationContent()
content.title = title
content.body = body
let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: nil)
let notificationCenter = UNUserNotificationCenter.current()
notificationCenter.add(request) { error in
if error != nil {
print(error)
}
}
}
}
Hi.
I want to implement the code below using vDSP.
for i in a.indices {
a[i] = n[i] == 0.0 ? 0.0 : b[i] / n[i]
}
This code is slow.
Are there any good implementation using Accelerate framework?