forked from lostinthepines/TutorialKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppDelegate.m
More file actions
61 lines (53 loc) · 2.19 KB
/
AppDelegate.m
File metadata and controls
61 lines (53 loc) · 2.19 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// AppDelegate.m
// TutorialKitExample
//
// Created by Alex on 4/30/14.
// Copyright (c) 2014 TutorialKit. All rights reserved.
//
#import "AppDelegate.h"
#import "ExampleViewController.h"
#import "TutorialKit.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = [[ExampleViewController alloc] init];
NSValue *msgPoint = [NSValue valueWithCGPoint:
CGPointMake(0.5,0.7)];
NSValue *swipeStart = [NSValue valueWithCGPoint:
CGPointMake(0.75,0.8)];
NSValue *swipeEnd = [NSValue valueWithCGPoint:
CGPointMake(0.25,0.8)];
// set up a simple 3 step tutorial
NSArray *steps = @[
// Step 0
@{
TKHighlightViewTag: @(1001),
TKMessage: @"First, press this button.",
TKMessageRelativePoint: msgPoint
},
// Step 1
@{
TKSwipeGestureRelativeStartPoint: swipeStart,
TKSwipeGestureRelativeEndPoint: swipeEnd,
TKMessage: @"Next, swipe left.",
TKMessageRelativePoint: msgPoint
},
// Step 2
@{
TKMessage: @"That's it! Yer all done!",
TKMessageRelativePoint: msgPoint,
TKCompleteCallback: ^{ NSLog(@"ALL DONE."); }
},
];
[TutorialKit addTutorialSequence:steps name:@"example"];
// some optional defaults
[TutorialKit setDefaultBlurAmount:0.5];
[TutorialKit setDefaultMessageColor:UIColor.grayColor];
[TutorialKit setDefaultTintColor:[UIColor colorWithWhite:1.0 alpha:0.5]];
[self.window makeKeyAndVisible];
return YES;
}
@end