Closed waritsan closed 7 years ago
Hm, weird. This does't show up for me. Can you inspect what the return type of the .URL
method of SwiftyJSON is? It should already be a URL.
In my case it returns an NSURL. I'm using this SwiftyJSON https://github.com/IBM-Swift/SwiftyJSON.git. Which version do you use?
//MARK: - URL
extension JSON {
//Optional URL
public var URL: NSURL? {
get {
switch self.type {
case .string:
guard let encodedString_ = self.rawString.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed) else {
return nil
}
return NSURL(string: encodedString_)
default:
return nil
}
}
set {
#if os(Linux)
self.object = newValue?.absoluteString._bridgeToObjectiveC()
#else
self.object = newValue?.absoluteString
#endif
}
}
}
Oh I see in Cartfile you have github "appsailor/SwiftyJSON" "swift3". Let me try that.
Pointing to appsailor/SwiftyJSON works for me now
Xcode 8 requires me to make theses type casting changes in order to build successfully.