Adding Movable Markers to the Diagrams

For the marker we need a user interface element that allows for the easy input of a value between 0 and 1. UIKit provides the class UISlider, which perfectly fits this task. Open Main.storyboard and use the shortcut L to open the library. Search for Slider and drag one above the button at the same horizontal level as the button. If the slider is located in the diagram stack view or the lower diagram view, delete it and try again. Drag another slider between the existing slider and the button.

We also need a label to display the result—the length of the swing—in the user interface. Search the library for Label and drag one above the first slider such that it is at the same hierarchical level as the ...

Get Build Location-Based Projects for iOS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.