Skip to content

Instantly share code, notes, and snippets.

@kosso
Created October 6, 2012 20:27
Show Gist options
  • Save kosso/3846020 to your computer and use it in GitHub Desktop.
Save kosso/3846020 to your computer and use it in GitHub Desktop.
Titanium hack : add insetcomplete event to setContentInsets - edit to TiUITableView.m
-(void)setContentInsets_:(id)value withObject:(id)props
{
UIEdgeInsets insets = [TiUtils contentInsets:value];
BOOL animated = [TiUtils boolValue:@"animated" properties:props def:NO];
void (^setInset)(void) = ^{
[tableview setContentInset:insets];
};
if (animated) {
double duration = [TiUtils doubleValue:@"duration" properties:props def:300]/1000;
[UIView animateWithDuration:duration animations:setInset completion:^(BOOL finished){
// NSLog(@"Done!");
[self.proxy fireEvent:@"insetcomplete" withObject:nil];
}];
}
else {
setInset();
[self.proxy fireEvent:@"insetcomplete" withObject:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment