PTToolGroup


@interface PTToolGroup : NSObject <NSCoding>

The PTToolGroup class encapsulates a list of UIBarButtonItem instances with a title and image to be displayed in a user interface.

This class is similar to the UIBarButtonItemGroup class except that a bar button item can be included in more than one PTToolGroup.

  • Initializes a newly created PTToolGroup instance with the given parameters.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithTitle:(nullable NSString *)title
                           barButtonItems:
                               (nonnull NSArray<UIBarButtonItem *> *)barButtonItems;

    Swift

    convenience init(title: String?, barButtonItems: [UIBarButtonItem])

    Parameters

    title

    The title of the tool group

    barButtonItems

    The list of bar button items for this tool group

    Return Value

    an initialized PTToolGroup instance

  • Initializes a newly created PTToolGroup instance with the given parameters.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithImage:(nullable UIImage *)image
                           barButtonItems:
                               (nonnull NSArray<UIBarButtonItem *> *)barButtonItems;

    Swift

    convenience init(image: UIImage?, barButtonItems: [UIBarButtonItem])

    Parameters

    image

    The image representing the tool group

    barButtonItems

    The list of bar button items for this tool group

    Return Value

    an initialized PTToolGroup instance

  • Initializes a newly created PTToolGroup instance with the given parameters. This method is a designated initializer of the PTToolGroup class.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithTitle:(nullable NSString *)title
                                    image:(nullable UIImage *)image
                           barButtonItems:
                               (nonnull NSArray<UIBarButtonItem *> *)barButtonItems;

    Swift

    init(title: String?, image: UIImage?, barButtonItems: [UIBarButtonItem])

    Parameters

    title

    The title of the tool group

    image

    The image representing the tool group

    barButtonItems

    The list of bar button items for this tool group

    Return Value

    an initialized PTToolGroup instance

  • Returns an object initialized from data in a given unarchiver.

    Declaration

    Objective-C

    - (nullable instancetype)initWithCoder:(nonnull NSCoder *)coder;

    Swift

    init?(coder: NSCoder)

    Parameters

    coder

    An unarchiver object

    Return Value

    self, initialized using the data in decoder, or nil if the object could not be initialized

  • A convenience method that returns a tool group initialized with the specified parameters.

    Declaration

    Objective-C

    + (nonnull instancetype)groupWithTitle:(nullable NSString *)title
                                     image:(nullable UIImage *)image
                            barButtonItems:(nonnull NSArray<UIBarButtonItem *> *)
                                               barButtonItems;

    Parameters

    title

    The title of the tool group

    image

    The image representing the tool group

    barButtonItems

    The list of bar button items for the tool group

    Return Value

    an initialized PTToolGroup instance

  • The title of the tool group.

    Declaration

    Objective-C

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

    Swift

    var title: String? { get set }
  • The image representing the tool group.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIImage *image;

    Swift

    var image: UIImage? { get set }
  • The list of bar button items managed by this tool group.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *barButtonItems;

    Swift

    var barButtonItems: [UIBarButtonItem]? { get set }
  • Whether this tool group is editable from the user interface.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, getter=isEditable) BOOL editable;

    Swift

    var isEditable: Bool { get set }
  • Whether this tool group represents a favorite group.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, getter=isFavorite) BOOL favorite;

    Swift

    var isFavorite: Bool { get set }
  • A string that uniquely identifies this tool group from other groups in a collection of groups or in the user interface.

    The default value of this property is nil.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *identifier;

    Swift

    var identifier: String? { get set }