PTColorPickerViewController


@interface PTColorPickerViewController
    : UIPageViewController <PTOverridable, UIPageViewControllerDataSource>

The PTColorPickerViewController displays a grid of color cells for selection. Selecting a color cell notifies the delegate object.

  • Initializes a newly created PTColorPickerViewController, with the option of setting the colors to display.

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithTransitionStyle:(UIPageViewControllerTransitionStyle)style
          navigationOrientation:
              (UIPageViewControllerNavigationOrientation)navigationOrientation
                        options:
                            (nullable NSDictionary<UIPageViewControllerOptionsKey,
                                                   id> *)options
                         colors:(NSArray<UIColor *> *_Nonnull)colors;

    Swift

    init(transitionStyle style: UIPageViewController.TransitionStyle, navigationOrientation: UIPageViewController.NavigationOrientation, options: [UIPageViewController.OptionsKey : Any]? = nil, colors: [UIColor])

    Parameters

    style

    The style for transitions between pages.

    navigationOrientation

    The orientation of the page-by-page navigation.

    options

    A dictionary of options.

    colors

    An array of 28 colours, that will be displayed in a 4x7 grid.

  • Initializes a newly created PTColorPickerViewController, with the option of setting the colors to display.

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithTransitionStyle:(UIPageViewControllerTransitionStyle)style
          navigationOrientation:
              (UIPageViewControllerNavigationOrientation)navigationOrientation
                        options:
                            (nullable NSDictionary<UIPageViewControllerOptionsKey,
                                                   id> *)options;

    Swift

    init(transitionStyle style: UIPageViewController.TransitionStyle, navigationOrientation: UIPageViewController.NavigationOrientation, options: [UIPageViewController.OptionsKey : Any]? = nil)

    Parameters

    style

    The style for transitions between pages.

    navigationOrientation

    The orientation of the page-by-page navigation.

    options

    A dictionary of options.

  • The currently selected color.

    Declaration

    Objective-C

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

    Swift

    var color: UIColor? { get set }
  • tag

    An identifier that can be used to indicate the type of color being picked.

    Declaration

    Objective-C

    @property (nonatomic, strong) id _Nonnull tag;

    Swift

    var tag: Any { get set }
  • An object that conforms to the PTColorPickerViewControllerDelegate protocol.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<PTColorPickerViewControllerDelegate> colorPickerDelegate;

    Swift

    weak var colorPickerDelegate: (any PTColorPickerViewControllerDelegate)? { get set }
  • If this view controller should resize itself to preferredContentSize. Default is true.

    Declaration

    Objective-C

    @property (nonatomic) BOOL shouldResize;

    Swift

    var shouldResize: Bool { get set }