36

My iOS Swift 5 (Xcode 14.1) app is humming along. After the last Xcode update, I noticed that when I push a particular view controller with a table view inside a stack, inside a navigation controller, I get the following warning:

[SystemGestureGate] <0x102210320> Gesture: System gesture gate timed out

When I swipe back to pop the troubled view controller, it acts erratically, and sometimes pops just fine. By "erratic", I mean sometimes it partially displays the destination view controller, sometimes freezes in the middle of the swipe for a second or two, etc. When I try to push again into the troubled view controller (after the warning occurs), it freezes the app.

The view controller, stack, table, and cells do NOT have a custom gesture recognizer.

I have not seen this warning anywhere else on the app (including view controllers with stacks, and tables).

My questions are:

  1. What is "SystemGestureGate: System gesture gate timed out"? I did not find substantive information online on this error.
  2. What are the condition(s) that would yield such a warning?

I suspect there is something wrong with the table I'm using and am investigating further.

Some troubleshooting steps I took:

  • When I remove the table completely, the warning and behavior goes away.
  • When I remove the table partially (a section or two), the warning and behavior randomly occurs (I couldn't find a pattern).
  • I placed breakpoints and noticed that the error occurs after viewWillAppear, but before viewDidAppear.

I am expecting that the view controller will pop by swiping in the same fashion as all the other view controllers in a navigation controller.

TylerP
  • 9,600
  • 4
  • 39
  • 43
flyer
  • 371
  • 1
  • 3
  • 6

1 Answers1

16

I ran into the same error today. It seems to occur upon long-pressing a button (or maybe any gesture-handling element) near the bottom of the screen.

Here's a dumb view I tested with:

struct vertButtons: View {
  @State var i = 0
  func action() {i=(i+1)%10}
  var body: some View {
    VStack {
        Text(String(i))
            .font(.title)
        Spacer()
        Button(action: {action()}) {
            Text("Good Button") // This one is fine
                .font(.title)
        }
        Spacer()
        Button(action: {action()}) {
            Text("Good Button") // This one is fine
                .font(.title)
        }
        Spacer()
        Button(action: {action()}) {
            Text("Good Button") // This one is fine
                .font(.title)
        }
        Spacer()
        Button(action: {action()}) {
            Text("\"Bad\" Button") // Long-press produces "gesture gate timeout"
                .font(.title)
        }
    }
  }
}

Long-pressing the "Bad" button produces the error ("Gesture: System gesture gate timed out") while doing the same with any of the "Good" buttons does not. The counter text is there to demonstrate that the error message does not interfere with the button action being executed upon release of the long press.

My best guess is that iOS includes or included some feature (the "system gesture gate") designed to prevent interference between app gesture handling and special system gestures in the bottom part of the screen, and that a recent iOS update introduced a bug in that feature that's causing it to time out instead of doing what it's supposed to do.

The error had no effect on expected functionality in either this test view or my actual app, so I wonder if your woes have some other cause.

I wish I could give a more authoritative answer, but hope this was helpful. Will caveat that I'm very new to Swift and SwiftUI.

chvolow24
  • 173
  • 6
  • Good observation. A long press near the bottom of any storyboard or SwiftUI screen triggers the message in the apps I tested. Strange. – Marcy Feb 06 '23 at 06:22
  • 1
    I think it has more to do with clipping. I'm seeing it occur under other circumstances (tap gesture added to view much higher in screen). I notice the UILabel containing can't derive an intrinsic size from the given constraints. It's as though by one internal event flow in iOS the gesture is detected, but due to frame or autolayout the event can't be chased far through view traversal enough to complete. – clearlight Mar 29 '23 at 10:03