title: How can I implement a simple long press gesture using SwiftUI on an Apple Watch?
body: <p>I've been playing around a bit and while this code works in iOs it won't work on WatchOS</p>
  <pre class="lang-swift prettyprint-override"><code>import SwiftUI
  
  struct ContentView: View {
      var body: some View {
          Text(&quot;Hello, World!&quot;)
              .onTapGesture {
                  print(&quot;tapped!&quot;)
          }
          .onLongPressGesture {
              print(&quot;Long pressed!&quot;)
          }
      }
  }
  </code></pre>
  <p>When I say it &quot;doesn't work&quot; I mean doing the long press on an Apple Watch doesn't run the code within the closure block.</p>
  <p>I'm thinking maybe <code>.onLongPressGesture</code> shouldn't be used with an Apple Watch, and there is some other method, but I can't figure out what it is (my understanding is force touch is being done away with in WatchOS 7.0).</p>
  <hr />
  <p>edit: This is the actual code that's not working (it has a lot of methods attached to it, so it's hard to troubleshoot)</p>
  <pre class="lang-swift prettyprint-override"><code>    var body: some View {
          Start()
              .background(NavigationLink(destination: RunSelector(), isActive: self.$showRunSelectorList) {EmptyView()})
              .background(NavigationLink(destination: RunningTimer(myIntervals: allIntervals.week1d1), isActive: self.$showRunningTimer) {EmptyView()})
              .buttonStyle(PlainButtonStyle())
              .onTapGesture {
                  self.showRunningTimer = true
          }
          .onLongPressGesture {
              print(&quot;Long pressed!&quot;)
              self.showRunSelectorList = true
          }
          .focusable(true)
          .digitalCrownRotation(self.$crownValue, from: 0.1, through: 5.0, sensitivity: .low, isContinuous: false, isHapticFeedbackEnabled: true)
          .onAppear() {
              HealthKitSetupAssistant.authorizeHealthKit { (authorized, error) in
                  guard authorized else {
                      let baseMessage = &quot;HealthKit Authorization Failed&quot;
                      if let error = error {
                          print(&quot;\(baseMessage). Reason: \(error.localizedDescription)&quot;)
                      } else {
                          print(baseMessage)
                      }
                      return
                  }
                  
                  print(&quot;HealthKit Successfully Authorized.&quot;)
              }
          }.onReceive(Just(self.crownValue)) { output in
              if self.crownValue &gt; 0.1 {
                  self.showRunSelectorList = true
                  self.crownValue = 0.0
              } else {
                  print(&quot;The value is \(self.crownValue)&quot;)
              }
          }
      }
  }
  </code></pre>