Latest 1.0.0-alpha1
Homepage https://github.com/kazuhiro4949/Alamofire-SwiftyXMLParser
License MIT
Platforms ios 8.0, requires ARC
Dependencies Alamofire, SwiftyXMLParser
Authors

Carthage compatible Cocoapods compatible

Useful Extension to combine Alamofire and SwiftyXMLParser

Requirements

  • iOS 8.0+
  • Swift 2.0+

Installation

Carthage

1. create Cartfile

github "Alamofire/Alamofire"
github "yahoojapan/SwiftyXMLParser"
github "kazuhiro4949/Alamofire-SwiftyXMLParser"

2. install

> carthage update

CocoaPods

1. create Podfile

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

pod 'Alamofire-SwiftyXMLParser'

2. install

> pod install

Example

import Alamofire
import SwiftyXMLParser
import Alamofire_SwiftyXMLParser

Alamofire.request(.GET, "https://itunes.apple.com/us/rss/topgrossingapplications/limit=10/xml").responseXML { response in
   if let xml = response.result.value {
      print(xml["feed", "entry", 0, "title"].text) // outputs the top title of iTunes app raning.
  }
}

Usage

1. import Alamofire, SwiftyXMLParser and Alamofire_SwiftyXMLParser

import Alamofire
import SwiftyXMLParser
import Alamofire_SwiftyXMLParser

2. call responseXML(_:)

let request = Alamofire.request(.GET, "https://itunes.apple.com/us/rss/topgrossingapplications/limit=10/xml")

request.responseXML { response in
   if let xml = response.result.value {
      print(xml["feed", "entry", 0, "title"].text) // outputs the top title of iTunes app raning.
  }
}

Alamofire callbacks a parsed value with SwiftyXMLParser.

LICENSE

Copyright (c) 2016 Kazuhiro Hayashi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Latest podspec

{
    "name": "Alamofire-SwiftyXMLParser",
    "version": "1.0.0-alpha1",
    "summary": "Alamofire extension for serialize NSData to SwiftyXMLParser",
    "homepage": "https://github.com/kazuhiro4949/Alamofire-SwiftyXMLParser",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "tangplin": "[email protected]"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/kazuhiro4949/Alamofire-SwiftyXMLParser.git",
        "tag": "1.0.0-alpha1"
    },
    "source_files": "Alamofire-SwiftyXMLParser/*.swift",
    "dependencies": {
        "Alamofire": [
            "3.3.1"
        ],
        "SwiftyXMLParser": [
            "1.0.0"
        ]
    }
}

Pin It on Pinterest

Share This