Skip to content

Commit fee280a

Browse files
committed
Changed DeepAR installation to swift packages
1 parent 87b7f21 commit fee280a

File tree

5 files changed

+68
-37
lines changed

5 files changed

+68
-37
lines changed

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
# quickstart-ios-swift
22

3-
To run the example
4-
5-
* Go to https://developer.deepar.ai, sign up, create the project and the iOS app, copy the license key and paste it to ViewController.swift (instead of your_license_key_goes_here string)
6-
* Download the SDK from https://developer.deepar.ai and copy the DeepAR.framework into quickstart-ios-swift/Frameworks folder
7-
* In the project settings select quickstart-ios-swift under Targets and:
8-
* Frameworks, Libararies and Embedded content add DeepAR.framework with Embed & Sign option selected
9-
* Go to Build Phases and make sure DeepAR.framework is included in Link Binary With libraries and Embeded Frameworks sections
10-
* Run the project
3+
## Overview
4+
5+
This is an example app demonstrating DeepAR SDK.
6+
7+
- Preview of fun face filters, effects and background replacement.
8+
- Carousel with filter thumbnails.
9+
- Take screenshot.
10+
- Record video.
11+
- Front and back camera.
12+
- Source code demonstrates how to integrate DeepAR for Android in your app.
13+
14+
For more info on DeepAR for iOS see: https://docs.deepar.ai/category/deepar-sdk-for-ios
15+
16+
## How to run
17+
18+
1. Open the project in Xcode.
19+
2. Create a DeepAR developer account: https://developer.deepar.ai/signup.
20+
3. Create a project: https://developer.deepar.ai/projects.
21+
4. Add a iOS app to the project. Note that you need to specify the bundle id of your app. In this case it is "ai.deepar.quickstart-ios".
22+
5. Copy the generated license key in the `ViewController.swift` instead of your_license_key_here.
23+

quickstart-ios-swift.xcodeproj/project.pbxproj

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 52;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -12,6 +12,7 @@
1212
19FB9DAC239E65ED0056E3AB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 19FB9DAA239E65ED0056E3AB /* Main.storyboard */; };
1313
19FB9DAE239E65EE0056E3AB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 19FB9DAD239E65EE0056E3AB /* Assets.xcassets */; };
1414
19FB9DB1239E65EE0056E3AB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 19FB9DAF239E65EE0056E3AB /* LaunchScreen.storyboard */; };
15+
662DAA532A65E36D002DE21D /* DeepAR in Frameworks */ = {isa = PBXBuildFile; productRef = 662DAA522A65E36D002DE21D /* DeepAR */; };
1516
8DF1C83C2852328C002E231B /* Vendetta_Mask.deepar in Resources */ = {isa = PBXBuildFile; fileRef = 8DF1C82A2852328B002E231B /* Vendetta_Mask.deepar */; };
1617
8DF1C83D2852328C002E231B /* Humanoid.deepar in Resources */ = {isa = PBXBuildFile; fileRef = 8DF1C82B2852328B002E231B /* Humanoid.deepar */; };
1718
8DF1C83E2852328C002E231B /* Fire_Effect.deepar in Resources */ = {isa = PBXBuildFile; fileRef = 8DF1C82C2852328B002E231B /* Fire_Effect.deepar */; };
@@ -31,8 +32,6 @@
3132
8DF1C84C2852328C002E231B /* galaxy_background.deepar in Resources */ = {isa = PBXBuildFile; fileRef = 8DF1C83A2852328C002E231B /* galaxy_background.deepar */; };
3233
8DF1C84D2852328C002E231B /* Pixel_Hearts.deepar in Resources */ = {isa = PBXBuildFile; fileRef = 8DF1C83B2852328C002E231B /* Pixel_Hearts.deepar */; };
3334
9A49710124FE579800DD9C86 /* StartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A49710024FE579800DD9C86 /* StartViewController.swift */; };
34-
9AB9D14824EAE3DD00E659AA /* DeepAR.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AB9D14624EAE3D700E659AA /* DeepAR.framework */; };
35-
9AB9D14924EAE3DD00E659AA /* DeepAR.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9AB9D14624EAE3D700E659AA /* DeepAR.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3635
/* End PBXBuildFile section */
3736

