I have UIViewone that I would like to move up / down, appears or disappears UIKeyboard. Unfortunately, I cannot get it to work. Before AutoLayoutit was not easy, but since AutoLayoutI have some problems with this.
Here is what I still have:
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillHide:)
name:UIKeyboardWillHideNotification object:nil];
self.keyboardIsShown = NO;
}
-(void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIKeyboardWillHideNotification
object:nil];
}
-(void)keyboardWillShow:(NSNotification*)notification{
if (self.keyboardIsShown) {
return;
}
self.keyboardIsShown = YES;
}
-(void)keyboardWillHide:(NSNotification*)notification{
self.keyboardIsShown = NO;
}
Of course, the methods are called, but I need some guidance on changing my y-position UIView. Simply changing the y position of the frame does not work at all.
Here you can find my interface setup with the restrictions that I added in the UIView.

Therefore, all components, except UIImageView, are contained in loginView Outlet. This is a view that I would like to move up or down depending on the keyboard, displayed or not.
, , , UIImageView , .