Installing Kanna

Three means of installation are supported:

  1. CocoaPods
  2. Carthage
  3. Manually

CocoaPods

⚠️ CocoaPods (0.39 or later) is required.

Adding it to your Podfile:

use_frameworks!
pod 'Kanna', '~> 1.1.0'

Carthage

Adding it to your Cartfile:

github "tid-kijyun/Kanna" ~> 1.1.0

Manual Installation

  1. Add these files to your project:
    Kanna.swift
    CSS.swift
    libxmlHTMLDocument.swift
    libxmlHTMLNode.swift
    libxmlParserOption.swift
  2. In the target settings add $(SDKROOT)/usr/include/libxml2 to the Search Paths > Header Search Paths field
  3. In the target settings add -lxml2 to the Linking > Other Linker Flags field
  4. Import libxml headers: Copy the those import statements: #import <libxml/HTMLtree.h> #import <libxml/xpath.h> #import <libxml/xpathInternals.h> and paste them into your [Modulename]-Bridging-Header.h

Note: With manual installation, this library doesn’t need to be imported, or namespace-qualified in your code.