Upgrade to Pro — share decks privately, control downloads, hide ads and more …

20211015 Mac CatalystでmacOS用アプリを作る

Kei Ito
October 15, 2021

20211015 Mac CatalystでmacOS用アプリを作る

Kei Ito

October 15, 2021
Tweet

More Decks by Kei Ito

Other Decks in Programming

Transcript

  1. 6*ύʔπ button.menu = UIMenu(title: "", options: .displayInline, children: [ UIAction(title:

    "item1", handler: { _ in }), UIAction(title: "item2", handler: { _ in }), UIAction(title: "item3", handler: { _ in }), UIAction(title: "item4", handler: { _ in }) ]) button.showsMenuAsPrimaryAction = true
  2. "QQ1MVHJOTXJGU import AppKit class AppKitPlugin: NSObject, Plugin { required override

    init() { } func doSomethingWithAppKit() { let bar = NSStatusBar.system statusItem = bar.statusItem(withLength: 100) statusItem?.button?.title = "..." } } "QQ,JUΛ࢖࣮ͬͨ૷
  3. 7JFX$POUSPMMFSTXJGU import UIKit class ViewController: UIViewController { func loadPlugin() {

    let bundleFileName = "AppKitPlugin.bundle" guard let bundleURL = Bundle.main.builtInPlugInsURL?.appendingPathComponent(bundleFileName), let bundle = Bundle(url: bundleURL) else { return } guard let pluginClass = bundle.principalClass as? Plugin.Type else { return } let plugin = pluginClass.init() plugin.doSomethingWithAppKit() } }