forked from bestswifter/MySampleCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAAPLMenuViewController.m
More file actions
39 lines (28 loc) · 1.26 KB
/
Copy pathAAPLMenuViewController.m
File metadata and controls
39 lines (28 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
Displays the list of examples.
*/
#import "AAPLMenuViewController.h"
@implementation AAPLMenuViewController
//| ----------------------------------------------------------------------------
- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender
{
// Certain examples are only supported on iOS 8 and later.
if ([UIDevice currentDevice].systemVersion.floatValue < 8.f)
{
NSArray *iOS7Examples = @[@"CrossDissolve", @"Dynamics", @"Swipe", @"Checkerboard", @"Slide"];
if ([iOS7Examples containsObject:identifier] == NO) {
[self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:YES];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Can not load example." message:@"This example requires iOS 8 or later." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
return NO;
}
}
return YES;
}
//| ----------------------------------------------------------------------------
- (IBAction)unwindToMenuViewController:(UIStoryboardSegue*)sender
{ }
@end