Client

Install package with CocoaPods

To integrate the ARK Swift Client in your project, add the following content to your Podfile :

1'SwiftClient', :git => 'https://github.com/ArkEcosystem/swift-client.git', :tag => '1.0.1'

Afterward, install it by running pod install.

Development

  1. Fork the package .
  2. Clone your forked repository.
1git clone https://github.com/<githubusername>/swift-client
  1. Next, move into the fresh cloned directory.
1cd swift-client/Client
  1. Install the dependencies.

For this you will first need to install Carthage , which can be done quickly with Homebrew: brew install carthage

1carthage update

You will also need to install Swiftlint as an additional step, as that is used to lint our code. The easiest way to install this is by using Homebrew: brew install swiftlint.

Dependencies are now installed, you can now run the tests to see if everything is running like it should by opening the Client.xcodeproj in Xcode.

Additional Information

By default, the requests are performed with Alamofire , and the response is given to the callback function as [String: Any]. The functions that are responsible for this can be found in Utils.swift. You can easily override this default functionality by defining your own handleApiGet and handleApiPost functions and passing them to the endpoint object (e.g. Blocks. An example of how this is done can be found by looking at the tests, e.g. those of Blocks , as a mocked api handler is used for them.

Last updated 3 years ago
Edit Page
Share: