With a few lines of Swift, sign documents in legally-binding fashion using Adobe Sign. Here's a short example of what this framework can help you achieve.
- Adobe Sign credentials.
- iOS 9.0.
- Swift 3.
AdobeSign is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "AdobeSign"
To make use of AdobeSign
in your own iOS application, follow these two steps:
- Add the
import AdobeSign
line to yourAppDelegate
. - Call the
configureAdobeSign
method from yourAppDelegate
'sdidFinishLaunchingWithOptions
method with the appropriate values.
All of the AdobeSign REST API endpoints can be accessed using the following model: Sign.{service}.{endpoint}
(where {service}
corresponds to agreements
, views
, etc.)
Sign.login(completion: { success, error in
guard success else {
return
}
// your code
})
Assuming that data
is of type Data
, and that fileName
is a String
of the form file.pdf
:
Sign.transientDocuments.create(data: data, fileName: fileName, mimeType: "application/pdf", completion: { result, error in
guard let result = result, let transientDocumentId = result["transientDocumentId"] as? String else {
return
}
// your code
})
Assuming that parameters
is of type [String: Any]
:
Sign.agreements.create(parameters: parameters, completion: { result, error in
guard let result = result, let agreementId = result["agreementId"] as? String else {
return
}
// your code
})
Additional samples are included in the Example project.
To run the example project, clone the repo, and run pod install
from the Example directory first.
Then, replace the 4 instances of <YOURS>
in AppDelegate.swift
and the 1 instance in AgreementViewController.swift
by the appropriate values.
Build and run, and you should be good to go!
Designed and developed by Elliott Bolzan.
AdobeSign is available under the MIT license. See the LICENSE file for more info.