Xcode 12.0 beta points out the following code with a warning:
let toolPiker = PKToolPicker.shared(for: UIApplication.mainWindow)
// warning: 'shared(for:)' was deprecated in iOS 14.0: Create individual instances instead.
And I tried to use the following code, but the view display without any toolPicker
let toolPiker = PKToolPicker()
Post
Replies
Boosts
Views
Activity
MacOS: Version 11.0 Beta (20A4300b)
Xcode: Version 12.0 beta 2 (12A6163b)
The following code works on the MacOS Target with menu within menu bar, but no shortcut discoverability HUD on iPadOS Target when user hold down the Command key
import SwiftUI
@main
struct SwiftUIHubApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
.commands {
CommandMenu("Shape") {
Button("New Shape") {
print("New Shape")
}
.keyboardShortcut("S", modifiers: [.command, .shift, .control])
}
}
}
}