PBTutorialManager 1.1.0

PBTutorialManager 1.1.0

测试已经测试
语言语言 SwiftSwift
许可 MIT
发布最新发布2019年3月
SPM支持 SPM

Paul 维护。




PBTutorialManager

PBTutorialManager 允许您轻松地为您的应用程序创建一个内建教程。

版本

1.1.0

安装

CocoaPods

只需将其添加到您的 podfile 文件中

pod 'PBTutorialManager'
手动

将 'lib' 文件夹复制粘贴到您的项目中

如何使用

PBTutorialManager 与 TutorialTarget 的对象一起工作,并管理这些对象的队列以依次显示一个。

let targetProfilePicture = TutorialTarget(view: profilePicture)
            .withArrow(true)
            .heightArrow(50)
            .widthArrow(25)
            .position(.bottom)
            .shape(.elipse)
            .duration(1.0)
            .message("This is a profile picture")
        
let targetMainImage = TutorialTarget(view: mainImage)
            .withArrow(true)
            .heightArrow(50)
            .widthArrow(25)
            .position(.bottom)
            .shape(.rect)
            .duration(1.0)
            .message("This is the main image")
        
let targetButton = TutorialTarget(view: button)
            .withArrow(true)
            .heightArrow(50)
            .widthArrow(25)
            .position(.top)
            .shape(.elipse)
            .message("This is a button")
            .breakPoint(true)

// Call from viewDidAppear(), before this window may be nil         
// Or you can pass the view instead of the window if toolbars
//  and navigation bars aren't being used
let tutorialManager = TutorialManager(parent: view.window!)
tutorialManager.addTarget(targetProfilePicture)
tutorialManager.addTarget(targetMainImage)
tutorialManager.addTarget(targetButton)
tutorialManager.fireTargets()

额外目标属性

目标还有其他可以操作的属性

textAlignement 	/* The text alignement */
labelWidth      /* The width of the label */
position 		/* The position of your text around the highlight view */
arrowStartPosition /* Controlls what position the arrow starts from, set to nil to match position behaviour */
shape 		/* The shape of the mask to highlight the view */
duration 		/* time duration before to show the next target */
font              /* A font that you can modify */
isTappable 		/* if isTappable is true you can tap to dismiss the target */
closure 		/* A closure executed after the target has been shown */
persistant		/* if persistant the target stay on screen when the next one show up, you can add multiple target one after one */
breakPoint 		/* breakpoint is a target which attempt a user click to continue */
    
/* Margins */
topMargin
rightMargin
bottomMargin
leftMargin
    
topTextMargin
rightTextMargin
bottomTextMargin
leftTextMargin
    
/* Arrow */
withArrow
heightArrow
widthArrow
arrowHeadSize

依赖项

感谢 AFCurvedArrowView

许可

MIT 许可证

版权所有 (c) [2016] [Paul Bancarel]

任何人可通过免费获得本软件及其关联文档文件的副本(统称为“软件”),不受限制地处理该软件,包括但不限于使用、复制、修改、合并、发布、分发、许可和/或销售软件的副本,并允许向获取该软件的人员提供副本,本许可协议须遵守以下条件。

必须将上述版权声明和本许可声明包含在所有副本或该软件的大部分内容中。

软件按“原样”提供,不提供任何明示或暗示的保证,包括但不限于适销性、适用于特定目的和不可侵犯性的保证。在任何情况下,作者或版权所有者不对任何索赔、损害或其他责任负责,无论是由合同行为、侵权行为或其他行为引起的,也不论这些索赔、损害或其他责任与软件或软件的使用或其他方式有关。