# Keyboard covers view

**URL:** <https://forums.kodeco.com/t/keyboard-covers-view/20571>\
**Category:** iOS\
**Created:** [October 1, 2016, 11:02am UTC](https://forums.kodeco.com/t/keyboard-covers-view/20571 "2016-10-01T11:02:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brower](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/brower/32/102075_2.png) [@brower](https://forums.kodeco.com/u/brower)\
**Post date:** [October 1, 2016, 11:02am UTC](https://forums.kodeco.com/t/keyboard-covers-view/20571/1 "2016-10-01T11:02:37Z")

</div>

I have a text view at the bottom of the view controller. When the text view becomes first responder, the keyboard appears, but it covers the text view. How do I make the text view visible?

---

<div class="post-metadata">

**Author:** ![vimipatel](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/vimipatel/32/83106_2.png) [@vimipatel](https://forums.kodeco.com/u/vimipatel)\
**Post date:** [October 3, 2016, 5:45am UTC](https://forums.kodeco.com/t/keyboard-covers-view/20571/2 "2016-10-03T05:45:41Z")

</div>

You can set frame of set content offset by setting y origin.

```
#pragma mark - Textview delegate

- (void)textViewDidBeginEditing:(UITextView *)textView
{
    [UIView animateWithDuration:0.3 animations:^{
    
        //Either set content offset or frame
        //textView.frame = CGRectMake(textView.frame.origin.x, originY, textView.frame.size.width, textView.frame.size.height);
        textView.contentOffset = CGPointMake(textView.frame.origin.x, originY);
    
    } completion:^(BOOL finished) {
    
    }];
}

```

And finally, when you resign first responder, then again reset it to the original position.

---

<div class="post-metadata">

**Author:** ![magfurulabeer](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@magfurulabeer](https://forums.kodeco.com/u/magfurulabeer)\
**Post date:** [October 5, 2016, 11:52pm UTC](https://forums.kodeco.com/t/keyboard-covers-view/20571/4 "2016-10-05T23:52:43Z")

</div>

Also, you can try moving your view up whenever the keyboard showing notification is posted.

```
NotificationCenter.default.addObserver(self,
                                    selector: #selector(self.moveViewUp(notification:)),
                                    name: NSNotification.Name.UIKeyboardWillShow,
                                    object: nil)

func moveViewUp(notification: NSNotification) {
    let userInfo = notification.userInfo
    let keyboardSize = userInfo![UIKeyboardFrameEndUserInfoKey] as! NSValue
    let keyboardHeight = keyboardSize.cgRectValue.height
}

```

And of course, you just bring the view back down when the opposite notification (UIKeyboardWillShow) is posted.
