I'm currently working on learning Swift 3, and I'm trying to implement an XML parser that parses data from a URL. I created a separate file for XML parsing and configured it as follows.
let xmlDoc = NSURL(string: "http://labs.bible.org/api/?passage=random&type=xml") var parser1 = XMLParser(contentsOf: xmlDoc)
I am currently having problems with the syntax. Swift selects the line in which I initialize the XML parser and give the error "I can not use the member instance" xmlDoc "in the property initializer, the property initializers start up to" self ".
This is probably something very simple, but I could not find a solution in my search engines.
Any feedback is appreciated!
for -Alex-
ios swift
Alexander Clark
source share