The UIPickerView Guide (Swift Tutorial)

Not always as easy as it might seem

Steven Curtis
4 min readDec 21, 2021
Photo by Esther Wechsler on Unsplash

There are several ways to implement a UIPicker — and much depends on whether you choose to use storyboards, or whether you want to implement a UITextView to display what the user (so to speak) picks.

We can move on to have a tutorial about this. Why wouldn’t we?

Prerequisites:

You will be expected to be aware how to make a Single View Application in Swift.

Terminology

UIPickerView: A view that uses a spinning-wheel or slot-machine metaphor to show one or more sets of values.

The task

This article is about using a UIPicker, and display options for an Hour — Minute — Second format. Can’t be too hard, right?

The code (through the storyboard)

Setting up the UIPicker will require a UITextField, since the UIPicker will be the inputView of the UITextField.

--

--