https://github.com/bannzai/gecco
Simply highlight items for your tutorial walkthrough, written in Swift
https://github.com/bannzai/gecco
Last synced: about 1 year ago
JSON representation
Simply highlight items for your tutorial walkthrough, written in Swift
- Host: GitHub
- URL: https://github.com/bannzai/gecco
- Owner: bannzai
- License: mit
- Created: 2016-01-15T10:57:06.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-12-22T04:17:09.000Z (over 1 year ago)
- Last Synced: 2025-05-14T08:08:15.219Z (about 1 year ago)
- Language: Swift
- Homepage:
- Size: 767 KB
- Stars: 1,891
- Watchers: 26
- Forks: 167
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gecco
[](http://cocoadocs.org/docsets/Gecco/)
[](http://cocoadocs.org/docsets/Gecco/)
[](http://opensource.org/licenses/MIT)
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.
``` swift
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.
Oval
`Oval` displays a perfect circle.
```swift
spotlightViewController.spotlightView.appear(Spotlight.Oval(center: view.center, diameter: 100))
```

Rect
`Rect` is a rectangle drawn by specifying the width and height.
```swift
spotlightViewController.spotlightView.appear(Spotlight.Rect(center: view.center, size: CGSize(width: 200, height: 100)))
```

RoundedRect
`RoundedRect` is a rectangle with corner radius.
```swift
spotlightViewController.spotlightView.appear(Spotlight.RoundedRect(center: view.center, size: CGSize(width: 200, height: 100), cornerRadius: 8))
```

### 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](https://github.com/yukiasai/Gecco/blob/9791f0c050572f43d54a7f13dc081a165d99e9f3/Classes/SpotlightViewController.swift#L11) and [SpotlightViewDelegate](https://github.com/yukiasai/Gecco/blob/9791f0c050572f43d54a7f13dc081a165d99e9f3/Classes/SpotlightView.swift#L11).
For example
```swift
// Hook events for SpotlightViewControllerDelegate
spotlightViewController.delegate = self
// Hook events for SpotlightViewDelegate
spotlightViewController.spotlightView.delegate = self
```
### Example
Please refer to [GeccoExample](https://github.com/yukiasai/Gecco/tree/master/GeccoExample).
## Installation
#### CocoaPods
```
pod 'Gecco'
```
#### Carthage
```
github "yukiasai/Gecco"
```
## License
Gecco is released under the MIT license. See LICENSE for details.