Created
October 16, 2011 01:37
-
-
Save jakemarsh/1290401 to your computer and use it in GitHub Desktop.
Is This Cool? Or No?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) viewDidLoad { | |
[super viewDidLoad]; | |
self.airplaneModeSwitch = [[[UISwitch alloc] initWithFrame:CGRectZero] autorelease]; | |
[self addSection:^(JMStaticContentTableViewSection *section, NSUInteger sectionIndex) { | |
[section addCell:^(JMStaticContentTableViewCell *staticContentCell, UITableViewCell *cell, NSIndexPath *indexPath) { | |
staticContentCell.reuseIdentifier = @"UIControlCell"; | |
cell.selectionStyle = UITableViewCellSelectionStyleNone; | |
cell.textLabel.text = NSLocalizedString(@"Airplane Mode", @"Airplane Mode"); | |
cell.imageView.image = [UIImage imageNamed:@"AirplaneMode"]; | |
cell.accessoryView = self.airplaneModeSwitch; | |
}]; | |
[section addCell:^(JMStaticContentTableViewCell *staticContentCell, UITableViewCell *cell, NSIndexPath *indexPath) { | |
staticContentCell.cellStyle = UITableViewCellStyleValue1; | |
staticContentCell.reuseIdentifier = @"DetailTextCell"; | |
cell.textLabel.text = NSLocalizedString(@"Wi-Fi", @"Wi-Fi"); | |
cell.detailTextLabel.text = NSLocalizedString(@"iamtheinternet", @"iamtheinternet"); | |
} whenSelected:^(NSIndexPath *indexPath) { | |
WifiViewController *vc = [[WifiViewController alloc] init]; | |
[self.navigationController pushViewController:vc animated:YES]; | |
[vc release]; | |
}]; | |
[section addCell:^(JMStaticContentTableViewCell *staticContentCell, UITableViewCell *cell, NSIndexPath *indexPath) { | |
cell.textLabel.text = NSLocalizedString(@"Notifications", @"Notifications"); | |
cell.imageView.image = [UIImage imageNamed:@"Notifications"]; | |
} whenSelected:^(NSIndexPath *indexPath) { | |
//TODO | |
}]; | |
[section addCell:^(JMStaticContentTableViewCell *staticContentCell, UITableViewCell *cell, NSIndexPath *indexPath) { | |
staticContentCell.cellStyle = UITableViewCellStyleValue1; | |
staticContentCell.reuseIdentifier = @"DetailTextCell"; | |
cell.textLabel.text = NSLocalizedString(@"Location Services", @"Location Services"); | |
cell.detailTextLabel.text = NSLocalizedString(@"On", @"On"); | |
} whenSelected:^(NSIndexPath *indexPath) { | |
//TODO | |
}]; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is cool! I actually created something quite similar: https://github.com/gotosleep/JATableModel