SnappingOptions

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKSnappingOptions)
open class SnappingOptions : NSObject

Options for configuring snapping behavior.

  • Whether sprites, e.g., stickers, texts, or text designs, should snap to specific positions and/or orientations during pan or rotation interactions. This switch enables or disables any snapping at all. The detailed snapping behavior can be configured with the snapTo* configuration options. Snapping is enabled by default.

    Declaration

    Swift

    public let snappingEnabled: Bool
  • Enabled snapping angles in degrees for rotating a sprite. The rotation angle is defined clockwise. The default value is [0, 45, 90, 135, 180, 225, 270, 315].

    Note

    snappingEnabled must be set to true otherwise this option is ignored.

    Declaration

    Swift

    public let snapToAngles: [Int]
  • If enabled a sprite’s center snaps to the horizontal line through the center of the edited image. The default value is true.

    Note

    snappingEnabled must be set to true otherwise this option is ignored.

    Declaration

    Swift

    public let snapToHorizontalCenterLine: Bool
  • If enabled a sprite’s center snaps to the vertical line through the center of the edited image. The default value is true.

    Note

    snappingEnabled must be set to true otherwise this option is ignored.

    Declaration

    Swift

    public let snapToVerticalCenterLine: Bool
  • If not nil the left side of a sprite’s bounding box snaps to a vertical line which is shifted by this value from the left side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. The default value is 0.1.

    Note

    snappingEnabled must be set to true otherwise this option is ignored.

    Declaration

    Swift

    public let snapToLeft: CGFloat?
  • If not nil the right side of a sprite’s bounding box snaps to a vertical line which is shifted by this value from the right side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. The default value is 0.1.

    Note

    snappingEnabled must be set to true otherwise this option is ignored.

    Declaration

    Swift

    public let snapToRight: CGFloat?
  • If not nil the top side of a sprite’s bounding box snaps to a horizontal line which is shifted by this value from the top side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. The default value is 0.1.

    Note

    snappingEnabled must be set to true otherwise this option is ignored.

    Declaration

    Swift

    public let snapToTop: CGFloat?
  • If not nil the bottom side of a sprite’s bounding box snaps to a horizontal line which is shifted by this value from the bottom side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. The default value is 0.1.

    Note

    snappingEnabled must be set to true otherwise this option is ignored.

    Declaration

    Swift

    public let snapToBottom: CGFloat?
  • Creates a new instance of SnappingOptions using the given builder.

    Declaration

    Swift

    public init(builder: SnappingOptionsBuilder)

    Parameters

    builder
  • If not nil the left side of a sprite’s bounding box snaps to a vertical line which is shifted by this value from the left side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. The default value is 0.1.

    Note

    snappingEnabled must be set to true otherwise this option is ignored.

    Declaration

    Swift

    @objc(snapToLeft)
    open var _objCSnapToLeft: NSNumber? { get }
  • If not nil the right side of a sprite’s bounding box snaps to a vertical line which is shifted by this value from the right side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. The default value is 0.1.

    Note

    snappingEnabled must be set to true otherwise this option is ignored.

    Declaration

    Swift

    @objc(snapToRight)
    open var _objCSnapToRight: NSNumber? { get }
  • If not nil the top side of a sprite’s bounding box snaps to a horizontal line which is shifted by this value from the top side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. The default value is 0.1.

    Note

    snappingEnabled must be set to true otherwise this option is ignored.

    Declaration

    Swift

    @objc(snapToTop)
    open var _objCSnapToTop: NSNumber? { get }
  • If not nil the bottom side of a sprite’s bounding box snaps to a horizontal line which is shifted by this value from the bottom side of the edited image towards its center. This value is measured in normalized coordinates relative to the smaller side of the edited image. The default value is 0.1.

    Note

    snappingEnabled must be set to true otherwise this option is ignored.

    Declaration

    Swift

    @objc(snapToBottom)
    open var _objCSnapToBottom: NSNumber? { get }