Iridescent Effect View (inspired by Apple Pay Cash)
Clone or download
efremidze Swift 4.2 (#7)
* Swift 4.2 Support

* Updated podspec
Latest commit ff62886 Oct 4, 2018
Permalink
Failed to load latest commit information.
.github Renamed to Shiny Dec 21, 2017
Example Swift 4.2 (#7) Oct 4, 2018
Images Updated Demo Dec 21, 2017
Shiny.xcodeproj Swift 4.2 (#7) Oct 4, 2018
Sources Swift 4.2 (#7) Oct 4, 2018
docs Swift 4.2 (#7) Oct 4, 2018
.gitignore Initial commit Dec 9, 2017
.swift-version Swift 4.2 (#7) Oct 4, 2018
.travis.yml Swift 4.2 (#7) Oct 4, 2018
CHANGELOG.md Swift 4.2 (#7) Oct 4, 2018
LICENSE Initial commit Dec 9, 2017
Package.swift Renamed to Shiny Dec 21, 2017
README.md 1.1.2 May 17, 2018
Shiny.podspec Swift 4.2 (#7) Oct 4, 2018

README.md

Shiny

Build Status Language Version License Platform Carthage compatible

Shiny is an iOS library that generates an iridescent effect view matched to the gyroscope, similar to the Apple Pay Cash card in the Wallet app.

Apple Pay

Demo Video

$ pod try Shiny

Requirements

  • iOS 9.0+
  • Xcode 9.0+
  • Swift 4

Usage

Adding ShinyView programmatically (supports storyboard/xib too):

import Shiny

let shinyView = ShinyView(frame: CGRect(x: 0, y: 0, width: 320, height: 200))
shinyView.colors = [.gray, .red, .green, .blue, .gray]
shinyView.startUpdates() // necessary
view.addSubview(shinyView)

You must call startUpdates() for the instance to observe motion changes. Calling stopUpdates() on the instance will stop motion updates.

func startUpdates() // Starts listening to motion updates.
func stopUpdates() // Stops listening to motion updates.

Customization

The ShinyView exposes several properties to customize the radial gradient used to create the shiny effect:

var colors: [UIColor] // The color of each gradient stop.
var locations: [CGFloat]? // The location of each gradient stop. The default is `nil`.
var scale: CGFloat // The scale factor of the gradient. The default is `2.0`.

Installation

Shiny is available via CocoaPods and Carthage.

CocoaPods

To install with CocoaPods, simply add this in your Podfile:

use_frameworks!
pod "Shiny"

Carthage

To install with Carthage, simply add this in your Cartfile:

github "efremidze/Shiny"

Mentions

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Apps Using Shiny

Feel free to submit a PR if you’re using this library in your apps.

License

Shiny is available under the MIT license. See the LICENSE file for more info.