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
-
Whether user interface objects should snap to specific orientations during rotation interactions. This switch enables or disables rotation snapping.
Declaration
Swift
public let rotationSnappingEnabled: Bool
-
This threshold defines the arc length of a rotation gesture where snapping at a snap angle occurs. It is measured in points. The default value is
20
.Declaration
Swift
public let rotationSnappingThreshold: CGFloat
-
Whether user interface objects should snap to specific positions during pan interactions. This switch enables or disables position snapping.
Declaration
Swift
public let positionSnappingEnabled: Bool
-
This threshold defines the distance of a pan gesture where snapping at a snap point occurs. It is measured in points. The default value is
20
.Declaration
Swift
public let positionSnappingThreshold: CGFloat
-
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].
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
.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
.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 is0.1
.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 is0.1
.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 is0.1
.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 is0.1
.Declaration
Swift
public let snapToBottom: CGFloat?
-
Creates a new instance of
SnappingOptions
using the given builder.Declaration
Swift
public init(builder: SnappingOptionsBuilder)
Parameters
builder
A
SnappingOptionsBuilder
instance.
-
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 is0.1
.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 is0.1
.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 is0.1
.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 is0.1
.Declaration
Swift
@objc(snapToBottom) open var _objCSnapToBottom: NSNumber? { get }