I started using the subscriptionID to ensure that I would not be creating duplicate subscriptions and this did not alleviate the issue either.
Post
Replies
Boosts
Views
Activity
I ended up getting the following to work on macOS using the .searchable() modifier (only tested on macOS 12.3):
import SwiftUI
@main
struct MyApp: App {
@State var searchText = ""
var items = ["Item 1", "Item 2", "Item 3"]
var searchResults: [String] {
if searchText.isEmpty {
return items
} else {
return items.filter { $0.contains(searchText) }
}
}
var body: some Scene {
WindowGroup {
List(self.searchResults, id: \.self) { item in
Text(item)
}.searchable(text: self.$searchText)
}.commands {
CommandMenu("Find") {
Button("Find") {
if let toolbar = NSApp.keyWindow?.toolbar,
let search = toolbar.items.first(where: { $0.itemIdentifier.rawValue == "com.apple.SwiftUI.search" }) as? NSSearchToolbarItem {
search.beginSearchInteraction()
}
}.keyboardShortcut("f", modifiers: .command)
}
}
}
}
Seeing this as well even in iOS 16.1 RC. Filed Feedback, but haven't heard back yet.
I've recently been having issues with creating CKQuerySubscriptions as well since Tuesday of last week. They are BAD_REQUEST errors saying that a subscription can not be created in the production container. I have not updated my subscription logic in months and this issue is preventing my users from receiving notifications about records.
It looks like it could be related to the patch Apple rolled out last week in relation to using NSPredicate: https://www.trellix.com/en-us/about/newsroom/stories/research/trellix-advanced-research-center-discovers-a-new-privilege-escalation-bug-class-on-macos-and-ios.html
The subscriptions I use that do NSPredicate(value: true) do not have an issue being saved to the database.
This issue seems to have cleared up earlier today around 2pm EST.
I was able to get around this issue by adding .allowsHitTesting(true) to the UIViewRepresentable view which in your case would be SwiftUIAttributionView.
Update: Never mind this did not work.