kentron / IKKeyboardAttendant

Keep your cells visible in a nice way despite keyboard's visibility on screen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IKCellAttendant

Keep your cells visible in a nice way despite keyboard's visibility on screen.

Contact Us

For questions or general comments regarding the use of this library, please use our public hipchat room.

If you find any bugs or have a problem while using this library, please open an issue in this repo (or a pull request :)).

And you can check all of our open-source projects at inaka.github.io

Overview

Tired of having to add all that keyboard-notification-related boilerplate code into your UIViewController class in order to just keep your UITableViewCells always visible? IKCellAttendant will do all that boring job for you in a nice way, keeping your UIViewController's code cleaner.

Setup

You can quickly integrate IKCellAttendant into your project via CocoaPods.

Usage

Initialization:

- (id)initWithViewController:(UIViewController *)viewController tableView:(UITableView *)tableView;

Use this initializer to pass in the arguments that are required to properly setup your IKCellAttendant instance.

  • viewController: The UIViewController instance where your table view and cells are located.

  • tableView: The UITableView element that holds the cells you want to keep visible.

Updating:

@property (strong, nonatomic) UITableViewCell *visibleCell;

  • visibleCell: Use this property to set the current cell that you want to keep always visible on the screen despite keyboard's visibility.

Example

In SomeViewController.m

@interface SomeViewController ()

@property (strong, nonatomic) IKCellAttendant *attendant;

@end

@implementation SomeViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.attendant = [[IKCellAttendant alloc] initWithViewController:self tableView:self.tableView];
}

- (void)cellTextViewDidBecomeFirstResponder:(UITableViewCell *)cell
{
    self.attendant.visibleCell = cell;	// Update the current cell you want to be visible.
}

About

Keep your cells visible in a nice way despite keyboard's visibility on screen

License:Apache License 2.0


Languages

Language:Objective-C 100.0%