Apple TV-style icons in your iOS app

Introducing TVButton

Roy Marmelstein
Swift and iOS Writing

--

Last Monday, my Apple TV finally arrived and… well… the first experience was a lot like this:

The parallax icons on the Apple TV are just incredibly cool and their 3D-ish sense of depth is an exciting new visual experience.

Why must they only exist on tvOS and not on iOS?

Hello TVButton

TVButton is a an attempt to recreate the cool parallax icons from Apple TV as iOS UIButtons (in Swift). Since we don’t have a Siri remote on iOS, the effect is triggered by long pressing or dragging.

TVButton is a subclass of UIButton and you can create it in Interface Builder or in code. Implementation is as easy as :

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]

The end result looks like this:

Check it out on:

github.com/marmelroy/TVButton

--

--