michaeltyson / TPKeyboardAvoiding

A drop-in universal solution for moving text fields out of the way of the keyboard in iOS
http://atastypixel.com/blog/a-drop-in-universal-solution-for-moving-text-fields-out-of-the-way-of-the-keyboard/
zlib License
5.81k stars 924 forks source link

TPKeyboardAvoidingTableView: why not handling standard UITableView init method? #46

Closed odanu closed 11 years ago

odanu commented 11 years ago

Hi,

I have recently tried to instantiate TPKeyboardAvoidingTableView with standard UITableView init method - (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)style and found it was not working. After a short debug I found that the method is not implemented.

It's a easy one:)

michaeltyson commented 11 years ago

It's definitely implemented!

bishalg commented 11 years ago

@odanu : is your problem solved ? I use this code. Here I am drawing table view from code, and it works. In .m File

import "TPKeyboardAvoidingTableView.h"

@interface MyViewControllerTVC ()

@property (nonatomic, strong) UITableView *tableView;

@end .. ..

}

Then use regular table view delegates like

Done forget to do this in your .h file

@interface MyViewControllerTVC : UIViewController <UITableViewDataSource, UITableViewDelegate>

odanu commented 11 years ago

Sorry, I can't test it now, but I managed to get stuck in a moment of time, when I wanted to [[TPKeyboardAvoidingTableView alloc] initWithFrame:frame style:UITableViewStyleGrouped]; I don't even remember the problems which occured. It might be that the tableview did not scroll on keyboard appearance. Maybe because I don't use the last version of the classes. On the next use, I promise you to update the sources and test the case.