Skip to content

Commit

Permalink
Merge pull request onevcat#500 from ceyhuno/extension
Browse files Browse the repository at this point in the history
Put `open` functions in extensions into class definition
  • Loading branch information
onevcat authored Nov 6, 2016
2 parents 442c311 + 7ba0d48 commit f5f9e67
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions Sources/ImageCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ open class ImageCache {
deinit {
NotificationCenter.default.removeObserver(self)
}
}

// MARK: - Store & Remove
extension ImageCache {

// MARK: - Store & Remove

/**
Store an image to cache. It will be saved to both memory and disk. It is an async operation.

Expand Down Expand Up @@ -256,11 +256,9 @@ extension ImageCache {
callHandlerInMainQueue()
}
}

}

// MARK: - Get data from cache
extension ImageCache {
// MARK: - Get data from cache

/**
Get an image for a key from memory or disk.

Expand Down Expand Up @@ -370,10 +368,10 @@ extension ImageCache {

return diskImage(forComputedKey: computedKey, serializer: options.cacheSerializer, options: options)
}
}

// MARK: - Clear & Clean
extension ImageCache {

// MARK: - Clear & Clean

/**
Clear memory cache.
*/
Expand Down Expand Up @@ -543,11 +541,9 @@ extension ImageCache {
}
}
#endif
}


// MARK: - Check cache status
extension ImageCache {
// MARK: - Check cache status

/**
* Cache result for checking whether an image is cached for a key.
Expand Down Expand Up @@ -629,7 +625,7 @@ extension ImageCache {
return cachePath(forComputedKey: computedKey)
}

func cachePath(forComputedKey key: String) -> String {
open func cachePath(forComputedKey key: String) -> String {
let fileName = cacheFileName(forComputedKey: key)
return (diskCachePath as NSString).appendingPathComponent(fileName)
}
Expand Down

0 comments on commit f5f9e67

Please sign in to comment.