欢迎游览1.1.9

WelcomeTour 1.1.9

Mohamed Zakout维护。



  • Mohamed Zakout

WelcomeTour

Version License Platform

演示

安装

CocoaPods

在您的Podfile中添加以下行

pod 'WelcomeTour'

使用

第一步

  • 将一个 UIView 对象拖入 storyboard

  • UIView 类设置为 WelcomeTourCV

第二步

  • WelcomeTourCV 添加导入。
import WelcomeTour
  • 将出口拖到 UIViewController
@IBOutlet weak var welcomeTour: WelcomeTourCV!

第三步

Step 对象追加到 WelcomeTourCV 中。

let step1 = Step(image: UIImage(named: "image1")!, title: "Book any meal from any restaurant within the app", subtitle: "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s")
        
let step2 = Step(image: UIImage(named: "image2")!, title: "Book any meal from any restaurant within the app", subtitle: "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s")
        
let step3 = Step(image: UIImage(named: "image3")!, title: "Book any meal from any restaurant within the app", subtitle: "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s")
        
welcomeTour.steps.append(step1)
welcomeTour.steps.append(step2)
welcomeTour.steps.append(step3)

可选步骤

  • WelcomeTourCV 包含 next()skip() 方法。
import WelcomeTour

class ViewController: UIViewController {

    @IBOutlet weak var welcomeTour: WelcomeTourCV!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }

    @IBAction func skip(_ sender: Any) {
        welcomeTour.skip()
    }
    
    @IBAction func next(_ sender: Any) {
        welcomeTour.next()
    }
}


  • 添加页面指示器。

您可以通过将 UIPageControl 拖入 storyboard 来简单地添加指示器

将出口拖到 UIViewController

将出口分配到 WelcomeTour.pageIndicator

import WelcomeTour

class ViewController: UIViewController {

    @IBOutlet weak var welcomeTour: WelcomeTourCV!
    @IBOutlet weak var pageControl: UIPageControl!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        welcomeTour.pageIndicator = pageControl        
    }
}

作者

Mohamed Zakout, [email protected]