Просмотр исходного кода

Put `open` functions in extensions into class definition

Ceyhun Ozugur 9 лет назад
Родитель
Сommit
c362408fc0
1 измененных файлов с 10 добавлено и 14 удалено
  1. 10 14
      Sources/ImageCache.swift

+ 10 - 14
Sources/ImageCache.swift

@@ -148,10 +148,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.
     
@@ -243,11 +243,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.
     
@@ -357,10 +355,10 @@ extension ImageCache {
         
         return diskImage(forComputedKey: computedKey, serializer: options.cacheSerializer, options: options)
     }
-}
 
-// MARK: - Clear & Clean
-extension ImageCache {
+
+    // MARK: - Clear & Clean
+
     /**
     Clear memory cache.
     */
@@ -530,11 +528,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.
@@ -616,7 +612,7 @@ extension ImageCache {
         return cachePath(forComputedKey: computedKey)
     }
 
-    func cachePath(forComputedKey key: String) -> String {
+    fileprivate func cachePath(forComputedKey key: String) -> String {
         let fileName = cacheFileName(forComputedKey: key)
         return (diskCachePath as NSString).appendingPathComponent(fileName)
     }