Skip to content

Commit 8e827c3

Browse files
author
Sam Davies
committed
Removed the guff we don't need from the project template
1 parent 27e0ef6 commit 8e827c3

File tree

3 files changed

+0
-66
lines changed

3 files changed

+0
-66
lines changed

22-downloadable-fonts/FontBook/FontBook/SCDetailViewController.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@
1010

1111
@interface SCDetailViewController : UIViewController
1212

13-
@property (strong, nonatomic) id detailItem;
14-
1513
@property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel;
1614
@end

22-downloadable-fonts/FontBook/FontBook/SCDetailViewController.m

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,16 @@
99
#import "SCDetailViewController.h"
1010

1111
@interface SCDetailViewController ()
12-
- (void)configureView;
1312
@end
1413

1514
@implementation SCDetailViewController
1615

1716
#pragma mark - Managing the detail item
1817

19-
- (void)setDetailItem:(id)newDetailItem
20-
{
21-
if (_detailItem != newDetailItem) {
22-
_detailItem = newDetailItem;
23-
24-
// Update the view.
25-
[self configureView];
26-
}
27-
}
28-
29-
- (void)configureView
30-
{
31-
// Update the user interface for the detail item.
32-
33-
if (self.detailItem) {
34-
self.detailDescriptionLabel.text = [self.detailItem description];
35-
}
36-
}
37-
3818
- (void)viewDidLoad
3919
{
4020
[super viewDidLoad];
4121
// Do any additional setup after loading the view, typically from a nib.
42-
[self configureView];
43-
}
44-
45-
- (void)didReceiveMemoryWarning
46-
{
47-
[super didReceiveMemoryWarning];
48-
// Dispose of any resources that can be recreated.
4922
}
5023

5124
@end

22-downloadable-fonts/FontBook/FontBook/SCMasterViewController.m

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,8 @@ - (void)viewDidLoad
2626
{
2727
[super viewDidLoad];
2828
// Do any additional setup after loading the view, typically from a nib.
29-
self.navigationItem.leftBarButtonItem = self.editButtonItem;
30-
31-
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)];
32-
self.navigationItem.rightBarButtonItem = addButton;
33-
}
34-
35-
- (void)didReceiveMemoryWarning
36-
{
37-
[super didReceiveMemoryWarning];
38-
// Dispose of any resources that can be recreated.
3929
}
4030

41-
- (void)insertNewObject:(id)sender
42-
{
43-
if (!_objects) {
44-
_objects = [[NSMutableArray alloc] init];
45-
}
46-
[_objects insertObject:[NSDate date] atIndex:0];
47-
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
48-
[self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
49-
}
5031

5132
#pragma mark - Table View
5233

@@ -69,28 +50,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
6950
return cell;
7051
}
7152

72-
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
73-
{
74-
// Return NO if you do not want the specified item to be editable.
75-
return YES;
76-
}
77-
78-
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
79-
{
80-
if (editingStyle == UITableViewCellEditingStyleDelete) {
81-
[_objects removeObjectAtIndex:indexPath.row];
82-
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
83-
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
84-
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
85-
}
86-
}
87-
8853
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
8954
{
9055
if ([[segue identifier] isEqualToString:@"showDetail"]) {
9156
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
92-
NSDate *object = _objects[indexPath.row];
93-
[[segue destinationViewController] setDetailItem:object];
9457
}
9558
}
9659

0 commit comments

Comments
 (0)