2
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】Textに長押しメニューを追加する

Posted at

はじめに

iOS15からTextに長押しできる機能が追加されてました。
意外と使えそうなので記録しておきます。

サンプル

スクリーンショット 2022-12-09 18.46.34.png

実装

import SwiftUI

struct ContentView: View {
    var body: some View {
        Text("テキスト")
+           .textSelection(.enabled)
    }
}

おわり

他にも良さそうな機能があったら記事にします

2
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
2
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?