-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathEnums.html
264 lines (242 loc) · 13.6 KB
/
Enums.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<!DOCTYPE html>
<html lang="en">
<head>
<title>Enumerations Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset="utf-8">
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Section/Enumerations" class="dashAnchor"></a>
<a title="Enumerations Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
Wave
</a>
(100% documented)
</p>
<div class="header-col--secondary">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</div>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="index.html"> Reference</a>
<img class="carat" src="img/carat.png" alt=""/>
Enumerations Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/LayerAnimator.html">LayerAnimator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/Spring.html">Spring</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SpringAnimator.html">SpringAnimator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SpringAnimator/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/ViewAnimator.html">ViewAnimator</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/Wave.html">Wave</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/AnimationMode.html">AnimationMode</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/AnimatorState.html">AnimatorState</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/CALayer.html">CALayer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/CGFloat.html">CGFloat</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/CGPoint.html">CGPoint</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/CGRect.html">CGRect</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/CGSize.html">CGSize</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions.html#/s:4Wave14RGBAComponentsV">RGBAComponents</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/UIView.html">UIView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/WaveColor.html">WaveColor</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Functions.html">Functions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Functions.html#/s:4Wave4clip5value5lower5upperxx_xxtSFRzlF">clip(value:lower:upper:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Functions.html#/s:4Wave8clipUnit5valuexx_tSFRzlF">clipUnit(value:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Functions.html#/s:4Wave8mapRange_____4clipxx_xxxxSbtSFRzlF">mapRange(_:_:_:_:_:clip:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Functions.html#/s:4Wave8mapRange5value5inMin0E3Max03outF00hG04clipxx_xxxxSbtSFRzlF">mapRange(value:inMin:inMax:outMin:outMax:clip:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Functions.html#/s:4Wave7project5point8velocity16decelerationRateSo7CGPointVAG_AG12CoreGraphics7CGFloatVtF">project(point:velocity:decelerationRate:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Functions.html#/s:4Wave7project5value8velocity16decelerationRate12CoreGraphics7CGFloatVAH_A2HtF">project(value:velocity:decelerationRate:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Functions.html#/s:4Wave10rubberband5value5range8interval1c12CoreGraphics7CGFloatVAI_SNyAIGA2ItF">rubberband(value:range:interval:c:)</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SpringInterpolatable.html">SpringInterpolatable</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/VelocityProviding.html">VelocityProviding</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/WaveColor">WaveColor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:4Wave0A5Colora">WaveColor</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content top-matter">
<h1>Enumerations</h1>
<p>The following enumerations are available globally.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:4Wave13AnimationModeO"></a>
<a name="//apple_ref/swift/Enum/AnimationMode" class="dashAnchor"></a>
<a class="token" href="#/s:4Wave13AnimationModeO">AnimationMode</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The mode that determines whether a block should be animated or not.</p>
<p>The default mode is <code>animated</code>, but the <code>nonAnimated</code> mode should be used
when you want to interrupt an existing animation and “snap” to some new values instead.</p>
<p>For example, the example below animates a circle from left to right:</p>
<pre class="highlight swift"><code><span class="kt">Wave</span><span class="o">.</span><span class="nf">animate</span><span class="p">(</span><span class="nv">spring</span><span class="p">:</span> <span class="n">spring</span><span class="p">,</span> <span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">animated</span><span class="p">)</span> <span class="p">{</span>
<span class="n">circle</span><span class="o">.</span><span class="n">animator</span><span class="o">.</span><span class="n">center</span> <span class="o">=</span> <span class="kt">CGPoint</span><span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="mi">500</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="mi">100</span><span class="p">)</span>
<span class="p">}</span>
</code></pre>
<p>Suppose while the animation is running, you decide that the circle should snap to its final position.
Simply calling:</p>
<pre class="highlight swift"><code><span class="n">circle</span><span class="o">.</span><span class="n">center</span> <span class="o">=</span> <span class="kt">CGPoint</span><span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="mi">500</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="mi">100</span><span class="p">)</span>
</code></pre>
<p>will set the <code>center</code> value, but <code>center</code> will be overridden in the next frame because the animator is still running.</p>
<p>For this to snap to its final <code>center</code> value correctly, we need to use a <code>nonAnimated</code> mode:</p>
<pre class="highlight swift"><code><span class="kt">Wave</span><span class="o">.</span><span class="nf">animate</span><span class="p">(</span><span class="nv">spring</span><span class="p">:</span> <span class="n">spring</span><span class="p">,</span> <span class="nv">mode</span><span class="p">:</span> <span class="o">.</span><span class="n">nonAnimated</span><span class="p">)</span> <span class="p">{</span>
<span class="n">circle</span><span class="o">.</span><span class="n">animator</span><span class="o">.</span><span class="n">center</span> <span class="o">=</span> <span class="kt">CGPoint</span><span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="mi">500</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="mi">100</span><span class="p">)</span>
<span class="p">}</span>
</code></pre>
<a href="Enums/AnimationMode.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">AnimationMode</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:4Wave13AnimatorStateO"></a>
<a name="//apple_ref/swift/Enum/AnimatorState" class="dashAnchor"></a>
<a class="token" href="#/s:4Wave13AnimatorStateO">AnimatorState</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The current state of an <code>Animation</code>.</p>
<a href="Enums/AnimatorState.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">AnimatorState</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>© 2022 <a class="link" href="https://github.com/jtrivedi" target="_blank" rel="external noopener">Janum Trivedi</a>. All rights reserved. (Last updated: 2022-11-14)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
</html>