Setting value and key for Haneke Shared.JSONCache is throwing an error

148 Views Asked by At

I'm trying to cache json I get back from a service using HanekeSwift but I get a syntax error saying "Cannot invoke 'set' with an argument list of type '(value: JSON, key:String, formatName: String, success: (_) -> _)'"

Here is my code for setting the cache:

let cache = Shared.JSONCache
var myJON = SwiftyJSON.JSON(responseData)
cache.set(value: myJSON, key: "key", formatName: HanekeGlobals.Cache.OriginalFormatName, success: {resultData in

})

This worked fine for me when I cached images as NSData. Only difference now is that my cache is a Shared.JSONCache and the value is of JSON type.

0

There are 0 best solutions below