iOS17 UITextView inputView becomFirstResponder does not work

Simplely, when we set UITextView.inputView and then call becomeFirstResponder, but the custom inputView could not show expectedly just like before. We test this code in iOS17 and below, while only iOS17 does not work.

And xcode console print these logs:

Failed to retrieve snapshot. -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID Unsupported action selector setShiftStatesNeededInDestination:autoShifted:shiftLocked: Unsupported action selector setShiftStatesNeededInDestination:autoShifted:shiftLocked: Unsupported action selector setShiftStatesNeededInDestination:autoShifted:shiftLocked: Unsupported action selector setShiftStatesNeededInDestination:autoShifted:shiftLocked:

Post not yet marked as solved Up vote post of MatchBoxy Down vote post of MatchBoxy
25k views
  • UIView *cv = [[UIView alloc] initWithFrame:CGRectMake(0, 0, _customKBView.frame.size.width, _customKBView.frame.size.height)]; cv.backgroundColor = [UIColor blueColor]; [cv addSubview:_customKBView];

    _fakeTxtView.inputView = cv; [_fakeTxtView becomeFirstResponder];

Add a Comment

Replies

We have the same issue. Looping of [RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID

  • Same here -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID

Add a Comment

I have the same issue.

I am not sure if it's what's causing of my screens that has couple of textFields to jump down the screen...

  • We have the same issue. Anyone got resolution for this?

Add a Comment

Same here. Also getting issues that inputAccessoryView is not showing correctly for iOS 17

  • Update Xcode!

  • Updating Xcode doesn't help. Getting same issue with Xcode 15 beta 4

Add a Comment

I have the same situation

I had the log message in the iPhone simulator running iOS 17 until I upgraded to Ventura 13.5 (22G74) just now, still using XCode Version 14.3.1 (14E300c). My custom keyboard (in-app; not system wide keyboard) was is behaving erratically (disappearing, after a few taps in the app, and the message~~

-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID

would appears in the logs).

Now, after the upgrade (Ventura 13.5 (22G74) just now, still using XCode Version 14.3.1), I've been trying to replicate the problem, but so far it does not occur anymore...

I take it back: it's indeterministic: a few recompiles later the issue is still here.

same issue and I'm on Xcode 15 beta 7. ****. Hope they fix this.

-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID

update ios 17 beta 8 is ok

  • Beta 8 same issue

  • Beta 8 same issue. TextField and MapKit in SwiftUI is complete headache! This is 5th year of the SwiftUI...

Add a Comment

Beta 8 same issue here!

Same issue here... I really hope they will find a solution otherwise the banking app where I'm working on will have some serious problems... The textfiled does not become firstResponder.

  • Has there been any update to this. Just started seeing this issue.

Add a Comment

I noticed UITextFields don't always deinit when closing its VC (or using removeFromSuperview()), but only if it has become first responder at least once.

Actually, if you have a VC with multiple UITextFields, let one become first responder, then close the VC, ALL UITextFields won't deinit! Then if you activate another UITextField in another VC they will deinit after all. I believe it happens more often when textContentType isn't nil.

To check yourself just subclass UITextField and check the deinit calls in the console:

class TestTextField: UITextField {   
    deinit {
        print("deinitted textfield \(self.placeholder ?? "") \(self.text ?? "")")
    }
}

  • The reason I'm mentioning this is because I'm getting the same errors as you guys so I'm think it's related. Can you guys check if your TextFields get properly deinnited in iOS 17?

Add a Comment

I am also getting this issue after the update that came with he release of iOS17, Has anyone had success in the search for the cause?

The warning seen in the console occurs the exacty mooment I click insite of the TextField that you can see in the Image on the right.

Typing in the text field continues to through addition warnings although different to the original.

Same issue for me

Same issue here with iOS 17.

I try to work with .searchable modifier, the first tap is laggy, and after that, every tap will trigger de warning :

-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID

+1

-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID

Facing same issue in production from users who updated to iOS 17, running with Xcode 15 also same issue. We are using wkwebview and js textfield, its crashing with below stack trace

  • Hi Team

    I am also facing same issue with ipad in cordova app .

    error : -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID

    keyboard is not showing on click of textfield.

    please give some workaround

Add a Comment