Enums
The following enums are available globally.
-
A representation of a linear direction.
- topToBottom: the animation will run with top views animating first and then bottom views animating last
- bottomToTop: the animation will run with bottom views animating first and then top views animating last
- leftToRight: the animation will run with left views animating first and right views animating last
- rightToLeft: the animation will run with right views animating first and left views animating last
Declaration
Swift
public enum Direction
-
Direction that a slide animation should use.
- up: start the view below its current position, and then slide upwards to where it currently is
- down: start the view above its current position, and then slide downwards to where it currently is
- left: start the view to the right of its current position, and then slide left to where it currently is
- right: start the view to the left of its current position, and then slide right to where it currently is
Declaration
Swift
public enum SlideDirection
-
How much the angle of an animation should change. This value changes based off of which type of
StockAnimation
is used.- slightly: slightly animate the object
- moderately: the object should move a moderate amount
- severely: the object should move very noticeably
- toAngle: provide your own angle value that you feel the object should rotate
Declaration
Swift
public enum Angle
-
How much the scale of an animation should change. This value changes based off of which type of
StockAnimation
is used.- slightly: slightly animate the object
- moderately: the object should scale a moderate amount
- severely: the object should scale very noticeably
- toScale: provide your own scale value that you feel the object should grow/shrink
Declaration
Swift
public enum Scale
-
How much the distance of a view animation should change. This value changes based off of which type of
StockAnimation
is used.- slightly: slightly move the object
- moderately: the object should move a moderate amount
- severely: the object should move very noticeably
- byPoints: provide your own distance value that you feel the object should slide over
Declaration
Swift
public enum Distance
-
A few stock animations that you can use with Spruce. We want to make it really easy for you to include animations so we tried to include the basics. Use these stock animations to
See moreslide
,fade
,spin
,expand
, orcontract
your views.Declaration
Swift
public enum StockAnimation
-
A position on the screen. Use this to define specific locations on the screen where the animation should start
See moreDeclaration
Swift
public enum Position
-
Represents the weighted values for computation
- light: a small value, 0.5
- medium: a default value, 1.0
- heavy: a large value, 2.0
- custom: you can specify your own value for weight
Declaration
Swift
public enum Weight