Hi,
Got my app rejected because the help menu (top barr) has no link.
How to add it from a Macacatlyst App?
Thanks
Hi,
Got my app rejected because the help menu (top barr) has no link.
How to add it from a Macacatlyst App?
Thanks
When you create an app, you have a help menu.
-> Do you see it in menuBar ?
This menu has an item 'MyApp Help' with a '?' shortcut
-> Do you see it ?
This item should be connected to a defaut system action showMenu
-> Is it the case ?
Otherwise, control-drag from the menu to the First responder (second orange cube icon atop of the menu bar in IB)
Select showHelp in the list.
There's a sample app in there, but here's are some snippets of the code I wrote.The Mac version of your app comes with a standard menu bar. Customize it by adding and removing menu items using UIMenuBuilder.
Code Block swift #if targetEnvironment(macCatalyst) override func buildMenu(with builder: UIMenuBuilder) { if builder.system == .main { builder.remove(menu: .edit) builder.remove(menu: .file) builder.remove(menu: .format) } } #endif
Code Block swift override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool { print(action) return true }
Code Block swift @objc func showHelp(_ sender: Any?) { openLocalizedURL("helpURL") }
Code Block swift func openLocalizedURL(_ key: String) { /* e.g. "http://mywebsite/spanish.html" */ let localized = NSLocalizedString(key, comment: "link to localized URL") guard let url = URL(string: localized) else { NSLog("Bad URL: \(localized) (key: \(key))") return } if #available(iOS 10.0, *) { UIApplication.shared.open(url, options: [:]) { success in if (!success) { NSLog("Failed to open URL: \(localized)") } } } else { UIApplication.shared.openURL(url) } }