VKHorizontalPicker

public class VKHorizontalPicker : UIView, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, VKCollectionViewLayoutDelegate

Horizontal picker view. This is just a subclass of UIView, contains a UICollectionView.

Readwrite Properties

  • Readwrite. Data source of picker view.

    Declaration

    Swift

    public weak var dataSource: VKHorizontalPickerDataSource?
  • Readwrite. Delegate of picker view.

    Declaration

    Swift

    public weak var delegate: VKHorizontalPickerDelegate? { get set }
  • Readwrite. A font which used in NOT selected cells.

    Declaration

    Swift

    public lazy var font: UIFont { get set }
  • Readwrite. A font which used in selected cells.

    Declaration

    Swift

    public lazy var highlightedFont: UIFont { get set }
  • Readwrite. A color of the text on NOT selected cells.

    Declaration

    Swift

    @IBInspectable
    public lazy var textColor: UIColor { get set }
  • Readwrite. A color of the text on selected cells.

    Declaration

    Swift

    @IBInspectable
    public lazy var highlightedTextColor: UIColor { get set }
  • Readwrite. A float value which indicates the spacing between cells.

    Declaration

    Swift

    @IBInspectable
    public var interitemSpacing: CGFloat
  • Readwrite. The style of the picker view. See VKHorizontalPickerStyle.

    Declaration

    Swift

    public var pickerViewStyle: VKHorizontalPickerStyle
  • Readwrite. A float value which determines the perspective representation which used when using VKHorizontalPickerStyle.Wheel style.

    Declaration

    Swift

    @IBInspectable
    public var viewDepth: CGFloat { get set }
  • Readwrite. A boolean value indicates whether the mask is disabled.

    Declaration

    Swift

    public var maskDisabled: Bool! { get set }

Readonly Properties

  • Readonly. Index of currently selected item.

    Declaration

    Swift

    public private(set) var selectedItem: Int { get }
  • Readonly. The point at which the origin of the content view is offset from the origin of the picker view.

    Declaration

    Swift

    public var contentOffset: CGPoint { get }

View Lifecycle

  • Declaration

    Swift

    public init()
  • Declaration

    Swift

    public override init(frame: CGRect)
  • Declaration

    Swift

    public required init!(coder aDecoder: NSCoder)

Layout

View Controls

  • Reload the picker view’s contents and styles. Call this method always after any property is changed.

    Declaration

    Swift

    public func reloadData()
  • Move to the cell whose index is given one without selection change. :param: item An integer value which indicates the index of cell. :param: animated True if the scrolling should be animated, false if it should be immediate.

    Declaration

    Swift

    public func scrollToItem(_ item: Int, animated: Bool = false)
  • Select a cell whose index is given one and move to it. :param: item An integer value which indicates the index of cell. :param: animated True if the scrolling should be animated, false if it should be immediate.

    Declaration

    Swift

    public func selectItem(_ item: Int, animated: Bool = false)

UICollectionViewDataSource

UICollectionViewDelegateFlowLayout

UICollectionViewDelegate

UIScrollViewDelegate