PinImageViewCollisionAnimator
class PinImageViewCollisionAnimator
Helper class animates pin image with physics
-
Physics related animation
Declaration
Swift
var snapAnimator: UIDynamicAnimator? -
Snap behavior
Declaration
Swift
var snapBehavior: UISnapBehavior? -
Reference view that will serves as the coordinate system
Declaration
Swift
weak var referenceView: UIView? -
Pin Image view
Declaration
Swift
weak var pinImageView: UIView? -
Prepares helper class with necessary parameters.
Preparemethod should be called before usingmovePinDeclaration
Swift
func prepare(referenceView: UIView, pinImageView: UIView)Parameters
referenceViewReference view that will serves as the coordinate system
pinImageViewPin Image View
-
Moves pin with animation and physics, simulating the collision effect
Declaration
Swift
func movePin(force: Double, angle: CGFloat, position: SFWConfiguration.Position)Parameters
forceThe force that will affect to collision effect, should be more than 0
angleThe angle which will be rotated the Pin Image View
positionPinImageView’s position
-
Moves pin with animation and physics, simulating the collision effect
Declaration
Swift
func movePinIfNeeded(collisionEffect: CollisionEffect?, position: SFWConfiguration.Position?)Parameters
collisionEffectCollision effect object
positionPinImageView’s position
PinImageViewCollisionAnimator Class Reference