 
 import Foundation
 
+#if os(iOS)
+    import UIKit
+#endif
+
 public class URLCacheProvider: NSObject, Provider {
     
     public enum MemoryCapacity {

        }
    }
    
    // MARK: -
    
    public func responseForRequest(request: Request, completion: (response: Response) -> Void) {
        let urlRequest = request.toNSURLRequest()

        case .Limit(let bytes):
            assert(bytes > 0, "Invalid memory capacity, .Limit's bytes value should be greater than zero or use .Disable")
            self.memoryCache.totalCostLimit = bytes
            
            #if os(iOS)
                memoryWarningObserver = NSNotificationCenter.defaultCenter().addObserverForName(
                    UIApplicationDidReceiveMemoryWarningNotification,
                    object: UIApplication.sharedApplication(),
                    queue: nil,
                    usingBlock: { [weak self] (notification) -> Void in
                        self?.removeAllResponsesCachedInMemory()
                        return
                    }
                )
            #endif
        }
        self.memoryCache.evictsObjectsWithDiscardedContent = true
        
