Swiftpack.co - Package - Xinguang/AlamofireSwiftyJSON

AlamofireSwiftyJSON

Build Status Swift version Carthage compatible CocoaPods compatible SwiftLint codecov.io GitHub release


Easy way to use both Alamofire and SwiftyJSON

Requirements

  • iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 8.1+
  • Swift 3.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build AlamofireSwiftyJSON.

To integrate AlamofireSwiftyJSON into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'AlamofireSwiftyJSON'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

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

github "Xinguang/AlamofireSwiftyJSON"

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

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but AlamofireSwiftyJSON does support its use on supported platforms.

Once you have your Swift package set up, adding AlamofireSwiftyJSON as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .Package(url: "https://github.com/Xinguang/AlamofireSwiftyJSON.git", majorVersion: 1)
]

Usage

let URL = "http://httpbin.org/get"
Alamofire.request(URL, method: .get, parameters: ["foo": "bar"]).responseSwiftyJSON { response in
  print("###Success: \(response.result.isSuccess)")
  //now response.result.value is SwiftyJSON.JSON type
  print("###Value: \(response.result.value?["args"].array)")
}

Github

link
Stars: 28
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

1.0.1 - Jan 16, 2018

Updated swift version to 4.0 && Updated SwiftyJson to 4.0

1.0.0 - Jun 30, 2017

Supports Swift Package Manager

0.2.0 - Sep 30, 2016

Alamofire 4 + Swift3 support

0.1.1 - May 18, 2016

0.1.0 - Jan 30, 2016