BufferSwiftKit 0.1.2

BufferSwiftKit 0.1.2

TestsTested โœ“
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2016
SPMSupports SPM โœ—

Maintained by Andrew Yates, Jordan Morgan, Humber Aquino, Humber Aquino.



 
Depends on:
Moya>= 0
ObjectMapper>= 0
 

  • By
  • Humberto Aquino, Andrew Yates and Jordan Morgan

BufferSwiftKit is a Swift based SDK to access the Buffer API. The main goal is to provide a simple and easy interface to use Buffer in your iOS apps.

Sample code

// Can get the token from https://buffer.com/developers/api
// Or use OAuth 2.0. See the demo project for a sample

let token = "...."

let bufferClient = MoyaBufferClient(token: token)

bufferClient.getProfiles({ (profiles) -> Void in
    print("All right! You have \(profiles.count) profiles!")
}, failure: { (error) -> Void in
    print(error)
})

Project status

This project is actively under development. Currently, we support Xcode 7 and Swift 2.

How to get started

  1. Install BufferSwiftkit in your project
  2. Create a Buffer developer account
  3. Setup the client and start using the Kit

1. Install

2. Buffer developer account

Go to https://buffer.com/developers/api and create an app.

After completing the the process you receive the Client secret in your email. Youโ€™ll need it configure OAuth 2.0 ๐Ÿ‘.

The rest of the app information is located here. Your application should look similar to this:

image

3. Setup client

BufferKitClient just needs a token to interact with the API. So, you could use the provided access token listed in the appโ€™s description for simple apps. Or, you can use OAuth 2.0 to request for a token associated with a particular user.

  • Single token method: Is simpler and is preferred while prototyping your awesome app ๐ŸŽ‰๐Ÿ“ฑ๐Ÿ˜„!
  • OAuth 2.0 token method: This is the recommended approach for production apps. Libraries like OAuthSwift and OAuth2 are recommended if you use this method.

Demo project

To use the demo project you just have to open:

open Demo/BufferSwiftKit\ Demo.xcworkspace

And run it with cmd+r. The app will prompt for the Buffer API token once.

In case you want to provide the API token programmatically you can do that inside the AppDelegate file. The line to change will look like this:

 AuthManager.sharedManager.accessToken = "Insert token here"

Features

  • [x] Callback based API support for iOS
  • [x] Swift 2 support
  • [x] OSX support
  • [x] tvOS support
  • [x] Carthage support
  • [ ] Linux support
  • [ ] RXSwift support

Coding style

We adhere to the Raywenderlich Swift coding style.

ChangeLog

Please visit the CHANGELOG.md file.

Going Forward

We are always happy to talk shop, so feel free to give us a shout on Twitter:

Or, hey - Wanna come join us!? Weโ€™re hiring!

License

BufferSwiftKit is released under the MIT license. See LICENSE for details.