BPKHorizontalNavigation

@interface BPKHorizontalNavigation : UIControl

A BPKHorizontalNavigation is a control comprising of multiple segments, where each acts as a discrete button.

  • The options to display within the navigation.

    see BPKHorizontalNavigationOptionType

    Declaration

    Objective-C

    @property (nonatomic, copy) NSArray<id<BPKHorizontalNavigationOptionType>> *_Nonnull options;

    Swift

    var options: [BPKHorizontalNavigationOptionType] { get set }
  • The size of the horizontal navigation.

    see BPKHorizontalNavigationSize

    Declaration

    Objective-C

    @property (nonatomic) BPKHorizontalNavigationSize size;

    Swift

    var size: BPKHorizontalNavigationSize { get set }
  • Whether to show a bar under the selected item

    Declaration

    Objective-C

    @property (nonatomic) BOOL showsSelectedBar;

    Swift

    var showsSelectedBar: Bool { get set }
  • The index of the currently selected item. By default the first item is selected. If the index is out of bounds for the options available (eg -1) then no item will be selected.

    Declaration

    Objective-C

    @property (nonatomic) NSInteger selectedItemIndex;

    Swift

    var selectedItemIndex: Int { get set }
  • A delegate that can be informed of changes to the selection.

    Declaration

    Objective-C

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

    Swift

    weak var delegate: BPKHorizontalNavigationDelegate? { get set }
  • Create a BPKHorizontalNavigation with a set of options and an initally selected option.

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithOptions:
            (nonnull NSArray<id<BPKHorizontalNavigationOptionType>> *)options
               selected:(NSInteger)selectedItemIndex;

    Swift

    init(options: [BPKHorizontalNavigationOptionType], selected selectedItemIndex: Int)

    Parameters

    options

    NSArray> the options displayed.

    selectedItemIndex

    NSInteger the initially selected item.