user8455870
user8455870

Reputation:

Swift keyboard problem on presented view controller

I am getting a problem with keyboard on presented view controller. I am presenting a bottom sheet from a controller. At this bottom sheet, I have a textView with becomeFirstResponder() delegate at viewDidLayoutSubViews(). But keyboard is pushing presented view controller like in picture. How can I present keyboard above presented view controller without pushing page ?

keyboard image

Upvotes: 0

Views: 438

Answers (1)

Aisultan Askarov
Aisultan Askarov

Reputation: 118

I had the same problem and fixed it using this code:

if #available(iOS 11.0, *) {
    tableview.contentInsetAdjustmentBehavior = .never
} else {
    automaticallyAdjustsScrollViewInsets = false
}

It does not let the inset of titleText/placeHolder be changed

Upvotes: 1

Related Questions