I am a newbie on Swift and Swift-HTML-Parser. I am using Swift-HTML-Parser from : https://github.com/tid-kijyun/Swift-HTML-Parser
I need some help for below question.
let myURLString = "http://MytestingWebsite.com/MyAds.html"
let myURL = NSURL(string: myURLString)
var error: NSError?
let myHTMLString = NSString(contentsOfURL: myURL, encoding: NSUTF8StringEncoding, error: &error)
if let error = error {
//for below question 2
println("Error : \(error)")
} else {
// code
}
1) How to get the Src of the Image if there is a) only one image b) a collection of images?
< image Src="....."/>
2) What to use to show message when there is an error?
Adding the the required files as per the above link for Swift-HTML-Parser :
1. Add a Bridging file. click Project and goto Building Setting
Use search: type in Bridging
Double click on the result : Objective-C Bridging Header
and Click (+) at the Top to add.
Error msg show: When adding file name with (-) Like Swift-HTML-Parser-Bridging-Header.h
So, I add SwiftHTMLParserBridgingHeader
2) Copy the File Swift-HTML-Parser-Bridging-Header.h and rename it as SwiftHTMLParserBridgingHeader.h in the project file.
3) Copy HTMLParser.Swift and HTMLNode.swift
4) Have added the reference Libxml2.dylib
When compile, (2) and (3) have red dot. Am I doing something wrong?