PickerField

public class PickerField : Field

Material version of the UIPickerView (single column only, supports manual entry)

  • Picker data source.

    Declaration

    Swift

    public var data: [String] { get set }
  • Declaration

    Swift

    public override var placeholder: String? { get set }
  • Declaration

    Swift

    override public var text: String? { get set }
  • Declaration

    Swift

    public override var isOptional: Bool { get set }
  • Setter for showing a clear button to eliminate the contents of the field.

    Declaration

    Swift

    public var isClearable: Bool { get set }
  • Specifies if the PickerField supports manual entry which will show up as the last option in the picker.

    Declaration

    Swift

    public var isManualEntryCapable: Bool { get set }
  • Changes index in PickerField. If value is below the lower bound (0), it defualts to 0. If the value is over the upper bound, it defaults to to the upper bound.

    Declaration

    Swift

    public var setIndexTo: Int { get set }
  • Specifies the manual entry option name if isManualEntryCapable is set to true

    Note

    Defaults to Manual Entry.

    Declaration

    Swift

    public var manualEntryOptionName: String { get set }
  • Read-only integer value for the current index the picker is on

    Declaration

    Swift

    private(set) public var indexSelected: Int { get set }
  • Setter function to set the PickerField to its manaul entry row

    Declaration

    Swift

    public func setIndexToManual()
  • Declaration

    Swift

    public override var keyboardType: UIKeyboardType { get set }
  • Declaration

    Swift

    public override var autocapitalizationType: UITextAutocapitalizationType { get set }
  • Declaration

    Swift

    public override var autocorrectionType: UITextAutocorrectionType { get set }
  • Declaration

    Swift

    public override var isSecureTextEntry: Bool { get set }
  • Declaration

    Swift

    public override var borderColor: UIColor { get set }
  • Declaration

    Swift

    public override var borderHighlightColor: UIColor { get set }
  • Declaration

    Swift

    public override var borderErrorColor: UIColor { get set }
  • Declaration

    Swift

    public override var textColor: UIColor { get set }
  • Declaration

    Swift

    public override var errorTextColor: UIColor { get set }
  • Declaration

    Swift

    public override var placeholderDownColor: UIColor { get set }
  • Declaration

    Swift

    public override var placeholderUpColor: UIColor { get set }
  • Declaration

    Swift

    public override var cursorColor: UIColor { get set }
  • Undocumented

    Declaration

    Swift

    public var clearButtonColor: UIColor { get set }
  • Undocumented

    Declaration

    Swift

    public var doneButtonColor: UIColor { get set }
  • The reciever’s delegate

    Declaration

    Swift

    weak public var delegate: PickerFieldDelegate?
  • Declaration

    Swift

    public override var shakes: Bool { get set }
  • Required initializer if doing programtically. You can manually set the frame after initialization. Otherwise it relies on auto layout and its intrinsic content size.

    Warning

    Refer to the Field Guide in the online documentation if you want to define height constraints.

    Declaration

    Swift

    public required init()
  • Notifies the field that it has been asked to relinquish its status as first responder in its window. This triggers the end callback from the field, closes the picker, and removes the editing state.

    Note

    If it’s in an error state it will keep its error UI.

    Declaration

    Swift

    override public func resignFirstResponder() -> Bool

    Return Value

    true

  • Opens the picker or the PickerField is on manual entry it will open the keyboard.

    Declaration

    Swift

    override public func becomeFirstResponder() -> Bool

    Return Value

    true

  • Asks to see if the field is the first responder. If it is on manual entry it asks the entryField if it is the responder otherwise it returns its isActive flag

    Declaration

    Swift

    override public var isFirstResponder: Bool { get }
  • Returns a boolean indicating wether the field can become the first responder by asking the entryField if it can become the first responder

    Note

    Only use this if your PickerField is manualEntryCapable

    Declaration

    Swift

    public override var canBecomeFirstResponder: Bool { get }
  • Returns 1 since single column picker only

    Declaration

    Swift

    public func numberOfComponents(in pickerView: UIPickerView) -> Int
  • Returns data.count of string array passed in

    Declaration

    Swift

    public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int
  • Returns value in data[row] of string array passed in

    Declaration

    Swift

    public func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String?
  • Forwards didSelectRow, handles state UI

    Declaration

    Swift

    public func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int)