UIBarButtonItem

class UIBarButtonItem : UIBarItem, NSCoding

This extesion adds some useful functions to UIBarButtonItem.

  • Create an UIBarButtonItem with type setted to FlexibleSpace or FixedSpace.

    Declaration

    Swift

    public convenience init(barButtonSpaceType space: UIBarButtonItem.SystemItem, width: CGFloat = 0.0)

    Parameters

    space

    Must be FlexibleSpace or FixedSpace, otherwise a FlexibleSpace UIBarButtonItem will be created.

    width

    To use only if space is setted to FixedSpace, and it will be the width of it.