测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布上次发布 | 2017年12月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Higor Borjaille 维护。
iOS 9+
SimpleWizzard 通过 CocoaPods 提供。要安装它,只需在 Podfile 中添加以下行:
示例
pod "SimpleWizzard"
pod install
代码示例
使用它的有两种方式
import SimpleWizzard
class SampleStepViewController: UIViewController, ChangeStepDelegate {
func verifyNext() -> Bool {
SampleWizardController.wizardInstance?.next()
return false
}
func verifyPrev() -> Bool {
return true
}
}
或者只简单地在该函数中返回 true
func verifyNext() -> Bool {
SampleWizardController.wizardInstance?.next()
return false
}
同样的方式也适用于从当前到上一个用户控制器的改变。
func verifyNext() -> Bool {
return true
}
创建一个由 SimpleWizzardViewController 扩展的用户控制器
作者
import SimpleWizzard
class SampleWizardController: SimpleWizardViewController, CancelDelegate {
override func viewDidLoad() {
super.viewDidLoad()
// Setting the Delegate Cancel
self.cancelDelegate = self
// Creating the steps
var viewControllerList = [UIViewController]()
let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
for i in 0...5 {
if let controller = mainStoryboard.instantiateViewController(withIdentifier: "sampleStepSID") as? SampleStepViewController {
controller.pageNumberText = i.description
viewControllerList.append(controller)
}
}
// Setting the images
self.nextImage = UIImage(named: "right")
self.prevImage = UIImage(named: "left")
self.doneImage = UIImage(named: "done_wizzard")
// Setting the color of UIPageDots
self.pageDots?.currentPageIndicatorTintColor = UIColor.black
self.pageDots?.pageIndicatorTintColor = UIColor.lightGray
// Generating the SimpleWizard
self.generate(viewControllerList)
// Setting Title
self.title = "SimpleWizzard"
}
func cancel() {
self.dismiss(animated: true, completion: nil)
}
}
电子邮件: [email protected]
SimpleWizzard 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。
CocoaPods 是以下项目的一个项目: