CocoaPods教程 1.6

CocoaPods教程 1.6

kunass2维护。



 
依赖
SnapKit>= 0
RxSwift>= 0
RxCocoa>= 0
 

  • 作者
  • kunass2

CocoaPods教程

安装

BSTableViewReorder可以通过CocoaPods获得。要安装它,只需将以下行添加到您的Podfile中

pod "WalkthroughTutorial"

如果您的podfile中使用了use_framework,只需对每个文件进行以下操作:

import WalkthroughTutorial

当您需要使用它时。

您还可以在

@import WalkthroughTutorial

桥接头文件中使用它,避免为每个需要的文件导入框架。

##信息

  • 完全使用最新的Swift语法编写。

##使用

        let pages = [
            TutorialPage(
                items: [
                    TutorialItem(view: yellowView),
                    TutorialItem(view: greenView),
                ],
                title: "First Initial page",
                description: "- lorem ipsum first"
            ),
            TutorialPage(
                items: [
                    TutorialItem(view: brownView),
                ],
                title: "Second Initial page",
                description: "- lorem ipsum second"
            ),
            TutorialPage(
                items: [
                    TutorialItem(view: purpleView),
                ],
                title: "Third Initial page",
                description: "- lorem ipsum third"
            ),
        ]
        var blurEffect = UIBlurEffect(style: .dark)
        if #available(iOS 13.0, *) {
            blurEffect = UIBlurEffect(style: .systemThinMaterialDark)
        }
        let configuration = TutorialConfiguration(blurEffect: blurEffect)
        let controller = TutorialViewController(pages: pages, configuration: configuration)
        controller.modalPresentationStyle = .overCurrentContext
        present(controller, animated: true)

#####使用TutorialConfiguration自定义您与WalkthroughTutorial的工作方式

public class TutorialConfiguration {
    public var skipButtonTitle = "Skip"
    public var skipButtonColor = UIColor.white
    public var skipButtonFont = UIFont.systemFont(ofSize: 14)
    public var nextButtonTitle = "Next"
    public var nextButtonColor = UIColor.white
    public var nextButtonFont = UIFont.systemFont(ofSize: 14)
    public var titleColor = UIColor.white
    public var descriptionColor = UIColor.white
    public var titleFont = UIFont.boldSystemFont(ofSize: 32)
    public var descriptionFont = UIFont.systemFont(ofSize: 16)
    public var offset: CGFloat = 4
    public let blurEffect: UIBlurEffect
    
    public init(blurEffect: UIBlurEffect) {
        self.blurEffect = blurEffect
    }
}

作者

Bartłomiej Semańczyk,[email protected]

许可

CocoaPods教程可在MIT许可下获得。有关更多信息,请参阅LICENSE文件。