BTUIKFormField

Objective-C

@interface BTUIKFormField : UIView <UITextFieldDelegate, UIKeyInput>

Swift

class BTUIKFormField : UIView, UITextFieldDelegate, UIKeyInput

@class A UIView containing a BTUIKTextField and other elements to be displayed as a form field. This class is meant to be extended but can be used as is for other generic form fields.

  • The delegate for this form field

    Declaration

    Objective-C

    @property (nonatomic, weak) id<BTUIKFormFieldDelegate> delegate;

    Swift

    weak var delegate: BTUIKFormFieldDelegate! { get set }
  • Whether to vibrate on invalid input

    Declaration

    Objective-C

    @property (nonatomic) BOOL vibrateOnInvalidInput;

    Swift

    var vibrateOnInvalidInput: Bool { get set }
  • Is the form field currently valid, this does not imply it is completed

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL valid;

    Swift

    var valid: Bool { get }
  • Is the entry completed

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL entryComplete;

    Swift

    var entryComplete: Bool { get }
  • Whether to display as valid

    Declaration

    Objective-C

    @property (nonatomic) BOOL displayAsValid;

    Swift

    var displayAsValid: Bool { get set }
  • Should show a bottom border

    Declaration

    Objective-C

    @property (nonatomic) BOOL bottomBorder;

    Swift

    var bottomBorder: Bool { get set }
  • Should show a top border

    Declaration

    Objective-C

    @property (nonatomic) BOOL topBorder;

    Swift

    var topBorder: Bool { get set }
  • Should show an inter bottom border

    Declaration

    Objective-C

    @property (nonatomic) BOOL interFieldBorder;

    Swift

    var interFieldBorder: Bool { get set }
  • Whether to allow backspace

    Declaration

    Objective-C

    @property (nonatomic) BOOL backspace;

    Swift

    var backspace: Bool { get set }
  • The text displayed by the field

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *text;

    Swift

    var text: String! { get set }
  • The text field

    Declaration

    Objective-C

    @property (nonatomic, strong) BTUIKTextField *textField;

    Swift

    var textField: BTUIKTextField! { get set }
  • The label

    Declaration

    Objective-C

    @property (nonatomic, strong) UILabel *formLabel;

    Swift

    var formLabel: UILabel! { get set }
  • The accessory view shown opposite the label

    Declaration

    Objective-C

    @property (nonatomic, strong) UIView *accessoryView;

    Swift

    var accessoryView: UIView! { get set }
  • Updates the appearance of the form field (e.g if it is invalid it will appear with error colors)

    Declaration

    Objective-C

    - (void)updateAppearance;

    Swift

    func updateAppearance()
  • Update constraints

    Declaration

    Objective-C

    - (void)updateConstraints;

    Swift

    func updateConstraints()
  • Set the accessory view visibility

    Declaration

    Objective-C

    - (void)setAccessoryViewHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setAccessoryViewHidden(_ hidden: Bool, animated: Bool)

    Parameters

    hidden

    The desired hidden state

    animated

    Whether to animate when updating the visibility

  • To be implemented by subclasses. Otherwise does nothing.

    Declaration

    Objective-C

    - (void)resetFormField;

    Swift

    func resetFormField()