PTAnnotationStylePresetsGroup


@interface PTAnnotationStylePresetsGroup : NSObject <NSCopying, NSCoding>

A group of PTAnnotStyle instances for the same annotation type with one style denoted as the selected style.

  • Initializes a newly created PTAnnotationStylePresetsGroup instance with the specified styles.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithStyles:
        (nonnull NSArray<PTAnnotStyle *> *)styles;

    Swift

    init(styles: [PTAnnotStyle])

    Parameters

    styles

    the initial styles of the presets group

    Return Value

    an initialized PTAnnotationStylePresetsGroup 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

  • The list of style presets in this preset group.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSArray<PTAnnotStyle *> *_Nonnull styles;

    Swift

    var styles: [PTAnnotStyle] { get set }
  • The index of the currently selected style preset in the styles property.

    If styles is empty, the value of this property is NSNotFound.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger selectedIndex;

    Swift

    var selectedIndex: UInt { get set }
  • The currently selected style preset in the styles property.

    If styles is empty, the value of this property is nil.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) PTAnnotStyle *selectedStyle;

    Swift

    weak var selectedStyle: PTAnnotStyle? { get set }