Skip to content

Networking — 0.21.0

Compare
Choose a tag to compare
@3lvis 3lvis released this 20 Apr 19:45
· 493 commits to master since this release
  • Remove full path image download support
    This was causing a few headaches and it was very inconsistent since you need a base url to start an instance of Networking. Anyway, to alleviate this issues (meaning the fact that you have a full url, instead of a base url and a relative path) we have introduced a new utility method.
  • Split a full url into base url and relative url
public static func splitBaseURLAndRelativePath(path: String) -> (baseURL: String, relativePath: String)

How to use:

let (baseURL, relativePath) = Networking.splitBaseURLAndRelativePath("http://httpbin.org/basic-auth/user/passwd")
// baseURL ~> "http://httpbin.org"
// relativePath ~> "/basic-auth/user/passwd"
  • Add support for custom cache name.
    Downloading an image was using caching by default, caching was done using the downloaded url, a lot of times you want to cache using something different, though, that's why we have introduced a new parameter to provide a cache name when downloading images. If you don't provide a cache name the url will be used.