Skip to content

AdrianFlorian/AFKeyboardObserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AFKeyboardObserver

You know when you have to adjust your views whenever the UIKeyboard appears and have to write a lof of code which will only make your controllers more ugly?

Well, I've decided to build a very simple library to fix that for you.

Feature list

  • adjust view's Y coordinage as the keyboard appears/disappears
  • adjust the view's height as the keyboard appears/dissapears
  • do custom setup whenever the keyboard appears, disappears

##Install

Import AFKeyboardObserver and AFKeyboardObserverViewController to your project :

//subclass AFKeyboardObserverViewController
@interface ViewController : AFKeyboardObserverViewController

//implement the delegate methods - they're all optional

//adjusts the height of the views when the keyboard appears
-(NSArray *)viewsToAdjustHeight {
    return @[self.mainView];
}

//adjusts the Y position of the views when the keyboard appears
-(NSArray *)viewsToAdjustYPosition {
    return @[self.textField];
}

-(void)keyboardWillAppear {
    // do additional setup
}

-(void)keyboardWillDissapear {
    // do additional setup
}    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published