3837
/* Begin PBXCopyFilesBuildPhase section */
@@ -42,7 +41,6 @@
4241
dstPath = "";
4342
dstSubfolderSpec = 10;
4443
files = (
45-
9AB9D14924EAE3DD00E659AA /* DeepAR.framework in Embed Frameworks */,
4644
);
4745
name = "Embed Frameworks";
4846
runOnlyForDeploymentPostprocessing = 0;
@@ -76,29 +74,20 @@
7674
8DF1C83A2852328C002E231B /* galaxy_background.deepar */ = {isa = PBXFileReference; lastKnownFileType = file; path = galaxy_background.deepar; sourceTree = "<group>"; };
7775
8DF1C83B2852328C002E231B /* Pixel_Hearts.deepar */ = {isa = PBXFileReference; lastKnownFileType = file; path = Pixel_Hearts.deepar; sourceTree = "<group>"; };
7876
9A49710024FE579800DD9C86 /* StartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartViewController.swift; sourceTree = "<group>"; };
79-
9AB9D14624EAE3D700E659AA /* DeepAR.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = DeepAR.framework; sourceTree = "<group>"; };
8077
/* End PBXFileReference section */
8178

8279
/* Begin PBXFrameworksBuildPhase section */
8380
19FB9D9E239E65EC0056E3AB /* Frameworks */ = {
8481
isa = PBXFrameworksBuildPhase;
8582
buildActionMask = 2147483647;
8683
files = (
87-
9AB9D14824EAE3DD00E659AA /* DeepAR.framework in Frameworks */,
84+
662DAA532A65E36D002DE21D /* DeepAR in Frameworks */,
8885
);
8986
runOnlyForDeploymentPostprocessing = 0;
9087
};
9188
/* End PBXFrameworksBuildPhase section */
9289

