SDK支持iOS 9.0以上系统。
Xcode 9或更高版本。
OS X 10.10 或更高版本。
项目中已使用 cocoapods,直接跳过步骤b阅读步骤c
在项目根目录,执行 pod init && pod install,可得到 Podfile 文件
打开 Podfile 文件,如下添加增加剪同款的依赖
source 'https://cdn.cocoapods.org/' platform:ios, '9.0' # {zh} CKSDK目录与Podfile的相对路径 {en} CKSDK relative path to Podfile $CKSDK_RELATIVE_PATH = "./CK" def cutsame_pods pod 'TTVideoEditor', '11.8.1.36-D',:source => 'https://github.com/volcengine/volcengine-specs.git' pod 'NLEPlatform', '0.5.2', :source => 'https://github.com/volcengine/volcengine-specs.git' pod 'DVEInject', '0.0.5', :source => 'https://github.com/volcengine/volcengine-specs.git' pod 'CKi18n', :path => "#$CKSDK_RELATIVE_PATH/CKi18n" pod 'NLEEditor', :subspecs => ['CKStandard'], :path => "#$CKSDK_RELATIVE_PATH/NLEEditor-iOS" pod 'DVETrackKit', :subspecs => ['CKStandard'], :path => "#$CKSDK_RELATIVE_PATH/DVETrackKit" pod 'DVEFoundationKit', :path => "#$CKSDK_RELATIVE_PATH/DVEFoundationKit" pod 'CKEditor', :subspecs => ['CKStandard'], :path => "#$CKSDK_RELATIVE_PATH/CKEditor" pod 'CKRRecorder', :subspecs => ['Arch'], :path => "#$CKSDK_RELATIVE_PATH/CKRRecorder" pod 'CKResource', :path => "#$CKSDK_RELATIVE_PATH/CKResource" pod 'CKOBase', :path => "#$CKSDK_RELATIVE_PATH/CKO/CKOBase" pod 'CKOBusiness', :subspecs => ['CKStandard'], :path => "#$CKSDK_RELATIVE_PATH/CKO/CKOBusiness" pod 'CKOLog', :subspecs => ['FileImpl', 'Editor'], :path => "#$CKSDK_RELATIVE_PATH/CKO/CKOLog" pod 'CKOCutSame', :path => "#$CKSDK_RELATIVE_PATH/CKO/CKOCutSame" pod 'CutSameIF', :path => "#$CKSDK_RELATIVE_PATH/CutSameIF" pod 'CutSameUIIF', :path => "#$CKSDK_RELATIVE_PATH/CutSameUIIF", :subspecs => ['CK','PTK'] end # 将'CKOne'改为你自己项目的target!!! target '你自己项目的target' do #剪同款 cutsame_pods end
将后文 Demo中的CK目录copy到您的项目中,与Podfile同级的目录下(和上面Podfile中的配置匹配)
进入 TARGETS > Project Name >Build Setting
选择 All ,搜索 bitcode
Enable Bitcode 选择 NO
找到项目中的 info.plist 文件
使用源码的方式显示plist,然后添加以下权限字段信息
```objectivec
将我们提供给您的license替换到下图位置,包名和license匹配
将我们提供给您的资源文件替换下图对应目录中,然后执行pod install,打开.xcworkspace运行
再在Development Pods 代码修改对应appkey和token
如搭建自己的服务来拉取模板或特效数据,可在初始化处配置自己的host等
```objectivec
// {zh} 模板拉取服务配置 {en} Template pull service configuration
CSIFTemplateFetcherConfig *templateFetcherConfig = [[CSIFTemplateFetcherConfig alloc] init];
templateFetcherConfig.host = [CSIFConfigViewController cutsameHost];
// {zh} 特效服务配置 {en} Special effects service configuration CSIFEffectFetcherConfig *effectFetcherConfig = [[CSIFEffectFetcherConfig alloc] init]; effectFetcherConfig.host = templateFetcherConfig.host; effectFetcherConfig.modelListPath = @"/api/modellistinfo"; effectFetcherConfig.effectListPath = @"/api/effectlist";
<br> #### 步骤五: 进入剪同款页面 导入下面的头文件即可跳转到剪同款模板列表页 ```objectivec #import <CKOBase/CKORouter.h> - (void)viewDidLoad { [super viewDidLoad]; ///跳到剪同款的页面 [CKORouter toCutSame]; }
info.plist 添加 开启 http 请求权限
```javascript
- 手机设置----蜂窝网络 点击勾选 “无线局域网与蜂窝数据” ![](https://portal.volccdn.com/obj/volcfe/cloud-universal-doc/upload_4f19c93a4e676bc42d5a59b24d387347.jpg) 2. ##### 运行报错 “unrecognized selector ...” ![](https://portal.volccdn.com/obj/volcfe/cloud-universal-doc/upload_6e74b43d0f66c97a76402b001240d232.jpg) 解决办法:新建的项目需在AppDelegate中添加window属性 ![](https://portal.volccdn.com/obj/volcfe/cloud-universal-doc/upload_69733ac30892210f41bbd6001f40fd08.jpg) 或者 ![](https://portal.volccdn.com/obj/volcfe/cloud-universal-doc/upload_b331fc93c4e96711a86d3ede952539b8.png) <br> 3. ##### 运行提示 “**鉴权失败, 请检查证书设置!”** 解决办法: - 检查自身bundle identifier 是否和 技术客服提供的授权文件匹配 - 确保代码读取的授权文件是否和实际的bundle identifier 匹配 <br> 4. ##### 如Xcode14运行后出现pod组件签名问题,可尝试在Podfile中添加: ```objectivec post_install do |installer| installer.generated_projects.each do |project| project.targets.each do |target| target.build_configurations.each do |config| # {zh} 解决 Xcode14 签名问题 {en} [Xcode 14 build failed with manual code sign and app resource bundles](https://github.com/CocoaPods/CocoaPods/issues/11402) config.build_settings['CODE_SIGN_IDENTITY'] = '-' config.build_settings['CODE_SIGN_ENTITLEMENTS'] = '-' config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO' config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' end end end end