July 2017
Intermediate to advanced
354 pages
9h 58m
English
Events allow us to give interactivity to our prototypes. You can associate functionality as a reaction to a given event. There are many kinds of events; for example, when the user interacts with an interface element or when an animation starts or ends.
In the following example, we will print the tap count number each time the user taps on it:
numberOfTaps = 0numberOfTapsLayer = new Layer backgroundColor: "#123123"numberOfTapsLayer.center()numberOfTapsLayer.on Events.Tap, -> numberOfTaps++ print numberOfTaps
As you can see, we used the Events.Tap event, but we can listen to other events as Swipe, LongPress, Pinch or the ForceTap. You can also use some ...