Post

Replies

Boosts

Views

Activity

Reply to Must a custom UIInputView be assigned directly to the UIInputViewController.inputView or can it be a subview?
I found that the answer is "yes": your custom UIInputView object should be assigned directly to your custom UIInputViewController.inputView property. Make sure that your custom UIInputView has translatesAutoresizingMaskIntoConstraints == YES. iOS will automatically size the keyboard area (ie, .inputView) as the device rotates, etc. You can create a UILayoutGuide and add it to your custom UIInputView (with constraints to each edge), then have all of the subviews setup constraints to the layout guide. I'll also note that assigning my custom UIInputView directly to .inputView also made this warning go away: -[UIInputViewController needsInputModeSwitchKey] was called before a connection was established to the host application. This will produce an inaccurate result. Please make sure to call this after your primary view controller has been initialized. I hope this helps someone.
Topic: UI Frameworks SubTopic: UIKit
Apr ’25