0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【SwiftUI】アプリ情報ウインドウを作成する

Last updated at Posted at 2023-02-20

はじめに

macOSアプリを使っていると「〇〇について」みたいなボタンで以下のようなウインドウが表示される機能がよくあります。
スクリーンショット 2023-02-20 21.00.15.jpg
やり方が気になったので調べてみました。

実装方法

Button {
    NSApplication.shared.orderFrontStandardAboutPanel(
        options: [NSApplication.AboutPanelOptionKey(rawValue: "Copyright"): "© 2023 Taishin Miyamoto"]
    )
} label: {
    Text("\(Image(systemName: "gearshape"))")
}

おわり

今回記載した実装コードは最低限のコードです。
他にも色々なカスタマイズができるっぽいので気になる方は試してみてください!

参考記事

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?