CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

AlamofireSwiftSoup 1.0.0

AlamofireSwiftSoup 1.0.0

Maintained by Adar Porat.



 
Depends on:
Alamofire~> 5
SwiftSoup~> 2
 

  • By
  • Adar Porat

AlamofireSwiftSoup

Build Status Cocoapods Swift Xcode MIT

Installation

The recommended approach for installing AlamofireSwiftSoup is via the CocoaPods package manager, as it provides flexible dependency management and dead simple installation.

Install CocoaPods if not already available:

$ [sudo] gem install cocoapods
$ pod setup

Edit your Podfile and add AlamofireSwiftSoup:

$ edit Podfile
platform :ios, '12.0'

pod 'AlamofireSwiftSoup'

Install into your Xcode project:

$ pod install

Usage

import AlamofireSwiftSoup
AF.request("https://httpbin.org/").responseSwiftSoupHTML { dataResponse in
  switch dataResponse.result {
  case .failure(let error):
    debugPrint(error)
  case .success(let document):
    if let scriptElement = try? document.select("title").first(), let titleString = try? scriptElement.html() {
      debugPrint(titleString)
    }
  }
}