Was it a bug later? Feedback Not Found
I had the same problem now.
I submitted this as a bug - https://feedbackassistant.apple.com/feedback/8907308
Post
Replies
Boosts
Views
Activity
i found the reason:
ForEach is asynchronous!
swift
Button("Open...") {
NSDocumentController.shared.openDocument(nil)
}.keyboardShortcut("O", modifiers: .command)
MenuButton("Open Recent") {
let recents = NSDocumentController.shared.recentDocumentURLs
if recents.count 0 {
ForEach(recents, id: \.self) { url in
Button(url.lastPathComponent) {
home.open(url: url, force: true)
}
}
}
Divider()
Button("Clear Menu") {
NSDocumentController.shared.clearRecentDocuments(nil)
}
}
Button("Open Quickly...") {
}.keyboardShortcut("O", modifiers: [.command,.shift])