Skip to content
Used to integrate iOS apps with ArcBlock Platform.
Branch: master
Clone or download
jonathanlu813 Merge pull request #44 from ArcBlock/update-for-swift-5
Update for compatibility with Swift5
Latest commit 9bc057e Apr 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.makefiles fix make release Jul 12, 2018
ABSDKAccountKit run jazzy in root directory Jun 13, 2018
ABSDKAccountKitTests fix license file and add license to file header Jun 12, 2018
ABSDKCoreKit Update for compatibility with Swift5 Apr 23, 2019
ABSDKCoreKitTests remove legacy codes and useless dependency Jul 4, 2018
ABSDKMessagingKit run jazzy in root directory Jun 13, 2018
ABSDKMessagingKitTests fix license file and add license to file header Jun 12, 2018
ABSDKWalletKit run jazzy in root directory Jun 13, 2018
ABSDKWalletKitTests fix license file and add license to file header Jun 12, 2018
ArcBlockSDK.xcodeproj Update for compatibility with Swift5 Apr 23, 2019
Carthage/Checkouts remove legacy codes and useless dependency Jul 4, 2018
Example support function input Nov 16, 2018
Templates/ArcBlock add tempalte for custom view Aug 21, 2018
images add quick start example and restructure documentation Aug 22, 2018
.gitignore add jazzy config for generating documentation Jun 12, 2018
.jazzy.yaml bump version Apr 23, 2019
.swiftlint.yml add tempalte for custom view Aug 21, 2018
.travis.yml update travis image version Apr 23, 2019
ArcBlockSDK.podspec bump version Apr 23, 2019
CHANGELOG.md bump version Apr 23, 2019
Cartfile Update for compatibility with Swift5 Apr 23, 2019
Cartfile.private Update for compatibility with Swift5 Apr 23, 2019
Cartfile.resolved Update for compatibility with Swift5 Apr 23, 2019
Client.CN.md add chinese version for data binding he quick start document Sep 13, 2018
Client.md add quick start example and restructure documentation Aug 22, 2018
DataBinding.CN.md Update DataBinding.CN.md Sep 13, 2018
DataBinding.md add FAQ Aug 22, 2018
LICENSE fix license file and add license to file header Jun 12, 2018
Makefile add quick start example and restructure documentation Aug 22, 2018
QuickStart.CN.md Update QuickStart.CN.md Sep 13, 2018
QuickStart.md add FAQ Aug 22, 2018
README.CN.md add chinese version for data binding he quick start document Sep 13, 2018
README.md add chinese readme Sep 12, 2018
version bump version Apr 23, 2019

README.md

ArcBlock iOS SDK

Build Status Carthage compatible

Welcome to ArcBlock iOS SDK! This is what you need to integrate your iOS apps with ArcBlock Platform. The ArcBlock iOS SDK is based on the Apollo project found here.

For Chinese version of this document, please go here

Requirements

The ArcBlock iOS SDK is compatible with apps supporting iOS 9 and above and requires Xcode 9 to build from source.

Installation

CocoaPods

ArcBlockSDK is available through CocoaPods. To install it, simply add the following lines to your Podfile:

pod 'ArcBlockSDK', :git => 'https://github.com/ArcBlock/arcblock-ios-sdk.git'
pod 'Apollo', :git => 'https://github.com/ArcBlock/apollo-ios.git'

Carthage

To integrate ArcBlockSDK into your Xcode project using Carthage, specify it in your Cartfile:

github "ArcBlock/arcblock-ios-sdk"

Run carthage to build the framework and drag the built frameworks into your Xcode project.

XCode File Templates(Optional)

ArcBlockSDK provides some XCode file templates for you to get started more quickly. To install them, run the following command:

wget http://ios-docs.arcblock.io/Templates.tar.gz; \
tar -xvf Templates.tar.gz --strip-components=1 --directory ~/Library/Developer/Xcode/Templates/File\ Templates/; \
rm Templates.tar.gz

Usage

For a quick start, please check our Quick Start Guide. It will walk you through the easiest way to build an app that connects to the ArcBlock platform.

If you want to be more flexible and use the SDK in a lower level, please check out Data Binding, Client and the Class Reference

FAQ

Q: What kind of things I can do with this SDK?

This SDK helps you connect to the ArcBlock OCAP service, and the OCAP service capabilities can be found in its documentation.

Q: Do I have to write GraphQL queries in OCAP Playground?

You need to write GraphQL queries to communicate with OCAP service. You can write the queries in your text editor, but it's just easier to do so in the Playground. Besides, you'll need to generate Swift codes for your queries in the Playbook, and it's easier to convert queries in the Playground to a playbook.

Q: Do I have to generate Swift codes in Playbook?

Yes. The generated codes are Swift wrappers for your queries, which help enforce type safety. It's required by Apollo which is the base of this SDK. But instead of having to run the codegen commands on your own(the Apollo way), the process is now integrated into the playbook, which is more natural.

Q: I got "Code Generation Error: Apollo does not support anonymous operations" error when generating codes. What's wrong?

This means that you need to give names to your queries. For example, this is an anonymous operation:

{
  richestAccounts {
    data {
      address
      balance
    }
  }
} 

While this is a named operation

query RichestAccounts {
  richestAccounts {
    data {
      address
      balance
    }
  }
} 

We need every operation to be named to generate Swift codes.

Q: Do I have to install the file templates?

No, it's optional. The file templates are for you to create ViewController and View faster. The base classes the templates are using, ABSDKTableViewController for example, can be inherited without using the file templates.

Q: I don't want to inherit the UI classes provided by the SDK, rather I would like to write my own UI, what should I do?

That's totally fine. You can use the SDK just on the data level by using the ABSDKDataSource. You can find more detail here.

Q: What kind of operations are supported?

Currently, we support Query and Subscription, since the OCAP service offers these two types of interfaces. Mutation will be supported shortly.

License

ArcBlockSDK is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.