Iridescent Effect View (inspired by Apple Pay Cash) ✨

Overview

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 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.

You might also like...
MUDownloadButton -  a Progressive Download button written in pure swift and inspired by AppStore download button
MUDownloadButton - a Progressive Download button written in pure swift and inspired by AppStore download button

MUDownloadButton is a Progressive Download button written in pure swift and inspired by AppStore download button . feel free to contribute and pull requests

A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

Confetti View lets you create a magnificent confetti view in your app
Confetti View lets you create a magnificent confetti view in your app

ConfettiView Confetti View lets you create a magnificent confetti view in your app. This was inspired by House Party app's login screen. Written in Sw

UI Component. This is a copy swipe-panel from app: Apple Maps, Stocks. Swift version
UI Component. This is a copy swipe-panel from app: Apple Maps, Stocks. Swift version

ContainerController UI Component. This is a copy swipe-panel from app: https://www.apple.com/ios/maps/ Preview Requirements Installation CocoaPods Swi

A library to recreate the iOS Apple Music now playing transition
A library to recreate the iOS Apple Music now playing transition

DeckTransition DeckTransition is an attempt to recreate the card-like transition found in the iOS 10 Apple Music and iMessage apps. Hereʼs a GIF showi

Kit for building custom gauges + easy reproducible Apple's style ring gauges.
Kit for building custom gauges + easy reproducible Apple's style ring gauges.

GaugeKit ##Kit for building custom gauges + easy reproducible Apple's style ring gauges. - Example Usage Open GaugeKit.xcworkspace and change the sch

A fancy hexagonal layout for displaying data like your Apple Watch
A fancy hexagonal layout for displaying data like your Apple Watch

Hexacon is a new way to display content in your app like the Apple Watch SpringBoard Highly inspired by the work of lmmenge. Special thanks to zenly f

 Flutter Apple Product Store App UI Home Page With Getx
Flutter Apple Product Store App UI Home Page With Getx

Flutter Apple Product Store App UI Home Page With Getx A new Flutter UI Project on my Youtube Channel . About The Project Create a beautiful Flutter U

DrawerKit lets an UIViewController modally present another UIViewController in a manner similar to the way Apple's Maps app works.
DrawerKit lets an UIViewController modally present another UIViewController in a manner similar to the way Apple's Maps app works.

DrawerKit What is DrawerKit? DrawerKit is a custom view controller presentation mimicking the kind of behaviour in the Apple Maps app. It lets any vie

Comments
  • Can Shiny be used with UIButtons??

    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??

    opened by sdevo619 1
  • Swift 5.0

    Swift 5.0

    Checklist

    • [x] I've tested my changes.
    • [x] I've read the Contribution Guidelines.
    • [x] I've updated the documentation if necessary.

    Description

    • Added Swift 5.0 Support
    opened by efremidze 0
  • fix insetting of scene view

    fix insetting of scene view

    Checklist

    • [x] I've tested my changes.
    • [x] I've read the Contribution Guidelines.
    • [x] I've updated the documentation if necessary.

    Motivation and Context

    When setting ShinyView to the frame of device, a strange inset is present on iPad: Simulator Screen Shot - iPad Pro (12 9-inch) (3rd generation) - 2019-12-13 at 10 58 50

    Ran my fix on the iPad simulator which did end up rendering fine + example app still works: Simulator Screen Shot - iPad Pro (12 9-inch) (3rd generation) - 2019-12-13 at 11 17 28

    Description

    removed the setting of scene view's frame from it's initialiser and do it in ShinyView's layoutSubviews instead

    opened by jurvis 2
  • 360° Support

    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.

    enhancement 
    opened by LeoNatan 5
Owner
Lasha Efremidze
#iOS Engineer @amzn @EdisonJunior (Ring). Previously @eBay @stubhub @calaborate (Klutch). Open source enthusiast.
Lasha Efremidze
Apple TV Parallax effect in Swift.

MPParallaxView Apple TV Parallax effect in Swift. Rotate view using touch or accelerometer. Usage To run the example project, clone the repo, and run

Droids On Roids 1.7k Jan 4, 2023
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

LoadingShimmer An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. Thi

Jogendra 1.4k Jan 4, 2023
Page view controller with bounce effect

BouncyPageViewController Page view controller with bounce effect inspired by motion design by Stan Yakushevish. Quickstart Create a queue of UIViewCon

Bohdan Orlov 843 Oct 17, 2022
SpriteKit Floating Bubble Picker (inspired by Apple Music) 🧲

Magnetic Magnetic is a customizable bubble picker like the Apple Music genre selection. Demo Video $ pod try Magnetic Features Adding/Removing Nodes

Lasha Efremidze 1.4k Jan 6, 2023
Bubble pickers, inspired by Apple

AmazingBubbles Bubble pickers, inspired by Apple Requirements: iOS 9.1+ XCode 8.0+ Swift 3.0 Installation AmazingBubbles Library is available through

Gleb Radchenko 63 Oct 14, 2022
Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift

SKPhotoBrowser Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift features Display one or more images by providi

keishi suzuki 2.4k Jan 6, 2023
A micro UIStackView convenience API inspired by SwiftUI

Stacks A micro UIStackView convenience API inspired by SwiftUI. let stack: UIView = .hStack(alignment: .center, margins: .all(16), [ .vStack(spaci

Alexander Grebenyuk 74 Jul 27, 2022
SwiftUI: Components Library Inspired by Twitter's Bootstrap

bootswiftui SwiftUI: Components Library Inspired by Twitter's Bootstrap Warning This is just SwiftUI exercise. Please do not consider using this repo

Robert Sandru 1 Oct 27, 2022
A spotlight-inspired quick action bar for macOS.

DSFQuickActionBar A spotlight-inspired quick action bar for macOS. Why? I've seen this in other mac applications (particularly spotlight) and it's ver

Darren Ford 31 Dec 14, 2022