I'm currently working on learning Swift 3 and I'm trying to implement an XML parser that parses data from a URL. I've created a separate file to handle the XML parsing and have setup it as follows.
let xmlDoc = NSURL(string: "http://labs.bible.org/api/?passage=random&type=xml")
var parser1 = XMLParser(contentsOf: xmlDoc)
I'm currently having issues with syntax however. Swift is highlighting the line where I initialize the XML Parser and giving the error "Cannot use instance member 'xmlDoc' within property initializer, property initializers run before 'self' is available.
This is probably something really simple but I wasn't able to find a solution in my google searches.
Any feedback is appreciated!
-Alex