Refactoring

This commit is contained in:
Roman Efimov
2013-07-16 10:36:01 -05:00
parent d6aa03537a
commit fabce4be88
3 changed files with 7 additions and 31 deletions

View File

@@ -41,9 +41,7 @@
self.barStyle = UIBarStyleBlackTranslucent;
}
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Done", @"")
style:UIBarButtonItemStyleDone target:self
action:@selector(handleActionBarDone:)];
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Done", @"") style:UIBarButtonItemStyleDone target:self action:@selector(handleActionBarDone:)];
_navigationControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:NSLocalizedString(@"Previous", @""), NSLocalizedString(@"Next", @""), nil]];
_navigationControl.momentary = YES;
@@ -60,16 +58,14 @@
- (void)handleActionBarPreviousNext:(UISegmentedControl *)segmentedControl
{
if ([_actionBarDelegate respondsToSelector:@selector(actionBar:navigationControlValueChanged:)]) {
if ([_actionBarDelegate respondsToSelector:@selector(actionBar:navigationControlValueChanged:)])
[_actionBarDelegate actionBar:self navigationControlValueChanged:segmentedControl];
}
}
- (void)handleActionBarDone:(UIBarButtonItem *)doneButtonItem
{
if ([_actionBarDelegate respondsToSelector:@selector(actionBar:doneButtonPressed:)]) {
if ([_actionBarDelegate respondsToSelector:@selector(actionBar:doneButtonPressed:)])
[_actionBarDelegate actionBar:self doneButtonPressed:doneButtonItem];
}
}
@end

View File

@@ -136,27 +136,6 @@
}
}
- (float)groupedCellMarginWithTableWidth:(float)tableViewWidth
{
float marginWidth;
if(tableViewWidth > 20)
{
if(tableViewWidth < 400)
{
marginWidth = 10;
}
else
{
marginWidth = MAX(31, MIN(45, tableViewWidth*0.06));
}
}
else
{
marginWidth = tableViewWidth - 10;
}
return marginWidth;
}
- (RETableViewCellType)cellType
{
if (self.row == 0 && self.section.items.count == 1)

View File

@@ -80,16 +80,17 @@
for (NSDictionary *dictionary in items) {
NSString *username = [dictionary objectForKey:@"username"];
NSString *userpic = [dictionary objectForKey:@"userpic"];
NSString *image = [dictionary objectForKey:@"image"];
NSString *imageName = [dictionary objectForKey:@"image"];
// Create section with a header view
//
RETableViewSection *section = [[RETableViewSection alloc] initWithHeaderView:[ListHeaderView headerViewWithImageNamed:userpic username:username]];
ListHeaderView *headerView = [ListHeaderView headerViewWithImageNamed:userpic username:username];
RETableViewSection *section = [RETableViewSection sectionWithHeaderView:headerView];
[_manager addSection:section];
// Add item (image)
//
[section addItem:[ListImageItem itemWithImageNamed:image]];
[section addItem:[ListImageItem itemWithImageNamed:imageName]];
}
}