Giter Club home page Giter Club logo

shiny's Introduction

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

$ pod try Shiny

Requirements

  • iOS 9.0+
  • Xcode 9.0+
  • Swift 5 (Shiny 2.x), Swift 4 (Shiny 1.x)

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.

shiny's People

Contributors

efremidze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shiny's Issues

Can Shiny be used with UIButtons??

This looks really cool and was considering trying to use it with one of my projects, however I was wondering if this can also be used with a UIButton or only a UIView??

pod try Shiny fails

pod try Shiny
Updating spec repositories
[!] Unable to find a specification for Shiny

Example doesn't work.

Hi, your example project doesn't work -> animation doesn't start. I'm using Xcode 11 beta 6 + iOS 13.

360° Support

Cool idea!

When looking at Apple’s implementation, the layer (or whatever they are using) is wrapping around, so it goes from gray back to color, whereas in the implementation here, once the layer is offset enough, the view will remain gray even as the phone is tilted more and more.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.