4

Maybe someone found the same bug on iOS 16

There's a strange keyboard issue on iOS 16 when pushing a new screen and trying to swipe back. The keyboard safe area is not updated when you return from the pushed screen.

Here example https://media.giphy.com/media/UaNesUynQ4O9fFBUUG/giphy.gif

var body: some View {
    NavigationView {
        ZStack {
            VStack {
                ScrollView {
                    ForEach(0..<40) { _ in
                        Color.red.frame(height: 30)
                    }
                }
                NavigationLink {
                    TextField("Text", text: .constant(""))
                } label: {
                    Text("Press me")
                }
            }
        }
    }
    .navigationViewStyle(.stack)
}

From XCode 14.1 I got error in logs

2022-11-02 10:33:00.540667+0200 SomeSUITestProj[22423:5008601] [LayoutConstraints] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. 
    Try this: 
        (1) look at each constraint and try to figure out which you don't expect; 
        (2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x283177f70 'accessoryView.bottom' _UIRemoteKeyboardPlaceholderView:0x151210eb0.bottom == _UIKBCompatInputView:0x15120d500.top   (active)>",
    "<NSLayoutConstraint:0x28310cd20 'assistantHeight' SystemInputAssistantView.height == 45   (active, names: SystemInputAssistantView:0x15120b840 )>",
    "<NSLayoutConstraint:0x283120a50 'assistantView.bottom' SystemInputAssistantView.bottom == _UIKBCompatInputView:0x15120d500.top   (active, names: SystemInputAssistantView:0x15120b840 )>",
    "<NSLayoutConstraint:0x2831219f0 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x151210eb0]-(0)-[SystemInputAssistantView]   (active, names: SystemInputAssistantView:0x15120b840 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x2831219f0 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x151210eb0]-(0)-[SystemInputAssistantView]   (active, names: SystemInputAssistantView:0x15120b840 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
Mixorok
  • 125
  • 9

0 Answers0