🛠️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 being utilized. If you're using the old version of Xcode, you may need to update it before usage.

Build from Source

$ git clone https://github.com/elastos/Elastos.DID.Swift.SDK.git
$ cd Elastos.DID.Swift.SDK
$ pod install
$ open ElastosDIDSDK.xcworkspace

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:

pod 'ElastosDIDSDK'

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:

$ sudo gem install cocoapods
$ pod setup

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:

$ touch Podfile
$ open -a Xcode Podfile

Paste the following code snippet into podfile:

target :"YOUR-APP-PROJECT-NAME" do
    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '9.0'
    pod 'ElastosDIDSDK', '~> 2.2.0'
end

Step 3: Download the Dependency Library

Step 3: Download the dependency library

$ pod install

Please open the project using the .xcworkspace generated by Xcode:

$ open <YourProjectName>.xcworkspace

Step 4: Use

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

Last updated