Build and Installation
This document, which helps developers quickly understand how to use DID, is mainly focused on Swift. The following instructions are written for versions Xcode10.0 and above, with IOS11 SDK bring utilized. If you're using the old version of Xcode, you may need to update it before usage.

Build from Source

1
$ git clone https://github.com/elastos/Elastos.DID.Swift.SDK.git
2
$ cd Elastos.DID.Swift.SDK
3
$ pod install
4
$ open ElastosDIDSDK.xcworkspace
Copied!
Then you can open ElastosDIDSDKTests to run the unit tests.

Use Cocapods

Use CocoaPods to integrate the Elastos DID SDK into the project, and specify in podfile:
1
pod 'ElastosDIDSDK'
Copied!

Step 1: Download CocoaPods

As the dependency manager of Swift, CocoaPods simplifies the process of using third-party libraries such as DID. CocoaPods is installed by running the following command in the terminal app:
1
$ sudo gem install cocoapods
2
$ pod setup
Copied!

Step 2: Create podfile

The project dependency that Cocoapods needs to manage is specified in the podfile. Create this file in the directory same as that of the Xcode project (.xcodeproj) and cd it to the root directory of the project to run the following command:
1
$ touch Podfile
2
$ open -a Xcode Podfile
Copied!
Paste the following code snippet into podfile:
1
target :"YOUR-APP-PROJECT-NAME" do
2
source 'https://github.com/CocoaPods/Specs.git'
3
platform :ios, '9.0'
4
pod 'ElastosDIDSDK', '~> 2.2.0'
5
end
Copied!

Step 3: Download the Dependency Library

Step 3: Download the dependency library
1
$ pod install
Copied!
Please open the project using the .xcworkspace generated by Xcode:
1
$ open <YourProjectName>.xcworkspace
Copied!

Step 4: Use

At this time, you can use the Elastos DIDS DK by importing it.