-
Notifications
You must be signed in to change notification settings - Fork 47
/
index.html
337 lines (313 loc) · 18.7 KB
/
index.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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
<!DOCTYPE html>
<html lang="en">
<head>
<title>SCSDKCameraKitReferenceUI 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 title="SCSDKCameraKitReferenceUI Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
SCSDKCameraKitReferenceUI 1.37.0 Docs
</a>
(60% 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">SCSDKCameraKitReferenceUI Reference</a>
<img class="carat" src="img/carat.png" alt=""/>
SCSDKCameraKitReferenceUI 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/AdjustmentControlView.html">AdjustmentControlView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/AdjustmentControlView/Variant.html">– Variant</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/BundleHelper.html">BundleHelper</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CameraActionsView.html">CameraActionsView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CameraBottomBar.html">CameraBottomBar</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CameraButton.html">CameraButton</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CameraButton.html#/s:25SCSDKCameraKitReferenceUI12CameraButtonC9ConstantsO">– Constants</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CameraConfigurableActionView.html">CameraConfigurableActionView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CameraController.html">CameraController</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CameraController/PointOfInterestOptions.html">– PointOfInterestOptions</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CameraController/FlashMode.html">– FlashMode</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CameraController/FlashState.html">– FlashState</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CameraView.html">CameraView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CameraViewController.html">CameraViewController</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CarouselCollectionViewCell.html">CarouselCollectionViewCell</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CarouselCollectionViewLayout.html">CarouselCollectionViewLayout</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CarouselItem.html">CarouselItem</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/CarouselView.html">CarouselView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/ControlSlider.html">ControlSlider</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/DefaultCarouselImageLoader.html">DefaultCarouselImageLoader</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/EmptyItem.html">EmptyItem</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/FlashControlView.html">FlashControlView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/FlashModeSelectionView.html">FlashModeSelectionView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/ImagePreviewViewController.html">ImagePreviewViewController</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/KeyboardAccessoryViewProvider.html">KeyboardAccessoryViewProvider</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/MediaPickerView.html">MediaPickerView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/MessageNotificationView.html">MessageNotificationView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/PreviewViewController.html">PreviewViewController</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/Recorder.html">Recorder</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/RingLightColorSelectionView.html">RingLightColorSelectionView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/RingLightColorSelectionViewCell.html">RingLightColorSelectionViewCell</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/RingLightGradientView.html">RingLightGradientView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/RingLightView.html">RingLightView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SnapAttributionView.html">SnapAttributionView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/TapAnimationView.html">TapAnimationView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/UserDataProvider.html">UserDataProvider</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/VideoPreviewViewController.html">VideoPreviewViewController</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/CameraBottomBarElements.html">CameraBottomBarElements</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/CameraElements.html">CameraElements</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/CameraElements/CameraFlip.html">– CameraFlip</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/CarouselElements.html">CarouselElements</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/FlashControlElements.html">FlashControlElements</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/MessageNotificationElements.html">MessageNotificationElements</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/OtherElements.html">OtherElements</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/OutputSizeHelper.html">OutputSizeHelper</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/PreviewElements.html">PreviewElements</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SnapchatScreen.html">SnapchatScreen</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/NSString.html">NSString</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/UIButton.html">UIButton</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/UIColor.html">UIColor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/UIFont.html">UIFont</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/UIImage.html">UIImage</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/UILabel.html">UILabel</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:25SCSDKCameraKitReferenceUI06CameraB15LocalizedString3key6bundle18preferredLanguages7comment5tableS2S_So8NSBundleCSgSaySSGSSSgALtF">CameraKitLocalizedString(key:bundle:preferredLanguages:comment:table:)</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/AdjustmentControlViewDelegate.html">AdjustmentControlViewDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/AppOrientationDelegate.html">AppOrientationDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/CameraButtonDelegate.html">CameraButtonDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/CameraControllerUIDelegate.html">CameraControllerUIDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/CarouselCollectionViewLayoutDataSource.html">CarouselCollectionViewLayoutDataSource</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/CarouselCollectionViewLayoutDelegate.html">CarouselCollectionViewLayoutDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/CarouselImageLoader.html">CarouselImageLoader</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/CarouselViewDataSource.html">CarouselViewDataSource</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/CarouselViewDelegate.html">CarouselViewDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/ControlSliderDelegate.html">ControlSliderDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/FlashControlViewDelegate.html">FlashControlViewDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/FlashModeSelectionViewDelegate.html">FlashModeSelectionViewDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/MediaPickerViewDelegate.html">MediaPickerViewDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/RingLightColorSelectionViewDelegate.html">RingLightColorSelectionViewDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/SnapchatDelegate.html">SnapchatDelegate</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/TestableElement.html">TestableElement</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content top-matter">
<h1 id='camerakit-reference-ui-ios' class='heading'>CameraKit Reference UI iOS</h1>
<h2 id='overview' class='heading'>Overview</h2>
<p><code>SCSDKCameraKitReferenceUI</code> is an optional SDK that provides reference UI elements similar to Snapchat’s UI as well as a fully-functional Camera view controller that has CameraKit set up and working with sample lenses. The elements provided in this SDK are designed to be used in a modular fashion, so it is easy to use certain UI elements out of the box while changing the design or functionality of other elements.</p>
<h3 id='usage-philosophy' class='heading'>Usage Philosophy</h3>
<p>In general, the UI elements in <code>SCSDKCameraKitReferenceUI</code> are intended to be used out-of-the-box and they provide customizations to tailor the behavior slightly (eg. changing the recording duration of the camera button). The UI elements are also designed to be extended, changed, and used in a modular fashion – for example, using our carousel, camera button, and recorder together to record a video with a lens, but showing it in your own video preview view can easily be done using these elements out-of-the-box.</p>
<h2 id='getting-started' class='heading'>Getting Started</h2>
<h3 id='requirements' class='heading'>Requirements</h3>
<p><code>SCSDKCameraKitReferenceUI</code> requires Swift, a minimum of iOS 11, and a 64 bit processor.</p>
<h3 id='dependency-management' class='heading'>Dependency Management</h3>
<p>CameraKit currently supports CocoaPods and Swift Package Manager.</p>
<h4 id='cocoapods' class='heading'>CocoaPods</h4>
<p>Add this line to your <code>Podfile</code>:
<code>pod 'SCSDKCameraKitReferenceUI', :path => 'CameraKit/CameraKitReferenceUI'</code>
where <code>:path</code> points to the directory that contains the camera kit sdk, podspec, etc.</p>
<p>Run <code>pod install</code> and open up your <code>xcworkspace</code>.</p>
<h4 id='swift-package-manager' class='heading'>Swift Package Manager</h4>
<ul>
<li>Drag and drop the <code>CameraKit/CameraKitReferenceUI</code> file into your project or workspace.</li>
<li>Click the + button in the “Frameworks, Libraries, and Embedded Content” section, select <code>SCSDKCameraKitReferenceUI</code>, and add it as a dependency.</li>
</ul>
<p>More detail can be found in <a href="https://developer.apple.com/documentation/swift_packages/organizing_your_code_with_local_packages">Apple’s documentation</a>.</p>
<h3 id='showing-the-camera' class='heading'>Showing the Camera</h3>
<p>At its most simplest form, <code>SCSDKCameraKitReferenceUI</code> contains a fully-setup camera that contains all UI elements (carousel, camera button, recorder, etc.) and hooks up to the core <code>SCSDKCameraKit</code> sdk to fetch and apply lenses to the camera. This can be easily set up and presented by doing the following:</p>
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">cameraViewController</span> <span class="o">=</span> <span class="kt">CameraViewController</span><span class="p">(</span><span class="nv">repoGroups</span><span class="p">:</span> <span class="p">[</span><span class="s">"5685839489138688"</span><span class="p">])</span>
<span class="nf">present</span><span class="p">(</span><span class="n">cameraViewController</span><span class="p">,</span> <span class="nv">animated</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kc">nil</span><span class="p">)</span>
</code></pre>
<p>where <code>repoGroups</code> is the list of group IDs added in Lens Scheduler to show in the carousel.</p>
</div>
</section>
</article>
</div>
<section class="footer">
<p>© 2024 <a class="link" href="https://kit.snapchat.com/camera-kit" target="_blank" rel="external noopener">Snap Inc.</a>. All rights reserved. (Last updated: 2024-12-11)</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>