Hi,
first of all: thanks for this all!
As a total beginner in both swift and ... eh... this here (;-)) I managed to add everything to an existing project but there were two sections leaving me with error messages from Xcode. One of them was just a usage of outdated code. The warning said:
"characters is deprecated". So I changed it:
old:
text.characters.count
new:
text.count
I'm having a real pain with the other issue. It's in the file Client.swift
There's the following block:
struct Client{
static func networkRequest(url: String, parameters: [String : AnyObject], completion: @escaping (ClientReturn) -> ()) -> (){
var cReturn = ClientReturn()
HTTPRequest.request(url, parameters: parameters){
rtn in // <- here's the error!
if rtn.2 == nil{
let json = try! JSON(data: rtn.0!)
cReturn.error = nil
cReturn.json = json
if(json["page"].exists()){
cReturn.pageResults = PageResultsMDB.init(results: json)
}else{
cReturn.pageResults = nil
}
}else{
cReturn.error = rtn.2 as NSError?
cReturn.json = nil
cReturn.pageResults = nil
}
completion(cReturn)
}
where it says "rtn in" there's an error message saying:
"Contextual closure type '(Data?, URLResponse?, Error?) -> ()' expects 3 arguments, but 1 was used in closure body".
It advises:
"Insert ',<#arg#>,<#arg#> '"
Can anyone tell me what to do here? I've never heard of that. I searched the web for this but I just don't get the cases described there.
Thanks in advance and have a great week
Patrick
P.S.: I'm totally new to GitHub but I thought this might be the right place to ask this. If not, please don't be angry :-/