Skip to Content
UX Design for Mobile
book

UX Design for Mobile

by Pau Giner, Pablo Perea
July 2017
Intermediate to advanced
354 pages
9h 58m
English
Packt Publishing
Content preview from UX Design for Mobile

States

A state is a set of values for some of the properties of a layer. We can use states, for example, to define the different positions an element can take, and use these states when the user makes an action on our user interface, to make the element visible on the screen area. In the next example, the movingLayer layer has two states--up and down--and changes from one to the other when the user taps on the layer:

movingLayer = new LayermovingLayer.centerX()movingLayer.states =    up:        y: 400    down:        y: 1200movingLayer.stateSwitch("up")movingLayer.onTap ->    movingLayer.stateCycle("up", "down")
Download prototype from Asset_A6462_A08_A14_Example_MovingLayer.framer.zip.
Our layer will have two states: 'up' and 'down'

Each time we call stateCycle ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical UX Design

Practical UX Design

Scott Faranello
Designing UX: Forms

Designing UX: Forms

Jessica Enders
User Experience Design

User Experience Design

Satyam Kantamneni

Publisher Resources

ISBN: 9781787283428Supplemental Content