Latest 0.1.0-beta
Homepage https://github.com/brunomacabeusbr/RuAWSS3
License MIT
Platforms ios 8.0
Dependencies AWSS3, PromiseKit
Authors

CI Status
Version
License
Platform

Since AWS’s official library is extremely complicated, I decided to make one to simplify the work.
All asynchrony is performed using PromiseKit. You need to know the concept of promise; if you don’t know, see it.

alt text

Run the example project

  1. Clone the repo
  2. Run pod install from the Example directory first
  3. Open AppDelegate.swift
  4. Update application(_:didFinishLaunchingWithOptions) with your Amazon’s credentials

Installation

RuAWSS3 is available through CocoaPods. To install
it, add the following line to your Podfile:

pod 'RuAWSS3', '~> 0.1.0-beta'

And, add in your AppDelegate.swift:

import RuAWSS3
...

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

  AmazonS3.shared.performCredentials(
      regionType: ** YOUR REGION **,
      identityPoolId: ** YOUR POOL ID **
  )

  return true
}

Usage

Firstly, you need import this modules:

import PromiseKit
import RuAWSS3

Upload image

firstly {
    AmazonS3.shared.uploadImage(
        bucket: "example",
        key: "image.jpg",
        image: UIImage(named: "example")!
    )
}.then {
    print("succes õ/")
}.catch { error in
    print("fail ;-;")
    print((error as NSError).localizedDescription)
}

Download image

firstly {
    AmazonS3.shared.download(
        bucket: "example",
        key: "image.jpg"
    )
}.then { filePath -> Void in
    print("succes õ/")
    self.imgView.image = UIImage(contentsOfFile: filePath)!
}.catch { error in
    print("fail ;-;")
    print((error as NSError).localizedDescription)
}

Delete file

firstly {
    AmazonS3.shared.delete(
        bucket: "example",
        key: "image.jpg"
    )
}.then {
    print("succes õ/")
}.catch { error in
    print("fail ;-;")
    print((error as NSError).localizedDescription)
}

You can see others amazing examples in Example application.

Author

Macabeus, [email protected]

License

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

Latest podspec

{
    "name": "RuAWSS3",
    "version": "0.1.0-beta",
    "summary": "Ridiculously Uncomplicated AWS S3",
    "description": "This pod abstracts the (unnecessarily) complicated Amazon's official library for S3.nAlso, asynchronous calls are encapsulated with PromiseKit.",
    "homepage": "https://github.com/brunomacabeusbr/RuAWSS3",
    "screenshots": "http://i.imgur.com/ubPEHUL.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Macabeus": "[email protected]"
    },
    "source": {
        "git": "https://github.com/brunomacabeusbr/RuAWSS3.git",
        "tag": "0.1.0-beta"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "RuAWSS3/Classes/**/*",
    "dependencies": {
        "AWSS3": [
            "~> 2.4.16"
        ],
        "PromiseKit": [
            "~> 4.0"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This