0

I am using the IQKeyboardManagerSwift latest version I am having issue black screen at bottom --> When I tap on text field in landscape mode of device keyboard comes up and view of controller and background image goes up black screen of window can be seen at bottom View does not come back to original position after keyboard dismiss.

I want to move container view of the text field up, not the view of the controller and background image, the container view is horizontally and vertically center in auto layout. I tried to add IQLayoutGuideConstraint to container view but no luck. it would be great if you can provide some information to achieve it. please seen storyboard screenshot below

StoryBoard Image

Device Image1

Device Image2 Device Image3

Anupam
  • 555
  • 1
  • 5
  • 14

4 Answers4

1

try to remove your firstResponder from viewDidLoad, and put it in viewDidAppear instead, like this

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(true)


    yourTextField.becomeFirstResponder()
}
sarah
  • 3,819
  • 4
  • 38
  • 80
0

P.S. Do not set your textfield as firstResponder in your viewController.

For ex:- (in ViewDidLoad Method)

[self.yourTextField becomeFirstResponder];

If you have above set up. Please comment(Delete) this line and then try.

All the best.

iHarshil
  • 739
  • 10
  • 22
0

Have you tried to update your pods?

pod IQKeyboardManagerSwift 
0

workround, place in your VC viewillappear:

 override func viewWillAppear(_ animated: Bool) {
    if let window = (UIApplication.shared.delegate?.window)! as UIWindow? {
        window.backgroundColor = UIColor.white
    }
}
Omar N Shamali
  • 503
  • 5
  • 11