Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

Latest commit

 

History

History
69 lines (43 loc) · 2.47 KB

getting-started.md

File metadata and controls

69 lines (43 loc) · 2.47 KB
id title
getting-started
Getting Started

Requirements

iOS 8.0+ / macOS 10.10+
Xcode 9.0+

Swift installation

Swift is the alternative to Object-C by Apple. To get started, head over to the official guide.

Swift can be downloaded here.

For further information on how to install Swift, go on the Installation section off the same page.

CocoaPods

CocoaPods is a dependency manager for Swift (and Objective-C) Cocoa Projects.

Install CocoaPods

To install CocoaPods, head over to the official guide.

Install package with CocoaPods

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

'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.

    git clone https://github.com/<githubusername>/swift-client
  3. Next, move into the fresh cloned directory.

    cd swift-client/Client
  4. Install the dependencies.

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

    carthage 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.