ToolbarUIPickerView
class ToolbarUIPickerView : UIPickerView
Class creating an UI PickerView with a toolbar. The toolbar has 2 buttons; a ‘Done’ and a ‘Cancel’ button. A protocol is defined so a host class using the ToolbarUIPickerView can become a delegate and implement the didTapDone and didTapCancel methods for handling the 2 toolbar buttons.
-
Custom UIToolBar
Declaration
Swift
private(set) var toolbar: UIToolbar? { get } -
toolbarDelegate, set this to the class acting as ToolbarUIPickerViewDelegate
Declaration
Swift
weak var toolbarDelegate: ToolbarUIPickerViewDelegateProtocol? -
Override Initialiser
Declaration
Swift
override init(frame: CGRect)Parameters
frameCGRect
-
Required initialiser
Declaration
Swift
required init?(coder aDecoder: NSCoder)Parameters
aDecoderNSCoder
-
Initialises the toolbar and its properties
Declaration
Swift
private func commonInit() -
Action handler handling the tapping of the Done button. Forwards control to the toolbar delegate didTapDone method
Declaration
Swift
@objc func doneTapped() -
Action handler handling the tapping of the Cancel button. Forwards control to the toolbar delegate didTapCancel method
Declaration
Swift
@objc func cancelTapped()
ToolbarUIPickerView Class Reference