9390
/* Begin PBXGroup section */
94-
198B5D56239E96A70035E21B /* Frameworks */ = {
95-
isa = PBXGroup;
96-
children = (
97-
9AB9D14624EAE3D700E659AA /* DeepAR.framework */,
98-
);
99-
path = Frameworks;
100-
sourceTree = "<group>";
101-
};
10291
198B5D5C239FDE4F0035E21B /* Effects */ = {
10392
isa = PBXGroup;
10493
children = (
@@ -129,7 +118,6 @@
129118
children = (
130119
19FB9DA3239E65ED0056E3AB /* quickstart-ios-swift */,
131120
19FB9DA2239E65EC0056E3AB /* Products */,
132-
9A34D6D32429620500FE3662 /* Frameworks */,
133121
);
134122
sourceTree = "<group>";
135123
};
@@ -145,7 +133,6 @@
145133
isa = PBXGroup;
146134
children = (
147135
198B5D5C239FDE4F0035E21B /* Effects */,
148-
198B5D56239E96A70035E21B /* Frameworks */,
149136
19FB9DA4239E65ED0056E3AB /* AppDelegate.swift */,
150137
9A49710024FE579800DD9C86 /* StartViewController.swift */,
151138
19FB9DA8239E65ED0056E3AB /* ViewController.swift */,
@@ -157,13 +144,6 @@
157144
path = "quickstart-ios-swift";
158145
sourceTree = "<group>";
159146
};
160-
9A34D6D32429620500FE3662 /* Frameworks */ = {
161-
isa = PBXGroup;
162-
children = (
163-
);
164-
name = Frameworks;
165-
sourceTree = "<group>";
166-
};
167147
/* End PBXGroup section */
168148

169149
/* Begin PBXNativeTarget section */
@@ -181,6 +161,9 @@
181161
dependencies = (
182162
);
183163
name = "quickstart-ios-swift";
164+
packageProductDependencies = (
165+
662DAA522A65E36D002DE21D /* DeepAR */,
166+
);
184167
productName = "quickstart-ios-swift";
185168
productReference = 19FB9DA1239E65EC0056E3AB /* quickstart-ios-swift.app */;
186169
productType = "com.apple.product-type.application";
@@ -209,6 +192,9 @@
209192
Base,
210193
);
211194
mainGroup = 19FB9D98239E65EC0056E3AB;
195+
packageReferences = (
196+
662DAA512A65E36D002DE21D /* XCRemoteSwiftPackageReference "swift-deepar" */,
197+
);
212198
productRefGroup = 19FB9DA2239E65EC0056E3AB /* Products */;
213199
projectDirPath = "";
214200
projectRoot = "";
@@ -413,7 +399,7 @@
413399
"$(inherited)",
414400
"@executable_path/Frameworks",
415401
);
416-
PRODUCT_BUNDLE_IDENTIFIER = "ai.deepar.quickstart-ios-objc";
402+
PRODUCT_BUNDLE_IDENTIFIER = "ai.deepar.quickstart-ios";
417403
PRODUCT_NAME = "$(TARGET_NAME)";
418404
SWIFT_VERSION = 5.0;
419405
TARGETED_DEVICE_FAMILY = "1,2";
@@ -437,7 +423,7 @@
437423
"$(inherited)",
438424
"@executable_path/Frameworks",
439425
);
440-
PRODUCT_BUNDLE_IDENTIFIER = "ai.deepar.quickstart-ios-objc";
426+
PRODUCT_BUNDLE_IDENTIFIER = "ai.deepar.quickstart-ios";
441427
PRODUCT_NAME = "$(TARGET_NAME)";
442428
SWIFT_VERSION = 5.0;
443429
TARGETED_DEVICE_FAMILY = "1,2";
@@ -466,6 +452,25 @@
466452
defaultConfigurationName = Release;
467453
};
468454
/* End XCConfigurationList section */
455+
456+
/* Begin XCRemoteSwiftPackageReference section */
457+
662DAA512A65E36D002DE21D /* XCRemoteSwiftPackageReference "swift-deepar" */ = {
458+
isa = XCRemoteSwiftPackageReference;
459+
repositoryURL = "https://github.com/DeepARSDK/swift-deepar";
460+
requirement = {
461+
kind = upToNextMajorVersion;
462+
minimumVersion = 5.3.0;
463+
};
464+
};
465+
/* End XCRemoteSwiftPackageReference section */
466+
467+
/* Begin XCSwiftPackageProductDependency section */
468+
662DAA522A65E36D002DE21D /* DeepAR */ = {
469+
isa = XCSwiftPackageProductDependency;
470+
package = 662DAA512A65E36D002DE21D /* XCRemoteSwiftPackageReference "swift-deepar" */;
471+
productName = DeepAR;
472+
};
473+
/* End XCSwiftPackageProductDependency section */
469474
};
470475
rootObject = 19FB9D99239E65EC0056E3AB /* Project object */;
471476
}

quickstart-ios-swift.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

quickstart-ios-swift/Frameworks/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

quickstart-ios-swift/ViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class ViewController: UIViewController {
5959
@IBOutlet weak var arViewContainer: UIView!
6060

6161
private var deepAR: DeepAR!
62-
private var arView: ARView!
62+
private var arView: UIView!
6363

6464
// This class handles camera interaction. Start/stop feed, check permissions etc. You can use it or you
6565
// can provide your own implementation
@@ -116,13 +116,13 @@ class ViewController: UIViewController {
116116

117117
self.deepAR = DeepAR()
118118
self.deepAR.delegate = self
119-
self.deepAR.setLicenseKey("your_licence_key_here")
119+
self.deepAR.setLicenseKey("your_license_key_here")
120120

121121
cameraController = CameraController()
122122
cameraController.deepAR = self.deepAR
123123
self.deepAR.videoRecordingWarmupEnabled = false;
124124

125-
self.arView = (self.deepAR.createARView(withFrame: self.arViewContainer.frame) as! ARView)
125+
self.arView = self.deepAR.createARView(withFrame: self.arViewContainer.frame)
126126
self.arView.translatesAutoresizingMaskIntoConstraints = false
127127
self.arViewContainer.addSubview(self.arView)
128128
self.arView.leftAnchor.constraint(equalTo: self.arViewContainer.leftAnchor, constant: 0).isActive = true

0 commit comments

Comments
 (0)