DropdownView

@objcMembers public final class DropdownView: UIView

A view that resembles a dropdown. It contains a text field with a dropdown arrow image.

e.g.

 =========

| ITEM  ▼ |

 =========
  • The current text of the dropdown

    Declaration

    Swift

    public var text: String?
  • The font for the dropdown text

    Declaration

    Swift

    public var textFont: UIFont?
  • The color for the dropdown text

    Declaration

    Swift

    public var textColor: UIColor?
  • The background color of the area inside the dropdown

    Declaration

    Swift

    public var dropDownBackgroundColor: UIColor?
  • The horizontal spacing to use for elements within the dropdown

    Declaration

    Swift

    public var horizontalSpacing = CGFloat(6)
  • The vertical spacing to use for elements within the dropdown

    Declaration

    Swift

    public var verticalSpacing = CGFloat(2)
  • The dropdown border’s color

    Declaration

    Swift

    public var borderColor: UIColor?
  • The dropdown border’s width

    Declaration

    Swift

    public var borderWidth: CGFloat
  • The dropdown border’s corner radius

    Declaration

    Swift

    public var borderCornerRadius: CGFloat
  • The image to use for the drop down view

    Declaration

    Swift

    public var dropDownArrowImage: UIImage?
  • An optional size to use for the drop down arrow view

    Declaration

    Swift

    public var dropDownArrowImageSize: CGSize?
  • The tint color to use for the drop down arrow.

    Declaration

    Swift

    public var dropDownArrowTintColor: UIColor!
  • Delegate for receiving events that occur on this dropdown

    Declaration

    Swift

    public weak var delegate: DropdownViewDelegate?
  • Initializer with an optional drop down arrow image.

    Declaration

    Swift

    public init(dropDownArrowImage: UIImage? = nil)
  • Calculates the required size of a theoretical DropDownView instance (dropDownView) based on if properties were set that instance.

    Declaration

    Swift

    public static func measureSize(
        text: String, dropDownArrowImageSize: CGSize, textFont: UIFont, borderWidth: CGFloat,
             horizontalSpacing: CGFloat, verticalSpacing: CGFloat) -> CGSize

    Return Value

    The required size of the theoretical instance dropDownView

  • Returns the default drop down arrow image for the dropdown view.

    Declaration

    Swift

    public static func defaultDropDownArrowImage() -> UIImage?

    Return Value

    The UIImage containing the default drop down arrow.

  • Returns the size to use for the default drop down arrow image.

    Declaration

    Swift

    public static func defaultDropDownArrowImageSize() -> CGSize

    Return Value

    A CGSize.