Scale tool with Gesture Recognizer
The next tool we'll implement is the Scale
tool that lets you resize the picture. Like the Move
tool, it uses an update sequencing design pattern to implement a modal manipulation tool. However, we'll use a different user scenario, and a different underlying implementation.
The Scale
tool will work like this:
- Pressing and holding the button using the finger-thumb pinch gesture will activate the scale manipulation mode. The button will grow enlarged to show it is activated.
- As you continue to hold the pinch gesture and move your gaze to the right, the picture object gets bigger. Move your gaze to the left and the picture shrinks.
- Releasing the pinch gesture (unclicking the button) deactivates
Move
mode, restores the button icon to its normal size, and leaves the picture in its new position.
So, this tool provides an example that operates differently than the Move
tool. With the Move
tool, you click once (and release) to begin moving, and then click again to...