Skip to content

Commit

Permalink
Added another UITableViewDelegate method
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Silverman committed Apr 4, 2012
1 parent 6e31f9a commit cb738c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions UIKit/Classes/UITableView.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ extern NSString *const UITableViewIndexSearch;
- (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath;
- (void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath;
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath;

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath;
@end

@protocol UITableViewDataSource <NSObject>
Expand Down
2 changes: 2 additions & 0 deletions UIKit/Classes/UITableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ - (void)_layoutTableView
cell.backgroundColor = self.backgroundColor;
cell.editing = _editing;
[cell _setSeparatorStyle:_separatorStyle color:_separatorColor];
if ([_delegate respondsToSelector:@selector(tableView:willDisplayCell:forRowAtIndexPath:)])
[_delegate tableView:self willDisplayCell:cell forRowAtIndexPath:indexPath];
[self addSubview:cell];

if (dragSelection && indexPath.section == dragSelection.section && indexPath.row == dragSelection.row)
Expand Down
4 changes: 2 additions & 2 deletions UIKit/Classes/UIView.m
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,8 @@ - (void)_superviewSizeDidChangeFrom:(CGSize)oldSize to:(CGSize)newSize
}

if (hasAutoresizingFor(UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin)) {
frame.origin.x = floorf(frame.origin.x + (frame.origin.x / oldSize.width * delta.width));
frame.size.width = floorf(frame.size.width + (frame.size.width / oldSize.width * delta.width));
frame.origin.x = frame.origin.x + (frame.origin.x / oldSize.width * delta.width); //floorf(frame.origin.x + (frame.origin.x / oldSize.width * delta.width));
frame.size.width = frame.size.width + (frame.size.width / oldSize.width * delta.width); //floorf(frame.size.width + (frame.size.width / oldSize.width * delta.width));
} else if (hasAutoresizingFor(UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth)) {
const CGFloat t = frame.origin.x + frame.size.width;
frame.origin.x = floorf(frame.origin.x + (frame.origin.x / t * delta.width));
Expand Down

0 comments on commit cb738c8

Please sign in to comment.