Sample code for 30+ languages & platforms
Swift

Example: Http.GetCacheRoot method

Demonstrates the GetCacheRoot method.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    let http = CkoHttp()!

    // Establish 2 cache root directories.
    http.addCacheRoot(dir: "c:/example/httpCacheA/")
    http.addCacheRoot(dir: "c:/example/httpCacheB/")

    print("Number of cache roots: \(http.numCacheRoots.intValue)")

    print("1st cache root: \(http.getCacheRoot(index: 0)!)")
    print("2nd cache root: \(http.getCacheRoot(index: 1)!)")

    // Output:

    // Number of cache roots: 2
    // 1st cache root: c:/example/httpCacheA/
    // 2nd cache root: c:/example/httpCacheB/

}