TVButton

Recreating the cool parallax icons from Apple TV as iOS UIButtons (in Swift).

Github星跟踪图

TVButton - Apple TV Parallax icons on iOS

Build Status Version
Carthage compatible

TVButton

Recreating the cool parallax icons from Apple TV as iOS UIButtons (in Swift). The effect is triggered by long pressing or dragging.

Star Wars TVButton

Usage

Import TVButton at the top of your Swift ViewController.

import TVButton

Create and position your TVButton in interface builder or in code.

For the parallax TVButton you will need at least two layers of images (three recommended). For best results, the button and the images should all have the same dimensions. Assign the relevant UIImages to TVButtonLayers and provide them as a layers array to the TVButton.

let background = TVButtonLayer(image: UIImage(named: "TVButtonBackground.png")!)
let pattern = TVButtonLayer(image: UIImage(named: "TVButtonPattern.png")!)
let top = TVButtonLayer(image: UIImage(named: "TVButtonTop.png")!)
tvButton.layers = [background, pattern, top]

You can customize the parallax intensity of your TVButton. Default value is 1.0 and it's very subtle. Maximum recommended value is 2.0.

tvButton.parallaxIntensity = 1.3

TVButton in action

Enjoy!

Setting up with CocoaPods

source 'https://github.com/CocoaPods/Specs.git'
pod 'TVButton', '~> 1.0'

Setting up with Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate TVButton into your Xcode project using Carthage, specify it in your Cartfile:

github "marmelroy/TVButton"

主要指标

概览
名称与所有者marmelroy/TVButton
主编程语言Swift
编程语言Objective-C (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2015-11-07 23:20:29
推送于2019-03-02 01:56:34
最后一次提交2016-12-04 23:03:25
发布数6
最新版本名称1.0.0 (发布于 )
第一版名称0.1 (发布于 )
用户参与
星数1.2k
关注者数23
派生数51
提交数53
已启用问题?
问题数10
打开的问题数5
拉请求数0
打开的拉请求数2
关闭的拉请求数1
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?