w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Swift: How to set a default Value of a UIPickerView with three components in Swift?

This is the code I have used in one of my Apps:

// Declare the outlet to the picker in your storyboard
@IBOutlet var MyPicker: UIPickerView!


override func viewDidLoad() {
MyPicker.selectRow(row, inComponent: 0, animated: true)

Obviously, replace row and 0 with whatever values you want.

Hope this Helps!

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.