- Animated page transition.
- A batch of properties for customization.
- Cache support.
import KSGuideController
var items = [KSGuideItem]()
for button in buttons {
let n = Int(arc4random()) % string.count
let index = string.index(string.startIndex, offsetBy: Int(n))
let text = string[..<index]
if n % 2 == 0 {
// Use custom arrow image for every item, you can also set global arrow image for all items by setting the arrowImage property for a KSGuideController instance.
let item = KSGuideItem(sourceView: button, arrowImage: #imageLiteral(resourceName: "arrow"), text: String(text))
items.append(item)
} else {
// Use default arrow image
let item = KSGuideItem(sourceView: button, text: String(text))
items.append(item)
}
}
let vc = KSGuideController(items: items, key: "MainGuide")
vc.setIndexWillChangeBlock { (index, item) in
print("Index will change to \(index)")
}
vc.setIndexDidChangeBlock { (index, item) in
print("Index did change to \(index)")
}
vc.show(from: self) {
print("Guide controller has been dismissed")
}
- Update cocoapods to the latest version.
- Add
pod 'KSGuideController'
to your Podfile. - Run
pod install
orpod update
. - Import
KSGuideController
module.
This library requires iOS 8.0+
and Xcode 8.0+
.
KSGuideController is provided under the MIT license. See LICENSE file for details.