I hereby claim:
- I am joaofranca on github.
- I am joaofranca (https://keybase.io/joaofranca) on keybase.
- I have a public key ASAWmAjYKAMVgys6SPkCc9Z327FAMQY0Xz3RSvMMyVX8wAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| - (void)layoutSubviews{ | |
| [super layoutSubviews]; | |
| [UIView beginAnimations:nil context:NULL]; | |
| [UIView setAnimationBeginsFromCurrentState:YES]; | |
| [UIView setAnimationDuration:0.0f]; | |
| for (UIView *subview in self.subviews) { |
| - (void)viewDidLoad{ | |
| [super viewDidLoad]; | |
| ... | |
| [table setDelegate:self]; | |
| [table setDataSource:self]; | |
| // enable editing mode |
| // cells are movable | |
| - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| return YES; | |
| } |
| // update datasource after moving | |
| - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { | |
| // you should correct the data source order here to reflect the row moving | |
| // it should be somethig like: | |
| NSString * tmp = [sourceArray objectAtIndex:fromIndexPath.row]; | |
| [sourceArray removeObjectAtIndex:fromIndexPath.row]; | |
| [sourceArray insertObject:tmp atIndex:toIndexPath.row]; |
| // make cells editable | |
| - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { | |
| return YES; | |
| } |
| // cell content view indentation | |
| - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| return NO; | |
| } |
| // editing style | |
| - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{ | |
| return UITableViewCellEditingStyleNone; | |
| } |
| - (void) keyboardWillHide:(NSNotification *)nsNotification { | |
| NSDictionary * userInfo = [nsNotification userInfo]; | |
| CGSize kbSize = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; | |
| CGRect newFrame = [tableframe]; | |
| CGFloat kHeight = kbSize.height; | |
| if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)){ |
| - (void) keyboardDidShow:(NSNotification *)nsNotification { | |
| NSDictionary * userInfo = [nsNotification userInfo]; | |
| CGSize kbSize = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; | |
| CGRect newFrame = [table frame]; | |
| CGFloat kHeight = kbSize.height; | |
| if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)){ |