BPKNavigationBar

@interface BPKNavigationBar : UIView

A navigation bar component similar to UINavigationBar from UIKit implementing the iOS 11 style large title pattern.

  • A BPKNavigationBarButton to show on the left side inside the navigation

    Declaration

    Objective-C

    @property (nonatomic, strong) BPKNavigationBarButton *_Nonnull leftButton;

    Swift

    var leftButton: BPKNavigationBarButton { get set }
  • A BPKNavigationBarButton to show on the right side inside the navigation

    Declaration

    Objective-C

    @property (nonatomic, strong) BPKNavigationBarButton *_Nonnull rightButton;

    Swift

    var rightButton: BPKNavigationBarButton { get set }
  • The title text to display in the navigation bar

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nonnull title;

    Swift

    var title: String { get set }
  • Set the color of the large title. When nil the default color, BPKColor.skyGray` will be used.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIColor *largeTitleTextColor;

    Swift

    var largeTitleTextColor: UIColor? { get set }
  • The layout margins for the large title.

    Declaration

    Objective-C

    @property (nonatomic) UIEdgeInsets largeTitleLayoutMargins;

    Swift

    var largeTitleLayoutMargins: UIEdgeInsets { get set }
  • The text alignment of the large title text.

    Declaration

    Objective-C

    @property (nonatomic) NSTextAlignment largeTitleTextAlignment;

    Swift

    var largeTitleTextAlignment: NSTextAlignment { get set }
  • Initializes and returns a newly allocated navigation bar by decoding a NSCoder

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCoder:(nonnull NSCoder *)aDecoder;

    Swift

    init(coder aDecoder: NSCoder)

    Parameters

    aDecoder

    The decoder to deocde

    Return Value

    An initialized BPKNavigationBar

  • Initializes and returns a newly allocated navigation bar with a specific frame

    Declaration

    Objective-C

    - (nonnull instancetype)initWithFrame:(CGRect)frame;

    Swift

    init(frame: CGRect)

    Parameters

    frame

    The frame to use

    Return Value

    An initialized BPKNavigationBar

  • Prepare the navigation bar for use with a UIScrollView. This method should be called in viewDidLoad or at another appropriate time in the view lifecycle. This method must be called before any calls to updateWithScrollView:.

    Declaration

    Objective-C

    - (void)setUpForScrollview:(nonnull UIScrollView *)scrollView;

    Swift

    func setUp(for scrollView: UIScrollView)

    Parameters

    scrollView

    The scrollview that the receiver will track.

  • Update the state of the navigation bar based on the state of the UIScrollView that this navigation bar tracks. Users should call this method everytime the scrollview scrolls by implementing scrollViewDidScroll:.

    Declaration

    Objective-C

    - (void)updateWithScrollView:(nonnull UIScrollView *)scrollView;

    Swift

    func update(with scrollView: UIScrollView)

    Parameters

    scrollView

    The scrollview to base updates on.

  • Will adjust the UIScrollView if necessary in order to ensure that the title is fully visible. Users should call this method everytime the scrollview ends decelerating using scrollViewDidEndDecelerating:, and also everytime the scrollview ends dragging (unless it will decelerate) using scrollViewDidEndDragging:willDecelerate.

    Declaration

    Objective-C

    - (void)makeTitleVisibleWithScrollView:(nonnull UIScrollView *)scrollView;

    Swift

    func makeTitleVisible(with scrollView: UIScrollView)

    Parameters

    scrollView

    The scrollview to base updates on.