Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Commit 39c9abe

Browse files
committed
Merge pull request #31 from dsklen/master
Small modernizations
2 parents 71e1ef7 + 3fb94d4 commit 39c9abe

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

frcd.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@ - (void)controller:(NSFetchedResultsController *)controller
3131
atIndexPath:(NSIndexPath *)indexPath
3232
forChangeType:(NSFetchedResultsChangeType)type
3333
newIndexPath:(NSIndexPath *)newIndexPath
34-
{
34+
{
3535
switch(type) {
3636
case NSFetchedResultsChangeInsert:
37-
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
37+
[self.tableView insertRowsAtIndexPaths:@[newIndexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
3838
break;
3939
case NSFetchedResultsChangeDelete:
40-
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
40+
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
4141
break;
4242
case NSFetchedResultsChangeUpdate:
4343
[self configureCell:[self.tableView cellForRowAtIndexPath:indexPath] forRowAtIndexPath:indexPath];
4444
break;
4545
case NSFetchedResultsChangeMove:
46-
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
47-
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
46+
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
47+
[self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
4848
break;
4949
}
5050
}
5151

5252
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
5353
[self.tableView endUpdates];
54-
}
54+
}

library.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
// Completion Scope: Function or Method
66

77
NSArray *librarySearchPaths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
8-
NSString *libraryDirectory = [librarySearchPaths count] == 0 ? nil : [librarySearchPaths objectAtIndex:0];
8+
NSString *libraryDirectory = [librarySearchPaths firstObject];

mailcomp.m

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ - (void)presentModalMailComposerViewController:(BOOL)animated {
1616
[composeViewController setMessageBody:<#Body#> isHTML:YES];
1717
[composeViewController setToRecipients:@[<#Recipients#>]];
1818

19-
[self presentModalViewController:composeViewController animated:animated];
19+
[self presentViewController:composeViewController animated:animated completion:nil];
2020
} else {
2121
[[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"<#Cannot Send Mail Message#>", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil] show];
2222
}
@@ -31,8 +31,7 @@ - (void)mailComposeController:(MFMailComposeViewController *)controller
3131
if (error) {
3232
NSLog(@"%@", error);
3333

34-
<#statements#>
3534
}
3635

37-
[self dismissModalViewControllerAnimated:YES];
36+
[self dismissViewControllerAnimated:YES completion:nil];
3837
}

0 commit comments

Comments
 (0)