测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布上次发布 | 2014年12月 |
由 Alex Peterson,Alex Peterson 维护。
TutorialKit 是一个用于创建交互式分步骤教程的库。使用操作消息突出显示视图,并在不添加大量额外逻辑代码的情况下显示手势。
简单示例
// Set up in the AppDelegate (but could be anywhere really)
NSValue *msgPoint = [NSValue valueWithCGPoint:
CGPointMake(self.window.bounds.size.width * 0.5,
self.window.bounds.size.height * 0.65)];
NSValue *swipeStart = [NSValue valueWithCGPoint:
CGPointMake(self.window.bounds.size.width * 0.75,
self.window.bounds.size.height * 0.75)];
NSValue *swipeEnd = [NSValue valueWithCGPoint:
CGPointMake(self.window.bounds.size.width * 0.25,
self.window.bounds.size.height * 0.75)];
// set up a simple 3 step tutorial
NSArray *steps = @[
// Step 0
@{
TKHighlightViewTag: @(1001), // tag assigned to your UIButton
TKMessage: @"First, press this button.",
TKMessagePoint: msgPoint
},
// Step 1
@{
TKSwipeGestureStartPoint: swipeStart,
TKSwipeGestureEndPoint: swipeEnd,
TKMessage: @"Next, swipe left.",
TKMessagePoint: msgPoint
},
// Step 2
@{
TKMessage: @"That's it! Yer all done!",
TKMessagePoint: msgPoint,
TKCompleteCallback: ^{ NSLog(@"ALL DONE."); }
},
];
[TutorialKit addTutorialSequence:steps name:@"example"];
[TutorialKit advanceTutorialSequenceWithName:@"example"];
您也可以配置 TutorialKit 的默认样式。
[TutorialKit setDefaultBlurAmount:0.5];
[TutorialKit setDefaultMessageColor:UIColor.grayColor];
[TutorialKit setDefaultMessageFont:[UIFont fontWithName:@"Helvetica" size:20]];
[TutorialKit setDefaultTintColor:[UIColor colorWithWhite:1.0 alpha:0.5]];
您可以将教程步骤设置为任意时间(如果需要重新开始很有用)
[TutorialKit setCurrentStep:0 forTutorial:@"example"];
要运行示例项目;首先从示例目录中克隆存储库,然后运行 pod install
Alex Peterson,[email protected]
TutorialKit 可在 MIT 许可证下使用。更多信息请参阅 LICENSE 文件。