PickerViewDelegate
@objc
public protocol PickerViewDelegate : AnyObject
This protocol provides the methods to customize a pickerview.
-
This method is called whenever the label for a row is needed.
Note
When there is no delegate, a standard UILabel object with center text alignment is used.Declaration
Swift
func makeLabel(_ pickerView: UIPickerView, text: String) -> UILabelParameters
pickerViewThe picker view requesting a label.
textThe text to be displayed on the label.
Return Value
A customized UILabel object having the specified text.
-
This optional method is called whenever the row width is needed.
Declaration
Swift
@objc optional func rowWidth(_ pickerView: UIPickerView) -> CGFloatParameters
pickerViewThe picker view requesting this information.
Return Value
A custom value for the row width.
-
This optional method is called whenever the row height is needed.
Declaration
Swift
@objc optional func rowHeight(_ pickerView: UIPickerView) -> CGFloatParameters
pickerViewThe picker view requesting this information.
Return Value
A custom value for the row height.
View on GitHub
PickerViewDelegate Protocol Reference