Awesome
Gecco
Note
⚠️⚠️ yukiasai/Gecco was transferred to bannzai/Gecco. This repository is forked. ⚠️⚠️
Overview
Simply highlight items for your tutorial walkthrough, written in Swift
Gecco means Moonlight in Japanese.
Usage
Basic
Basically instantiate a SpotlightViewController and present via UIViewController.present(_:animated:completion) and call
SpotlightViewController.spotlight.appear(_:)` with SpotlightType.
import Gecco
class ViewController: UIViewController {
func showSpotlight() {
let spotlightViewController = SpotlightViewController()
present(spotlightViewController, animated: true, completion: nil)
spotlightViewController.spotlightView.appear(Spotlight.Oval(center: view.center, diameter: 100))
}
}
Supported SpotlightType
Gecco provide some SpotlightType as default implemantation.
<details> <summary> Oval </summary>Oval
displays a perfect circle.
spotlightViewController.spotlightView.appear(Spotlight.Oval(center: view.center, diameter: 100))
<img width="320px" src="https://user-images.githubusercontent.com/10897361/93325274-0601a800-f852-11ea-813b-9583be0f4335.png" />
</details>
<details> <summary> Rect </summary>
Rect
is a rectangle drawn by specifying the width and height.
spotlightViewController.spotlightView.appear(Spotlight.Rect(center: view.center, size: CGSize(width: 200, height: 100)))
<img width="320px" src="https://user-images.githubusercontent.com/10897361/93325566-790b1e80-f852-11ea-85a6-5fed5204a56d.png" />
</details>
<details> <summary> RoundedRect </summary>
RoundedRect
is a rectangle with corner radius.
spotlightViewController.spotlightView.appear(Spotlight.RoundedRect(center: view.center, size: CGSize(width: 200, height: 100), cornerRadius: 8))
<img width="320px" src="https://user-images.githubusercontent.com/10897361/93325669-9b04a100-f852-11ea-9afa-b9fac06ba0b2.png" />
</details>
Advanced
Gecco publish some delegate methods for hook each events about SpotlightViewController and SpotlightView. If you want to write adavanced feature, you can write to define SpotlightViewControllerDelegate or SpotlightViewDelegate. See SpotlightViewControllerDelegate and SpotlightViewDelegate.
For example
// Hook events for SpotlightViewControllerDelegate
spotlightViewController.delegate = self
// Hook events for SpotlightViewDelegate
spotlightViewController.spotlightView.delegate = self
Example
Please refer to GeccoExample.
Installation
CocoaPods
pod 'Gecco'
Carthage
github "yukiasai/Gecco"
License
Gecco is released under the MIT license. See LICENSE for details.