diff --git a/Cache.podspec b/Cache.podspec index 68d13665..9f6be18f 100644 --- a/Cache.podspec +++ b/Cache.podspec @@ -7,9 +7,13 @@ Pod::Spec.new do |s| s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" } s.source = { :git => "https://github.com/hyperoslo/Cache.git", :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/hyperoslo' - s.platform = :ios, '8.0' + + s.ios.deployment_target = '8.0' + s.osx.deployment_target = '10.9' + s.requires_arc = true - s.source_files = 'Source/**/*' + s.ios.source_files = 'Source/{iOS,Shared}/**/*' + s.osx.source_files = 'Source/{Mac,Shared}/**/*' - s.frameworks = 'UIKit', 'Foundation' + s.frameworks = 'Foundation' end diff --git a/Cache.xcodeproj/project.pbxproj b/Cache.xcodeproj/project.pbxproj index c04ce14a..43a7fda0 100644 --- a/Cache.xcodeproj/project.pbxproj +++ b/Cache.xcodeproj/project.pbxproj @@ -7,310 +7,469 @@ objects = { /* Begin PBXBuildFile section */ - D5DC59EB1C20593E003BD79B /* Cache.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5DC59E01C20593E003BD79B /* Cache.framework */; }; - D5DC5A471C205AC9003BD79B /* Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A1B1C205AC9003BD79B /* Cache.swift */; }; - D5DC5A481C205AC9003BD79B /* HybridCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A1C1C205AC9003BD79B /* HybridCache.swift */; }; - D5DC5A491C205AC9003BD79B /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A1D1C205AC9003BD79B /* Config.swift */; }; - D5DC5A4A1C205AC9003BD79B /* Cachable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A201C205AC9003BD79B /* Cachable.swift */; }; - D5DC5A4B1C205AC9003BD79B /* Capsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A211C205AC9003BD79B /* Capsule.swift */; }; - D5DC5A4C1C205AC9003BD79B /* Expiry.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A221C205AC9003BD79B /* Expiry.swift */; }; - D5DC5A4D1C205AC9003BD79B /* JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A231C205AC9003BD79B /* JSON.swift */; }; - D5DC5A4E1C205AC9003BD79B /* StorageKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A241C205AC9003BD79B /* StorageKind.swift */; }; - D5DC5A4F1C205AC9003BD79B /* JSON+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A261C205AC9003BD79B /* JSON+Cache.swift */; }; - D5DC5A501C205AC9003BD79B /* NSData+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A271C205AC9003BD79B /* NSData+Cache.swift */; }; - D5DC5A511C205AC9003BD79B /* NSDate+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A281C205AC9003BD79B /* NSDate+Cache.swift */; }; - D5DC5A521C205AC9003BD79B /* String+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A291C205AC9003BD79B /* String+Cache.swift */; }; - D5DC5A531C205AC9003BD79B /* UIImage+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A2A1C205AC9003BD79B /* UIImage+Cache.swift */; }; - D5DC5A541C205AC9003BD79B /* DefaultCacheConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A2C1C205AC9003BD79B /* DefaultCacheConverter.swift */; }; - D5DC5A551C205AC9003BD79B /* DiskStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A2E1C205AC9003BD79B /* DiskStorage.swift */; }; - D5DC5A561C205AC9003BD79B /* MemoryStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A2F1C205AC9003BD79B /* MemoryStorage.swift */; }; - D5DC5A571C205AC9003BD79B /* StorageAware.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A301C205AC9003BD79B /* StorageAware.swift */; }; - D5DC5A581C205AC9003BD79B /* StorageFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A311C205AC9003BD79B /* StorageFactory.swift */; }; - D5DC5A591C205AEF003BD79B /* SpecHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A001C205AC9003BD79B /* SpecHelper.swift */; }; - D5DC5A5A1C205B04003BD79B /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC59FD1C205AC9003BD79B /* User.swift */; }; - D5DC5A5B1C205B07003BD79B /* UIImage+CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC59FF1C205AC9003BD79B /* UIImage+CacheTests.swift */; }; - D5DC5A5C1C205B12003BD79B /* CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A031C205AC9003BD79B /* CacheSpec.swift */; }; - D5DC5A5D1C205B16003BD79B /* ConfigSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A041C205AC9003BD79B /* ConfigSpec.swift */; }; - D5DC5A5E1C205B19003BD79B /* CapsuleSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A061C205AC9003BD79B /* CapsuleSpec.swift */; }; - D5DC5A5F1C205B1C003BD79B /* ExpirySpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A071C205AC9003BD79B /* ExpirySpec.swift */; }; - D5DC5A601C205B1F003BD79B /* JSONSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A081C205AC9003BD79B /* JSONSpec.swift */; }; - D5DC5A611C205B22003BD79B /* StorageKindSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A091C205AC9003BD79B /* StorageKindSpec.swift */; }; - D5DC5A621C205B26003BD79B /* JSON+CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A0B1C205AC9003BD79B /* JSON+CacheSpec.swift */; }; - D5DC5A631C205B2A003BD79B /* NSData+CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A0C1C205AC9003BD79B /* NSData+CacheSpec.swift */; }; - D5DC5A651C205B2F003BD79B /* NSDate+CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A0D1C205AC9003BD79B /* NSDate+CacheSpec.swift */; }; - D5DC5A661C205B2F003BD79B /* String+CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A0E1C205AC9003BD79B /* String+CacheSpec.swift */; }; - D5DC5A671C205B2F003BD79B /* UIImage+CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A0F1C205AC9003BD79B /* UIImage+CacheSpec.swift */; }; - D5DC5A681C205B3D003BD79B /* DefaultCacheConverterSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A111C205AC9003BD79B /* DefaultCacheConverterSpec.swift */; }; - D5DC5A691C205B41003BD79B /* DiskStorageSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A131C205AC9003BD79B /* DiskStorageSpec.swift */; }; - D5DC5A6A1C205B41003BD79B /* MemoryStorageSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A141C205AC9003BD79B /* MemoryStorageSpec.swift */; }; - D5DC5A6B1C205B41003BD79B /* StorageFactorySpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC5A151C205AC9003BD79B /* StorageFactorySpec.swift */; }; - D5DC5A6E1C205C2A003BD79B /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5DC5A6C1C205C2A003BD79B /* Quick.framework */; }; - D5DC5A6F1C205C2A003BD79B /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5DC5A6D1C205C2A003BD79B /* Nimble.framework */; }; + D5291C291C28220B00B702C9 /* UIImage+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C0D1C28220B00B702C9 /* UIImage+Cache.swift */; }; + D5291C2D1C28220B00B702C9 /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C151C28220B00B702C9 /* Config.swift */; }; + D5291C2E1C28220B00B702C9 /* Cachable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C171C28220B00B702C9 /* Cachable.swift */; }; + D5291C2F1C28220B00B702C9 /* Capsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C181C28220B00B702C9 /* Capsule.swift */; }; + D5291C301C28220B00B702C9 /* Expiry.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C191C28220B00B702C9 /* Expiry.swift */; }; + D5291C311C28220B00B702C9 /* JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C1A1C28220B00B702C9 /* JSON.swift */; }; + D5291C321C28220B00B702C9 /* StorageKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C1B1C28220B00B702C9 /* StorageKind.swift */; }; + D5291C331C28220B00B702C9 /* JSON+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C1D1C28220B00B702C9 /* JSON+Cache.swift */; }; + D5291C341C28220B00B702C9 /* NSData+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C1E1C28220B00B702C9 /* NSData+Cache.swift */; }; + D5291C351C28220B00B702C9 /* NSDate+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C1F1C28220B00B702C9 /* NSDate+Cache.swift */; }; + D5291C361C28220B00B702C9 /* String+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C201C28220B00B702C9 /* String+Cache.swift */; }; + D5291C371C28220B00B702C9 /* DefaultCacheConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C221C28220B00B702C9 /* DefaultCacheConverter.swift */; }; + D5291C381C28220B00B702C9 /* DiskStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C241C28220B00B702C9 /* DiskStorage.swift */; }; + D5291C391C28220B00B702C9 /* MemoryStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C251C28220B00B702C9 /* MemoryStorage.swift */; }; + D5291C3A1C28220B00B702C9 /* StorageAware.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C261C28220B00B702C9 /* StorageAware.swift */; }; + D5291C3B1C28220B00B702C9 /* StorageFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C271C28220B00B702C9 /* StorageFactory.swift */; }; + D5291C6C1C2827FB00B702C9 /* BasicHybridCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C6A1C2827FB00B702C9 /* BasicHybridCache.swift */; }; + D5291C6D1C2827FB00B702C9 /* Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C6B1C2827FB00B702C9 /* Cache.swift */; }; + D5291C731C28296B00B702C9 /* HybridCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C721C28296B00B702C9 /* HybridCache.swift */; }; + D5291D1D1C2837DB00B702C9 /* Cache.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5DC59E01C20593E003BD79B /* Cache.framework */; }; + D5291D351C28389B00B702C9 /* SpecHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CDF1C28374800B702C9 /* SpecHelper.swift */; }; + D5291D361C28389B00B702C9 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CE01C28374800B702C9 /* User.swift */; }; + D5291D371C28389B00B702C9 /* CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CE21C28374800B702C9 /* CacheSpec.swift */; }; + D5291D381C28389B00B702C9 /* ConfigSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CE31C28374800B702C9 /* ConfigSpec.swift */; }; + D5291D391C28389B00B702C9 /* CapsuleSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CE51C28374800B702C9 /* CapsuleSpec.swift */; }; + D5291D3A1C28389B00B702C9 /* ExpirySpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CE61C28374800B702C9 /* ExpirySpec.swift */; }; + D5291D3B1C28389B00B702C9 /* JSONSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CE71C28374800B702C9 /* JSONSpec.swift */; }; + D5291D3C1C28389B00B702C9 /* StorageKindSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CE81C28374800B702C9 /* StorageKindSpec.swift */; }; + D5291D3D1C28389B00B702C9 /* JSON+CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CEA1C28374800B702C9 /* JSON+CacheSpec.swift */; }; + D5291D3E1C28389B00B702C9 /* NSData+CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CEB1C28374800B702C9 /* NSData+CacheSpec.swift */; }; + D5291D3F1C28389B00B702C9 /* NSDate+CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CEC1C28374800B702C9 /* NSDate+CacheSpec.swift */; }; + D5291D401C28389B00B702C9 /* String+CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CED1C28374800B702C9 /* String+CacheSpec.swift */; }; + D5291D411C28389B00B702C9 /* DefaultCacheConverterSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CEF1C28374800B702C9 /* DefaultCacheConverterSpec.swift */; }; + D5291D421C28389B00B702C9 /* DiskStorageSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CF11C28374800B702C9 /* DiskStorageSpec.swift */; }; + D5291D431C28389B00B702C9 /* MemoryStorageSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CF21C28374800B702C9 /* MemoryStorageSpec.swift */; }; + D5291D441C28389B00B702C9 /* StorageFactorySpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291CF31C28374800B702C9 /* StorageFactorySpec.swift */; }; + D5291D571C283A4200B702C9 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5DC5A6C1C205C2A003BD79B /* Quick.framework */; }; + D5291D581C283A4200B702C9 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5DC5A6D1C205C2A003BD79B /* Nimble.framework */; }; + D5291D6A1C283B5400B702C9 /* Cache.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5291D601C283B5300B702C9 /* Cache.framework */; }; + D5291D7D1C283BF200B702C9 /* NSImage+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291D791C283BE300B702C9 /* NSImage+Cache.swift */; }; + D5291D7E1C283BF200B702C9 /* HybridCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291D7A1C283BE300B702C9 /* HybridCache.swift */; }; + D5291D851C283C7C00B702C9 /* SpecHelper+OSX.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291D811C283C7000B702C9 /* SpecHelper+OSX.swift */; }; + D5291D861C283CFB00B702C9 /* BasicHybridCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C6A1C2827FB00B702C9 /* BasicHybridCache.swift */; }; + D5291D871C283CFB00B702C9 /* Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C6B1C2827FB00B702C9 /* Cache.swift */; }; + D5291D881C283CFB00B702C9 /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C151C28220B00B702C9 /* Config.swift */; }; + D5291D891C283CFB00B702C9 /* Cachable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C171C28220B00B702C9 /* Cachable.swift */; }; + D5291D8A1C283CFB00B702C9 /* Capsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C181C28220B00B702C9 /* Capsule.swift */; }; + D5291D8B1C283CFB00B702C9 /* Expiry.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C191C28220B00B702C9 /* Expiry.swift */; }; + D5291D8C1C283CFB00B702C9 /* JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C1A1C28220B00B702C9 /* JSON.swift */; }; + D5291D8D1C283CFB00B702C9 /* StorageKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C1B1C28220B00B702C9 /* StorageKind.swift */; }; + D5291D8E1C283CFB00B702C9 /* JSON+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C1D1C28220B00B702C9 /* JSON+Cache.swift */; }; + D5291D8F1C283CFB00B702C9 /* NSData+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C1E1C28220B00B702C9 /* NSData+Cache.swift */; }; + D5291D901C283CFB00B702C9 /* NSDate+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C1F1C28220B00B702C9 /* NSDate+Cache.swift */; }; + D5291D911C283CFB00B702C9 /* String+Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C201C28220B00B702C9 /* String+Cache.swift */; }; + D5291D921C283CFB00B702C9 /* DefaultCacheConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C221C28220B00B702C9 /* DefaultCacheConverter.swift */; }; + D5291D931C283CFB00B702C9 /* DiskStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C241C28220B00B702C9 /* DiskStorage.swift */; }; + D5291D941C283CFB00B702C9 /* MemoryStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C251C28220B00B702C9 /* MemoryStorage.swift */; }; + D5291D951C283CFB00B702C9 /* StorageAware.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C261C28220B00B702C9 /* StorageAware.swift */; }; + D5291D961C283CFB00B702C9 /* StorageFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291C271C28220B00B702C9 /* StorageFactory.swift */; }; + D5291D9A1C283DB300B702C9 /* UIImage+CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291D991C283DB300B702C9 /* UIImage+CacheSpec.swift */; }; + D5291D9C1C283DD900B702C9 /* NSImage+CacheSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291D9B1C283DD900B702C9 /* NSImage+CacheSpec.swift */; }; + D5291D9D1C283EC000B702C9 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5291CD91C2835D000B702C9 /* Quick.framework */; }; + D5291D9E1C283EC000B702C9 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5291CDA1C2835D000B702C9 /* Nimble.framework */; }; + D5291DA11C28405900B702C9 /* UIImage+CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291DA01C28405900B702C9 /* UIImage+CacheTests.swift */; }; + D5291DA31C2841D200B702C9 /* NSImage+CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5291DA21C2841D200B702C9 /* NSImage+CacheTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - D5DC59EC1C20593E003BD79B /* PBXContainerItemProxy */ = { + D5291D1E1C2837DB00B702C9 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D5DC59D71C20593E003BD79B /* Project object */; proxyType = 1; remoteGlobalIDString = D5DC59DF1C20593E003BD79B; - remoteInfo = Cache; + remoteInfo = "Cache-iOS"; + }; + D5291D6B1C283B5400B702C9 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D5DC59D71C20593E003BD79B /* Project object */; + proxyType = 1; + remoteGlobalIDString = D5291D5F1C283B5300B702C9; + remoteInfo = "Cache-Mac"; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + D5291C0D1C28220B00B702C9 /* UIImage+Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+Cache.swift"; sourceTree = ""; }; + D5291C151C28220B00B702C9 /* Config.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = ""; }; + D5291C171C28220B00B702C9 /* Cachable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Cachable.swift; sourceTree = ""; }; + D5291C181C28220B00B702C9 /* Capsule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Capsule.swift; sourceTree = ""; }; + D5291C191C28220B00B702C9 /* Expiry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Expiry.swift; sourceTree = ""; }; + D5291C1A1C28220B00B702C9 /* JSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSON.swift; sourceTree = ""; }; + D5291C1B1C28220B00B702C9 /* StorageKind.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageKind.swift; sourceTree = ""; }; + D5291C1D1C28220B00B702C9 /* JSON+Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "JSON+Cache.swift"; sourceTree = ""; }; + D5291C1E1C28220B00B702C9 /* NSData+Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSData+Cache.swift"; sourceTree = ""; }; + D5291C1F1C28220B00B702C9 /* NSDate+Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSDate+Cache.swift"; sourceTree = ""; }; + D5291C201C28220B00B702C9 /* String+Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Cache.swift"; sourceTree = ""; }; + D5291C221C28220B00B702C9 /* DefaultCacheConverter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultCacheConverter.swift; sourceTree = ""; }; + D5291C241C28220B00B702C9 /* DiskStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiskStorage.swift; sourceTree = ""; }; + D5291C251C28220B00B702C9 /* MemoryStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MemoryStorage.swift; sourceTree = ""; }; + D5291C261C28220B00B702C9 /* StorageAware.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageAware.swift; sourceTree = ""; }; + D5291C271C28220B00B702C9 /* StorageFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageFactory.swift; sourceTree = ""; }; + D5291C6A1C2827FB00B702C9 /* BasicHybridCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasicHybridCache.swift; sourceTree = ""; }; + D5291C6B1C2827FB00B702C9 /* Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Cache.swift; sourceTree = ""; }; + D5291C721C28296B00B702C9 /* HybridCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HybridCache.swift; sourceTree = ""; }; + D5291CD91C2835D000B702C9 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quick.framework; path = Carthage/Build/Mac/Quick.framework; sourceTree = ""; }; + D5291CDA1C2835D000B702C9 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = Carthage/Build/Mac/Nimble.framework; sourceTree = ""; }; + D5291CDF1C28374800B702C9 /* SpecHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpecHelper.swift; sourceTree = ""; }; + D5291CE01C28374800B702C9 /* User.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + D5291CE21C28374800B702C9 /* CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CacheSpec.swift; sourceTree = ""; }; + D5291CE31C28374800B702C9 /* ConfigSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigSpec.swift; sourceTree = ""; }; + D5291CE51C28374800B702C9 /* CapsuleSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CapsuleSpec.swift; sourceTree = ""; }; + D5291CE61C28374800B702C9 /* ExpirySpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExpirySpec.swift; sourceTree = ""; }; + D5291CE71C28374800B702C9 /* JSONSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONSpec.swift; sourceTree = ""; }; + D5291CE81C28374800B702C9 /* StorageKindSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageKindSpec.swift; sourceTree = ""; }; + D5291CEA1C28374800B702C9 /* JSON+CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "JSON+CacheSpec.swift"; sourceTree = ""; }; + D5291CEB1C28374800B702C9 /* NSData+CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSData+CacheSpec.swift"; sourceTree = ""; }; + D5291CEC1C28374800B702C9 /* NSDate+CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSDate+CacheSpec.swift"; sourceTree = ""; }; + D5291CED1C28374800B702C9 /* String+CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+CacheSpec.swift"; sourceTree = ""; }; + D5291CEF1C28374800B702C9 /* DefaultCacheConverterSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultCacheConverterSpec.swift; sourceTree = ""; }; + D5291CF11C28374800B702C9 /* DiskStorageSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiskStorageSpec.swift; sourceTree = ""; }; + D5291CF21C28374800B702C9 /* MemoryStorageSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MemoryStorageSpec.swift; sourceTree = ""; }; + D5291CF31C28374800B702C9 /* StorageFactorySpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageFactorySpec.swift; sourceTree = ""; }; + D5291D181C2837DB00B702C9 /* Cache-iOS-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Cache-iOS-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + D5291D231C28380100B702C9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D5291D601C283B5300B702C9 /* Cache.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cache.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D5291D691C283B5400B702C9 /* Cache-Mac-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Cache-Mac-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + D5291D791C283BE300B702C9 /* NSImage+Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSImage+Cache.swift"; sourceTree = ""; }; + D5291D7A1C283BE300B702C9 /* HybridCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HybridCache.swift; sourceTree = ""; }; + D5291D811C283C7000B702C9 /* SpecHelper+OSX.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SpecHelper+OSX.swift"; sourceTree = ""; }; + D5291D821C283C7000B702C9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D5291D991C283DB300B702C9 /* UIImage+CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+CacheSpec.swift"; sourceTree = ""; }; + D5291D9B1C283DD900B702C9 /* NSImage+CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSImage+CacheSpec.swift"; sourceTree = ""; }; + D5291DA01C28405900B702C9 /* UIImage+CacheTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+CacheTests.swift"; sourceTree = ""; }; + D5291DA21C2841D200B702C9 /* NSImage+CacheTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSImage+CacheTests.swift"; sourceTree = ""; }; D5DC59E01C20593E003BD79B /* Cache.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cache.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D5DC59EA1C20593E003BD79B /* CacheTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CacheTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - D5DC59FD1C205AC9003BD79B /* User.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - D5DC59FF1C205AC9003BD79B /* UIImage+CacheTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+CacheTests.swift"; sourceTree = ""; }; - D5DC5A001C205AC9003BD79B /* SpecHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpecHelper.swift; sourceTree = ""; }; - D5DC5A011C205AC9003BD79B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D5DC5A031C205AC9003BD79B /* CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CacheSpec.swift; sourceTree = ""; }; - D5DC5A041C205AC9003BD79B /* ConfigSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigSpec.swift; sourceTree = ""; }; - D5DC5A061C205AC9003BD79B /* CapsuleSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CapsuleSpec.swift; sourceTree = ""; }; - D5DC5A071C205AC9003BD79B /* ExpirySpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExpirySpec.swift; sourceTree = ""; }; - D5DC5A081C205AC9003BD79B /* JSONSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONSpec.swift; sourceTree = ""; }; - D5DC5A091C205AC9003BD79B /* StorageKindSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageKindSpec.swift; sourceTree = ""; }; - D5DC5A0B1C205AC9003BD79B /* JSON+CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "JSON+CacheSpec.swift"; sourceTree = ""; }; - D5DC5A0C1C205AC9003BD79B /* NSData+CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSData+CacheSpec.swift"; sourceTree = ""; }; - D5DC5A0D1C205AC9003BD79B /* NSDate+CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSDate+CacheSpec.swift"; sourceTree = ""; }; - D5DC5A0E1C205AC9003BD79B /* String+CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+CacheSpec.swift"; sourceTree = ""; }; - D5DC5A0F1C205AC9003BD79B /* UIImage+CacheSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+CacheSpec.swift"; sourceTree = ""; }; - D5DC5A111C205AC9003BD79B /* DefaultCacheConverterSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultCacheConverterSpec.swift; sourceTree = ""; }; - D5DC5A131C205AC9003BD79B /* DiskStorageSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiskStorageSpec.swift; sourceTree = ""; }; - D5DC5A141C205AC9003BD79B /* MemoryStorageSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MemoryStorageSpec.swift; sourceTree = ""; }; - D5DC5A151C205AC9003BD79B /* StorageFactorySpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageFactorySpec.swift; sourceTree = ""; }; D5DC5A181C205AC9003BD79B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D5DC5A1B1C205AC9003BD79B /* Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Cache.swift; sourceTree = ""; }; - D5DC5A1C1C205AC9003BD79B /* HybridCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HybridCache.swift; sourceTree = ""; }; - D5DC5A1D1C205AC9003BD79B /* Config.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = ""; }; - D5DC5A201C205AC9003BD79B /* Cachable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Cachable.swift; sourceTree = ""; }; - D5DC5A211C205AC9003BD79B /* Capsule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Capsule.swift; sourceTree = ""; }; - D5DC5A221C205AC9003BD79B /* Expiry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Expiry.swift; sourceTree = ""; }; - D5DC5A231C205AC9003BD79B /* JSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSON.swift; sourceTree = ""; }; - D5DC5A241C205AC9003BD79B /* StorageKind.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageKind.swift; sourceTree = ""; }; - D5DC5A261C205AC9003BD79B /* JSON+Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "JSON+Cache.swift"; sourceTree = ""; }; - D5DC5A271C205AC9003BD79B /* NSData+Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSData+Cache.swift"; sourceTree = ""; }; - D5DC5A281C205AC9003BD79B /* NSDate+Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSDate+Cache.swift"; sourceTree = ""; }; - D5DC5A291C205AC9003BD79B /* String+Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Cache.swift"; sourceTree = ""; }; - D5DC5A2A1C205AC9003BD79B /* UIImage+Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+Cache.swift"; sourceTree = ""; }; - D5DC5A2C1C205AC9003BD79B /* DefaultCacheConverter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultCacheConverter.swift; sourceTree = ""; }; - D5DC5A2E1C205AC9003BD79B /* DiskStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiskStorage.swift; sourceTree = ""; }; - D5DC5A2F1C205AC9003BD79B /* MemoryStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MemoryStorage.swift; sourceTree = ""; }; - D5DC5A301C205AC9003BD79B /* StorageAware.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageAware.swift; sourceTree = ""; }; - D5DC5A311C205AC9003BD79B /* StorageFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageFactory.swift; sourceTree = ""; }; D5DC5A6C1C205C2A003BD79B /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quick.framework; path = Carthage/Build/iOS/Quick.framework; sourceTree = ""; }; D5DC5A6D1C205C2A003BD79B /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = Carthage/Build/iOS/Nimble.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - D5DC59DC1C20593E003BD79B /* Frameworks */ = { + D5291D151C2837DB00B702C9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D5291D571C283A4200B702C9 /* Quick.framework in Frameworks */, + D5291D581C283A4200B702C9 /* Nimble.framework in Frameworks */, + D5291D1D1C2837DB00B702C9 /* Cache.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D5291D5C1C283B5300B702C9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D5291D661C283B5400B702C9 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D5291D9D1C283EC000B702C9 /* Quick.framework in Frameworks */, + D5291D9E1C283EC000B702C9 /* Nimble.framework in Frameworks */, + D5291D6A1C283B5400B702C9 /* Cache.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - D5DC59E71C20593E003BD79B /* Frameworks */ = { + D5DC59DC1C20593E003BD79B /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D5DC5A6E1C205C2A003BD79B /* Quick.framework in Frameworks */, - D5DC5A6F1C205C2A003BD79B /* Nimble.framework in Frameworks */, - D5DC59EB1C20593E003BD79B /* Cache.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - D5DC59D61C20593E003BD79B = { + D5291C081C28220B00B702C9 /* Source */ = { isa = PBXGroup; children = ( - D5DC5A6C1C205C2A003BD79B /* Quick.framework */, - D5DC5A6D1C205C2A003BD79B /* Nimble.framework */, - D5DC5A161C205AC9003BD79B /* SupportFiles */, - D5DC5A191C205AC9003BD79B /* Source */, - D5DC59FA1C205AC9003BD79B /* Tests */, - D5DC59E11C20593E003BD79B /* Products */, + D5291C091C28220B00B702C9 /* iOS */, + D5291D771C283BE300B702C9 /* Mac */, + D5291C111C28220B00B702C9 /* Shared */, ); + path = Source; sourceTree = ""; }; - D5DC59E11C20593E003BD79B /* Products */ = { + D5291C091C28220B00B702C9 /* iOS */ = { isa = PBXGroup; children = ( - D5DC59E01C20593E003BD79B /* Cache.framework */, - D5DC59EA1C20593E003BD79B /* CacheTests.xctest */, + D5291C721C28296B00B702C9 /* HybridCache.swift */, + D5291C0C1C28220B00B702C9 /* Extensions */, ); - name = Products; + path = iOS; sourceTree = ""; }; - D5DC59FA1C205AC9003BD79B /* Tests */ = { + D5291C0C1C28220B00B702C9 /* Extensions */ = { isa = PBXGroup; children = ( - D5DC5A011C205AC9003BD79B /* Info.plist */, - D5DC59FB1C205AC9003BD79B /* Helpers */, - D5DC5A021C205AC9003BD79B /* Specs */, + D5291C0D1C28220B00B702C9 /* UIImage+Cache.swift */, ); - path = Tests; + path = Extensions; sourceTree = ""; }; - D5DC59FB1C205AC9003BD79B /* Helpers */ = { + D5291C111C28220B00B702C9 /* Shared */ = { isa = PBXGroup; children = ( - D5DC59FC1C205AC9003BD79B /* Data */, - D5DC59FE1C205AC9003BD79B /* Extensions */, - D5DC5A001C205AC9003BD79B /* SpecHelper.swift */, + D5291C6A1C2827FB00B702C9 /* BasicHybridCache.swift */, + D5291C6B1C2827FB00B702C9 /* Cache.swift */, + D5291C151C28220B00B702C9 /* Config.swift */, + D5291C161C28220B00B702C9 /* DataStructures */, + D5291C1C1C28220B00B702C9 /* Extensions */, + D5291C211C28220B00B702C9 /* Library */, + D5291C231C28220B00B702C9 /* Storage */, ); - path = Helpers; + path = Shared; sourceTree = ""; }; - D5DC59FC1C205AC9003BD79B /* Data */ = { + D5291C161C28220B00B702C9 /* DataStructures */ = { isa = PBXGroup; children = ( - D5DC59FD1C205AC9003BD79B /* User.swift */, + D5291C171C28220B00B702C9 /* Cachable.swift */, + D5291C181C28220B00B702C9 /* Capsule.swift */, + D5291C191C28220B00B702C9 /* Expiry.swift */, + D5291C1A1C28220B00B702C9 /* JSON.swift */, + D5291C1B1C28220B00B702C9 /* StorageKind.swift */, ); - path = Data; + path = DataStructures; sourceTree = ""; }; - D5DC59FE1C205AC9003BD79B /* Extensions */ = { + D5291C1C1C28220B00B702C9 /* Extensions */ = { isa = PBXGroup; children = ( - D5DC59FF1C205AC9003BD79B /* UIImage+CacheTests.swift */, + D5291C1D1C28220B00B702C9 /* JSON+Cache.swift */, + D5291C1E1C28220B00B702C9 /* NSData+Cache.swift */, + D5291C1F1C28220B00B702C9 /* NSDate+Cache.swift */, + D5291C201C28220B00B702C9 /* String+Cache.swift */, ); path = Extensions; sourceTree = ""; }; - D5DC5A021C205AC9003BD79B /* Specs */ = { + D5291C211C28220B00B702C9 /* Library */ = { + isa = PBXGroup; + children = ( + D5291C221C28220B00B702C9 /* DefaultCacheConverter.swift */, + ); + path = Library; + sourceTree = ""; + }; + D5291C231C28220B00B702C9 /* Storage */ = { isa = PBXGroup; children = ( - D5DC5A031C205AC9003BD79B /* CacheSpec.swift */, - D5DC5A041C205AC9003BD79B /* ConfigSpec.swift */, - D5DC5A051C205AC9003BD79B /* DataStructures */, - D5DC5A0A1C205AC9003BD79B /* Extensions */, - D5DC5A101C205AC9003BD79B /* Library */, - D5DC5A121C205AC9003BD79B /* Storage */, + D5291C241C28220B00B702C9 /* DiskStorage.swift */, + D5291C251C28220B00B702C9 /* MemoryStorage.swift */, + D5291C261C28220B00B702C9 /* StorageAware.swift */, + D5291C271C28220B00B702C9 /* StorageFactory.swift */, + ); + path = Storage; + sourceTree = ""; + }; + D5291CDD1C28374800B702C9 /* iOS */ = { + isa = PBXGroup; + children = ( + D5291D231C28380100B702C9 /* Info.plist */, + D5291CDE1C28374800B702C9 /* Helpers */, + D5291CE11C28374800B702C9 /* Specs */, + ); + path = iOS; + sourceTree = ""; + }; + D5291CDE1C28374800B702C9 /* Helpers */ = { + isa = PBXGroup; + children = ( + D5291CDF1C28374800B702C9 /* SpecHelper.swift */, + D5291CE01C28374800B702C9 /* User.swift */, + D5291DA01C28405900B702C9 /* UIImage+CacheTests.swift */, + ); + path = Helpers; + sourceTree = ""; + }; + D5291CE11C28374800B702C9 /* Specs */ = { + isa = PBXGroup; + children = ( + D5291CE21C28374800B702C9 /* CacheSpec.swift */, + D5291CE31C28374800B702C9 /* ConfigSpec.swift */, + D5291CE41C28374800B702C9 /* DataStructures */, + D5291CE91C28374800B702C9 /* Extensions */, + D5291CEE1C28374800B702C9 /* Library */, + D5291CF01C28374800B702C9 /* Storage */, ); path = Specs; sourceTree = ""; }; - D5DC5A051C205AC9003BD79B /* DataStructures */ = { + D5291CE41C28374800B702C9 /* DataStructures */ = { isa = PBXGroup; children = ( - D5DC5A061C205AC9003BD79B /* CapsuleSpec.swift */, - D5DC5A071C205AC9003BD79B /* ExpirySpec.swift */, - D5DC5A081C205AC9003BD79B /* JSONSpec.swift */, - D5DC5A091C205AC9003BD79B /* StorageKindSpec.swift */, + D5291CE51C28374800B702C9 /* CapsuleSpec.swift */, + D5291CE61C28374800B702C9 /* ExpirySpec.swift */, + D5291CE71C28374800B702C9 /* JSONSpec.swift */, + D5291CE81C28374800B702C9 /* StorageKindSpec.swift */, ); path = DataStructures; sourceTree = ""; }; - D5DC5A0A1C205AC9003BD79B /* Extensions */ = { + D5291CE91C28374800B702C9 /* Extensions */ = { isa = PBXGroup; children = ( - D5DC5A0B1C205AC9003BD79B /* JSON+CacheSpec.swift */, - D5DC5A0C1C205AC9003BD79B /* NSData+CacheSpec.swift */, - D5DC5A0D1C205AC9003BD79B /* NSDate+CacheSpec.swift */, - D5DC5A0E1C205AC9003BD79B /* String+CacheSpec.swift */, - D5DC5A0F1C205AC9003BD79B /* UIImage+CacheSpec.swift */, + D5291CEA1C28374800B702C9 /* JSON+CacheSpec.swift */, + D5291CEB1C28374800B702C9 /* NSData+CacheSpec.swift */, + D5291CEC1C28374800B702C9 /* NSDate+CacheSpec.swift */, + D5291CED1C28374800B702C9 /* String+CacheSpec.swift */, + D5291D991C283DB300B702C9 /* UIImage+CacheSpec.swift */, ); path = Extensions; sourceTree = ""; }; - D5DC5A101C205AC9003BD79B /* Library */ = { + D5291CEE1C28374800B702C9 /* Library */ = { isa = PBXGroup; children = ( - D5DC5A111C205AC9003BD79B /* DefaultCacheConverterSpec.swift */, + D5291CEF1C28374800B702C9 /* DefaultCacheConverterSpec.swift */, ); path = Library; sourceTree = ""; }; - D5DC5A121C205AC9003BD79B /* Storage */ = { + D5291CF01C28374800B702C9 /* Storage */ = { isa = PBXGroup; children = ( - D5DC5A131C205AC9003BD79B /* DiskStorageSpec.swift */, - D5DC5A141C205AC9003BD79B /* MemoryStorageSpec.swift */, - D5DC5A151C205AC9003BD79B /* StorageFactorySpec.swift */, + D5291CF11C28374800B702C9 /* DiskStorageSpec.swift */, + D5291CF21C28374800B702C9 /* MemoryStorageSpec.swift */, + D5291CF31C28374800B702C9 /* StorageFactorySpec.swift */, ); path = Storage; sourceTree = ""; }; - D5DC5A161C205AC9003BD79B /* SupportFiles */ = { + D5291D771C283BE300B702C9 /* Mac */ = { isa = PBXGroup; children = ( - D5DC5A181C205AC9003BD79B /* Info.plist */, + D5291D781C283BE300B702C9 /* Extensions */, + D5291D7A1C283BE300B702C9 /* HybridCache.swift */, ); - path = SupportFiles; + path = Mac; sourceTree = ""; }; - D5DC5A191C205AC9003BD79B /* Source */ = { + D5291D781C283BE300B702C9 /* Extensions */ = { isa = PBXGroup; children = ( - D5DC5A1A1C205AC9003BD79B /* Cache */, - D5DC5A1D1C205AC9003BD79B /* Config.swift */, - D5DC5A1F1C205AC9003BD79B /* DataStructures */, - D5DC5A251C205AC9003BD79B /* Extensions */, - D5DC5A2B1C205AC9003BD79B /* Library */, - D5DC5A2D1C205AC9003BD79B /* Storage */, + D5291D791C283BE300B702C9 /* NSImage+Cache.swift */, ); - path = Source; + path = Extensions; sourceTree = ""; }; - D5DC5A1A1C205AC9003BD79B /* Cache */ = { + D5291D7F1C283C7000B702C9 /* Mac */ = { isa = PBXGroup; children = ( - D5DC5A1B1C205AC9003BD79B /* Cache.swift */, - D5DC5A1C1C205AC9003BD79B /* HybridCache.swift */, + D5291D801C283C7000B702C9 /* Helpers */, + D5291D971C283D4100B702C9 /* Specs */, + D5291D821C283C7000B702C9 /* Info.plist */, ); - path = Cache; + path = Mac; sourceTree = ""; }; - D5DC5A1F1C205AC9003BD79B /* DataStructures */ = { + D5291D801C283C7000B702C9 /* Helpers */ = { isa = PBXGroup; children = ( - D5DC5A201C205AC9003BD79B /* Cachable.swift */, - D5DC5A211C205AC9003BD79B /* Capsule.swift */, - D5DC5A221C205AC9003BD79B /* Expiry.swift */, - D5DC5A231C205AC9003BD79B /* JSON.swift */, - D5DC5A241C205AC9003BD79B /* StorageKind.swift */, + D5291D811C283C7000B702C9 /* SpecHelper+OSX.swift */, + D5291DA21C2841D200B702C9 /* NSImage+CacheTests.swift */, ); - path = DataStructures; + path = Helpers; sourceTree = ""; }; - D5DC5A251C205AC9003BD79B /* Extensions */ = { + D5291D971C283D4100B702C9 /* Specs */ = { isa = PBXGroup; children = ( - D5DC5A261C205AC9003BD79B /* JSON+Cache.swift */, - D5DC5A271C205AC9003BD79B /* NSData+Cache.swift */, - D5DC5A281C205AC9003BD79B /* NSDate+Cache.swift */, - D5DC5A291C205AC9003BD79B /* String+Cache.swift */, - D5DC5A2A1C205AC9003BD79B /* UIImage+Cache.swift */, + D5291D981C283D5200B702C9 /* Extensions */, + ); + path = Specs; + sourceTree = ""; + }; + D5291D981C283D5200B702C9 /* Extensions */ = { + isa = PBXGroup; + children = ( + D5291D9B1C283DD900B702C9 /* NSImage+CacheSpec.swift */, ); path = Extensions; sourceTree = ""; }; - D5DC5A2B1C205AC9003BD79B /* Library */ = { + D5291DA41C28452300B702C9 /* Frameworks */ = { isa = PBXGroup; children = ( - D5DC5A2C1C205AC9003BD79B /* DefaultCacheConverter.swift */, + D5291DA61C28454800B702C9 /* iOS */, + D5291DA51C28454000B702C9 /* Mac */, ); - path = Library; + name = Frameworks; sourceTree = ""; }; - D5DC5A2D1C205AC9003BD79B /* Storage */ = { + D5291DA51C28454000B702C9 /* Mac */ = { isa = PBXGroup; children = ( - D5DC5A2E1C205AC9003BD79B /* DiskStorage.swift */, - D5DC5A2F1C205AC9003BD79B /* MemoryStorage.swift */, - D5DC5A301C205AC9003BD79B /* StorageAware.swift */, - D5DC5A311C205AC9003BD79B /* StorageFactory.swift */, + D5291CD91C2835D000B702C9 /* Quick.framework */, + D5291CDA1C2835D000B702C9 /* Nimble.framework */, ); - path = Storage; + name = Mac; + sourceTree = ""; + }; + D5291DA61C28454800B702C9 /* iOS */ = { + isa = PBXGroup; + children = ( + D5DC5A6C1C205C2A003BD79B /* Quick.framework */, + D5DC5A6D1C205C2A003BD79B /* Nimble.framework */, + ); + name = iOS; + sourceTree = ""; + }; + D5DC59D61C20593E003BD79B = { + isa = PBXGroup; + children = ( + D5291DA41C28452300B702C9 /* Frameworks */, + D5291C081C28220B00B702C9 /* Source */, + D5DC5A161C205AC9003BD79B /* SupportFiles */, + D5DC59FA1C205AC9003BD79B /* Tests */, + D5DC59E11C20593E003BD79B /* Products */, + ); + sourceTree = ""; + }; + D5DC59E11C20593E003BD79B /* Products */ = { + isa = PBXGroup; + children = ( + D5DC59E01C20593E003BD79B /* Cache.framework */, + D5291D181C2837DB00B702C9 /* Cache-iOS-Tests.xctest */, + D5291D601C283B5300B702C9 /* Cache.framework */, + D5291D691C283B5400B702C9 /* Cache-Mac-Tests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + D5DC59FA1C205AC9003BD79B /* Tests */ = { + isa = PBXGroup; + children = ( + D5291CDD1C28374800B702C9 /* iOS */, + D5291D7F1C283C7000B702C9 /* Mac */, + ); + path = Tests; + sourceTree = ""; + }; + D5DC5A161C205AC9003BD79B /* SupportFiles */ = { + isa = PBXGroup; + children = ( + D5DC5A181C205AC9003BD79B /* Info.plist */, + ); + path = SupportFiles; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + D5291D5D1C283B5300B702C9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; D5DC59DD1C20593E003BD79B /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -321,43 +480,80 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - D5DC59DF1C20593E003BD79B /* Cache-iOS */ = { + D5291D171C2837DB00B702C9 /* Cache-iOS-Tests */ = { isa = PBXNativeTarget; - buildConfigurationList = D5DC59F41C20593E003BD79B /* Build configuration list for PBXNativeTarget "Cache-iOS" */; + buildConfigurationList = D5291D201C2837DB00B702C9 /* Build configuration list for PBXNativeTarget "Cache-iOS-Tests" */; buildPhases = ( - D5DC59DB1C20593E003BD79B /* Sources */, - D5DC59DC1C20593E003BD79B /* Frameworks */, - D5DC59DD1C20593E003BD79B /* Headers */, - D5DC59DE1C20593E003BD79B /* Resources */, + D5291D141C2837DB00B702C9 /* Sources */, + D5291D151C2837DB00B702C9 /* Frameworks */, + D5291D161C2837DB00B702C9 /* Resources */, + D5291D591C283AA700B702C9 /* ShellScript */, ); buildRules = ( ); dependencies = ( + D5291D1F1C2837DB00B702C9 /* PBXTargetDependency */, ); - name = "Cache-iOS"; - productName = Cache; - productReference = D5DC59E01C20593E003BD79B /* Cache.framework */; + name = "Cache-iOS-Tests"; + productName = "Cache-iOS-Tests"; + productReference = D5291D181C2837DB00B702C9 /* Cache-iOS-Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + D5291D5F1C283B5300B702C9 /* Cache-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = D5291D711C283B5400B702C9 /* Build configuration list for PBXNativeTarget "Cache-Mac" */; + buildPhases = ( + D5291D5B1C283B5300B702C9 /* Sources */, + D5291D5C1C283B5300B702C9 /* Frameworks */, + D5291D5D1C283B5300B702C9 /* Headers */, + D5291D5E1C283B5300B702C9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Cache-Mac"; + productName = "Cache-Mac"; + productReference = D5291D601C283B5300B702C9 /* Cache.framework */; productType = "com.apple.product-type.framework"; }; - D5DC59E91C20593E003BD79B /* CacheTests */ = { + D5291D681C283B5400B702C9 /* Cache-Mac-Tests */ = { isa = PBXNativeTarget; - buildConfigurationList = D5DC59F71C20593E003BD79B /* Build configuration list for PBXNativeTarget "CacheTests" */; + buildConfigurationList = D5291D741C283B5400B702C9 /* Build configuration list for PBXNativeTarget "Cache-Mac-Tests" */; buildPhases = ( - D5DC59E61C20593E003BD79B /* Sources */, - D5DC59E71C20593E003BD79B /* Frameworks */, - D5DC59E81C20593E003BD79B /* Resources */, - D56DA9D11C205D8C003E7253 /* ShellScript */, + D5291D651C283B5400B702C9 /* Sources */, + D5291D661C283B5400B702C9 /* Frameworks */, + D5291D671C283B5400B702C9 /* Resources */, + D5291D9F1C283ECD00B702C9 /* ShellScript */, ); buildRules = ( ); dependencies = ( - D5DC59ED1C20593E003BD79B /* PBXTargetDependency */, + D5291D6C1C283B5400B702C9 /* PBXTargetDependency */, ); - name = CacheTests; - productName = CacheTests; - productReference = D5DC59EA1C20593E003BD79B /* CacheTests.xctest */; + name = "Cache-Mac-Tests"; + productName = "Cache-MacTests"; + productReference = D5291D691C283B5400B702C9 /* Cache-Mac-Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + D5DC59DF1C20593E003BD79B /* Cache-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = D5DC59F41C20593E003BD79B /* Build configuration list for PBXNativeTarget "Cache-iOS" */; + buildPhases = ( + D5DC59DB1C20593E003BD79B /* Sources */, + D5DC59DC1C20593E003BD79B /* Frameworks */, + D5DC59DD1C20593E003BD79B /* Headers */, + D5DC59DE1C20593E003BD79B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Cache-iOS"; + productName = Cache; + productReference = D5DC59E01C20593E003BD79B /* Cache.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -368,10 +564,16 @@ LastUpgradeCheck = 0720; ORGANIZATIONNAME = "Hyper Interaktiv AS"; TargetAttributes = { - D5DC59DF1C20593E003BD79B = { + D5291D171C2837DB00B702C9 = { CreatedOnToolsVersion = 7.2; }; - D5DC59E91C20593E003BD79B = { + D5291D5F1C283B5300B702C9 = { + CreatedOnToolsVersion = 7.2; + }; + D5291D681C283B5400B702C9 = { + CreatedOnToolsVersion = 7.2; + }; + D5DC59DF1C20593E003BD79B = { CreatedOnToolsVersion = 7.2; }; }; @@ -389,20 +591,36 @@ projectRoot = ""; targets = ( D5DC59DF1C20593E003BD79B /* Cache-iOS */, - D5DC59E91C20593E003BD79B /* CacheTests */, + D5291D171C2837DB00B702C9 /* Cache-iOS-Tests */, + D5291D5F1C283B5300B702C9 /* Cache-Mac */, + D5291D681C283B5400B702C9 /* Cache-Mac-Tests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - D5DC59DE1C20593E003BD79B /* Resources */ = { + D5291D161C2837DB00B702C9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D5291D5E1C283B5300B702C9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D5291D671C283B5400B702C9 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; - D5DC59E81C20593E003BD79B /* Resources */ = { + D5DC59DE1C20593E003BD79B /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( @@ -412,7 +630,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - D56DA9D11C205D8C003E7253 /* ShellScript */ = { + D5291D591C283AA700B702C9 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -424,73 +642,236 @@ outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; - shellPath = "/bin/sh "; + shellPath = /bin/sh; + shellScript = "/usr/local/bin/carthage copy-frameworks"; + }; + D5291D9F1C283ECD00B702C9 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/Carthage/Build/Mac/Quick.framework", + "$(SRCROOT)/Carthage/Build/Mac/Nimble.framework", + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; shellScript = "/usr/local/bin/carthage copy-frameworks"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - D5DC59DB1C20593E003BD79B /* Sources */ = { + D5291D141C2837DB00B702C9 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D5DC5A561C205AC9003BD79B /* MemoryStorage.swift in Sources */, - D5DC5A4E1C205AC9003BD79B /* StorageKind.swift in Sources */, - D5DC5A541C205AC9003BD79B /* DefaultCacheConverter.swift in Sources */, - D5DC5A4D1C205AC9003BD79B /* JSON.swift in Sources */, - D5DC5A4C1C205AC9003BD79B /* Expiry.swift in Sources */, - D5DC5A501C205AC9003BD79B /* NSData+Cache.swift in Sources */, - D5DC5A511C205AC9003BD79B /* NSDate+Cache.swift in Sources */, - D5DC5A481C205AC9003BD79B /* HybridCache.swift in Sources */, - D5DC5A521C205AC9003BD79B /* String+Cache.swift in Sources */, - D5DC5A471C205AC9003BD79B /* Cache.swift in Sources */, - D5DC5A551C205AC9003BD79B /* DiskStorage.swift in Sources */, - D5DC5A4F1C205AC9003BD79B /* JSON+Cache.swift in Sources */, - D5DC5A581C205AC9003BD79B /* StorageFactory.swift in Sources */, - D5DC5A4A1C205AC9003BD79B /* Cachable.swift in Sources */, - D5DC5A4B1C205AC9003BD79B /* Capsule.swift in Sources */, - D5DC5A571C205AC9003BD79B /* StorageAware.swift in Sources */, - D5DC5A491C205AC9003BD79B /* Config.swift in Sources */, - D5DC5A531C205AC9003BD79B /* UIImage+Cache.swift in Sources */, + D5291D351C28389B00B702C9 /* SpecHelper.swift in Sources */, + D5291D371C28389B00B702C9 /* CacheSpec.swift in Sources */, + D5291D441C28389B00B702C9 /* StorageFactorySpec.swift in Sources */, + D5291D391C28389B00B702C9 /* CapsuleSpec.swift in Sources */, + D5291D361C28389B00B702C9 /* User.swift in Sources */, + D5291D3E1C28389B00B702C9 /* NSData+CacheSpec.swift in Sources */, + D5291D3F1C28389B00B702C9 /* NSDate+CacheSpec.swift in Sources */, + D5291D3C1C28389B00B702C9 /* StorageKindSpec.swift in Sources */, + D5291D3A1C28389B00B702C9 /* ExpirySpec.swift in Sources */, + D5291D3B1C28389B00B702C9 /* JSONSpec.swift in Sources */, + D5291DA11C28405900B702C9 /* UIImage+CacheTests.swift in Sources */, + D5291D381C28389B00B702C9 /* ConfigSpec.swift in Sources */, + D5291D431C28389B00B702C9 /* MemoryStorageSpec.swift in Sources */, + D5291D401C28389B00B702C9 /* String+CacheSpec.swift in Sources */, + D5291D9A1C283DB300B702C9 /* UIImage+CacheSpec.swift in Sources */, + D5291D411C28389B00B702C9 /* DefaultCacheConverterSpec.swift in Sources */, + D5291D3D1C28389B00B702C9 /* JSON+CacheSpec.swift in Sources */, + D5291D421C28389B00B702C9 /* DiskStorageSpec.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - D5DC59E61C20593E003BD79B /* Sources */ = { + D5291D5B1C283B5300B702C9 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D5DC5A5A1C205B04003BD79B /* User.swift in Sources */, - D5DC5A6A1C205B41003BD79B /* MemoryStorageSpec.swift in Sources */, - D5DC5A5C1C205B12003BD79B /* CacheSpec.swift in Sources */, - D5DC5A6B1C205B41003BD79B /* StorageFactorySpec.swift in Sources */, - D5DC5A5E1C205B19003BD79B /* CapsuleSpec.swift in Sources */, - D5DC5A5B1C205B07003BD79B /* UIImage+CacheTests.swift in Sources */, - D5DC5A591C205AEF003BD79B /* SpecHelper.swift in Sources */, - D5DC5A631C205B2A003BD79B /* NSData+CacheSpec.swift in Sources */, - D5DC5A651C205B2F003BD79B /* NSDate+CacheSpec.swift in Sources */, - D5DC5A611C205B22003BD79B /* StorageKindSpec.swift in Sources */, - D5DC5A5F1C205B1C003BD79B /* ExpirySpec.swift in Sources */, - D5DC5A671C205B2F003BD79B /* UIImage+CacheSpec.swift in Sources */, - D5DC5A601C205B1F003BD79B /* JSONSpec.swift in Sources */, - D5DC5A691C205B41003BD79B /* DiskStorageSpec.swift in Sources */, - D5DC5A5D1C205B16003BD79B /* ConfigSpec.swift in Sources */, - D5DC5A661C205B2F003BD79B /* String+CacheSpec.swift in Sources */, - D5DC5A681C205B3D003BD79B /* DefaultCacheConverterSpec.swift in Sources */, - D5DC5A621C205B26003BD79B /* JSON+CacheSpec.swift in Sources */, + D5291D941C283CFB00B702C9 /* MemoryStorage.swift in Sources */, + D5291D921C283CFB00B702C9 /* DefaultCacheConverter.swift in Sources */, + D5291D8B1C283CFB00B702C9 /* Expiry.swift in Sources */, + D5291D891C283CFB00B702C9 /* Cachable.swift in Sources */, + D5291D961C283CFB00B702C9 /* StorageFactory.swift in Sources */, + D5291D7E1C283BF200B702C9 /* HybridCache.swift in Sources */, + D5291D8C1C283CFB00B702C9 /* JSON.swift in Sources */, + D5291D8E1C283CFB00B702C9 /* JSON+Cache.swift in Sources */, + D5291D8A1C283CFB00B702C9 /* Capsule.swift in Sources */, + D5291D7D1C283BF200B702C9 /* NSImage+Cache.swift in Sources */, + D5291D881C283CFB00B702C9 /* Config.swift in Sources */, + D5291D951C283CFB00B702C9 /* StorageAware.swift in Sources */, + D5291D871C283CFB00B702C9 /* Cache.swift in Sources */, + D5291D911C283CFB00B702C9 /* String+Cache.swift in Sources */, + D5291D901C283CFB00B702C9 /* NSDate+Cache.swift in Sources */, + D5291D931C283CFB00B702C9 /* DiskStorage.swift in Sources */, + D5291D861C283CFB00B702C9 /* BasicHybridCache.swift in Sources */, + D5291D8D1C283CFB00B702C9 /* StorageKind.swift in Sources */, + D5291D8F1C283CFB00B702C9 /* NSData+Cache.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D5291D651C283B5400B702C9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D5291D9C1C283DD900B702C9 /* NSImage+CacheSpec.swift in Sources */, + D5291D851C283C7C00B702C9 /* SpecHelper+OSX.swift in Sources */, + D5291DA31C2841D200B702C9 /* NSImage+CacheTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D5DC59DB1C20593E003BD79B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D5291C2E1C28220B00B702C9 /* Cachable.swift in Sources */, + D5291C311C28220B00B702C9 /* JSON.swift in Sources */, + D5291C361C28220B00B702C9 /* String+Cache.swift in Sources */, + D5291C341C28220B00B702C9 /* NSData+Cache.swift in Sources */, + D5291C3A1C28220B00B702C9 /* StorageAware.swift in Sources */, + D5291C381C28220B00B702C9 /* DiskStorage.swift in Sources */, + D5291C391C28220B00B702C9 /* MemoryStorage.swift in Sources */, + D5291C3B1C28220B00B702C9 /* StorageFactory.swift in Sources */, + D5291C291C28220B00B702C9 /* UIImage+Cache.swift in Sources */, + D5291C351C28220B00B702C9 /* NSDate+Cache.swift in Sources */, + D5291C371C28220B00B702C9 /* DefaultCacheConverter.swift in Sources */, + D5291C6D1C2827FB00B702C9 /* Cache.swift in Sources */, + D5291C321C28220B00B702C9 /* StorageKind.swift in Sources */, + D5291C301C28220B00B702C9 /* Expiry.swift in Sources */, + D5291C331C28220B00B702C9 /* JSON+Cache.swift in Sources */, + D5291C2F1C28220B00B702C9 /* Capsule.swift in Sources */, + D5291C2D1C28220B00B702C9 /* Config.swift in Sources */, + D5291C6C1C2827FB00B702C9 /* BasicHybridCache.swift in Sources */, + D5291C731C28296B00B702C9 /* HybridCache.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - D5DC59ED1C20593E003BD79B /* PBXTargetDependency */ = { + D5291D1F1C2837DB00B702C9 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = D5DC59DF1C20593E003BD79B /* Cache-iOS */; - targetProxy = D5DC59EC1C20593E003BD79B /* PBXContainerItemProxy */; + targetProxy = D5291D1E1C2837DB00B702C9 /* PBXContainerItemProxy */; + }; + D5291D6C1C283B5400B702C9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D5291D5F1C283B5300B702C9 /* Cache-Mac */; + targetProxy = D5291D6B1C283B5400B702C9 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + D5291D211C2837DB00B702C9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = "$(SRCROOT)/Tests/iOS/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Cache-iOS-Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + D5291D221C2837DB00B702C9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = "$(SRCROOT)/Tests/iOS/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Cache-iOS-Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + D5291D721C283B5400B702C9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = "$(SRCROOT)/SupportFiles/Mac/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Cache-Mac"; + PRODUCT_NAME = Cache; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + D5291D731C283B5400B702C9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = "$(SRCROOT)/SupportFiles/Mac/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Cache-Mac"; + PRODUCT_NAME = Cache; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Release; + }; + D5291D751C283B5400B702C9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = "$(SRCROOT)/Tests/Mac/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Cache-MacTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Debug; + }; + D5291D761C283B5400B702C9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = "$(SRCROOT)/Tests/Mac/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Cache-MacTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Release; + }; D5DC59F21C20593E003BD79B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -587,7 +968,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "$(SRCROOT)/SupportFiles/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/SupportFiles/iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -604,7 +985,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "$(SRCROOT)/SupportFiles/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/SupportFiles/iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -614,37 +995,33 @@ }; name = Release; }; - D5DC59F81C20593E003BD79B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = "$(SRCROOT)/Tests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = no.hyper.CacheTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - D5DC59F91C20593E003BD79B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = "$(SRCROOT)/Tests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = no.hyper.CacheTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + D5291D201C2837DB00B702C9 /* Build configuration list for PBXNativeTarget "Cache-iOS-Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D5291D211C2837DB00B702C9 /* Debug */, + D5291D221C2837DB00B702C9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + D5291D711C283B5400B702C9 /* Build configuration list for PBXNativeTarget "Cache-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D5291D721C283B5400B702C9 /* Debug */, + D5291D731C283B5400B702C9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + D5291D741C283B5400B702C9 /* Build configuration list for PBXNativeTarget "Cache-Mac-Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D5291D751C283B5400B702C9 /* Debug */, + D5291D761C283B5400B702C9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; D5DC59DA1C20593E003BD79B /* Build configuration list for PBXProject "Cache" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -663,15 +1040,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - D5DC59F71C20593E003BD79B /* Build configuration list for PBXNativeTarget "CacheTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D5DC59F81C20593E003BD79B /* Debug */, - D5DC59F91C20593E003BD79B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = D5DC59D71C20593E003BD79B /* Project object */; diff --git a/Cache.xcodeproj/xcshareddata/xcschemes/Cache-Mac.xcscheme b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-Mac.xcscheme new file mode 100644 index 00000000..5cd3e082 --- /dev/null +++ b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-Mac.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Cache.xcodeproj/xcshareddata/xcschemes/Cache-iOS.xcscheme b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-iOS.xcscheme index 5140ca22..807fe488 100644 --- a/Cache.xcodeproj/xcshareddata/xcschemes/Cache-iOS.xcscheme +++ b/Cache.xcodeproj/xcshareddata/xcschemes/Cache-iOS.xcscheme @@ -32,9 +32,9 @@ skipped = "NO"> diff --git a/Example/CacheDemo/Podfile.lock b/Example/CacheDemo/Podfile.lock index ce3e4109..3364f49d 100644 --- a/Example/CacheDemo/Podfile.lock +++ b/Example/CacheDemo/Podfile.lock @@ -9,6 +9,6 @@ EXTERNAL SOURCES: :path: ../../ SPEC CHECKSUMS: - Cache: 5f381cc23cb2c69bc70b8cd2a5e260d006b03b6d + Cache: 78f58bc008313c7a1182967a2ebcb3de9fddecd4 COCOAPODS: 0.39.0 diff --git a/README.md b/README.md index 9dc4873e..afd5bab7 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ launches. Disk cache is the most reliable choice here. (if default implementations of memory and disk caches don't fit your purpose for some reason). - `NSData` encoding and decoding required by `Cachable` protocol are implemented for `UIImage`, `String`, `JSON` and `NSData`. +- iOS and OSX support. ## Usage diff --git a/Source/Mac/Extensions/NSImage+Cache.swift b/Source/Mac/Extensions/NSImage+Cache.swift new file mode 100644 index 00000000..e23e3958 --- /dev/null +++ b/Source/Mac/Extensions/NSImage+Cache.swift @@ -0,0 +1,45 @@ +import Foundation +import Cocoa + +// MARK: - Cachable + +extension NSImage: Cachable { + + public typealias CacheType = NSImage + + public static func decode(data: NSData) -> CacheType? { + let image = NSImage(data: data) + return image + } + + public func encode() -> NSData? { + guard let data = TIFFRepresentation else { return nil } + + let imageFileType: NSBitmapImageFileType = hasAlpha + ? .NSPNGFileType + : .NSJPEGFileType + + return NSBitmapImageRep(data: data)?.representationUsingType(imageFileType, properties: [:]) + } +} + +// MARK: - Helpers + +extension NSImage { + + var hasAlpha: Bool { + var imageRect:CGRect = CGRectMake(0, 0, size.width, size.height) + let imageRef = CGImageForProposedRect(&imageRect, context: nil, hints: nil) + let result: Bool + let alpha = CGImageGetAlphaInfo(imageRef) + + switch alpha { + case .None, .NoneSkipFirst, .NoneSkipLast: + result = false + default: + result = true + } + + return result + } +} diff --git a/Source/Mac/HybridCache.swift b/Source/Mac/HybridCache.swift new file mode 100644 index 00000000..63e07a59 --- /dev/null +++ b/Source/Mac/HybridCache.swift @@ -0,0 +1,35 @@ +import Cocoa + +public class HybridCache: BasicHybridCache { + + // MARK: - Inititalization + + public override init(name: String, config: Config = Config.defaultConfig) { + super.init(name: name, config: config) + + let notificationCenter = NSNotificationCenter.defaultCenter() + + notificationCenter.addObserver(self, selector: "applicationWillTerminate", + name: NSApplicationWillTerminateNotification, object: nil) + notificationCenter.addObserver(self, selector: "applicationDidResignActive", + name: NSApplicationDidResignActiveNotification, object: nil) + } + + deinit { + NSNotificationCenter.defaultCenter().removeObserver(self) + } + + // MARK: - Notifications + + func applicationDidReceiveMemoryWarning() { + frontStorage.clearExpired(nil) + } + + func applicationWillTerminate() { + backStorage.clearExpired(nil) + } + + func applicationDidResignActive() { + backStorage.clearExpired(nil) + } +} diff --git a/Source/Cache/HybridCache.swift b/Source/Shared/BasicHybridCache.swift similarity index 53% rename from Source/Cache/HybridCache.swift rename to Source/Shared/BasicHybridCache.swift index 05d30e8f..5d2cec43 100644 --- a/Source/Cache/HybridCache.swift +++ b/Source/Shared/BasicHybridCache.swift @@ -1,6 +1,6 @@ -import UIKit +import Foundation -public class HybridCache: NSObject { +public class BasicHybridCache: NSObject { public let name: String @@ -18,19 +18,6 @@ public class HybridCache: NSObject { backStorage = StorageFactory.resolve(name, kind: config.backKind, maxSize: config.maxSize) super.init() - - let notificationCenter = NSNotificationCenter.defaultCenter() - - notificationCenter.addObserver(self, selector: "applicationDidReceiveMemoryWarning", - name: UIApplicationDidReceiveMemoryWarningNotification, object: nil) - notificationCenter.addObserver(self, selector: "applicationWillTerminate", - name: UIApplicationWillTerminateNotification, object: nil) - notificationCenter.addObserver(self, selector: "applicationDidEnterBackground", - name: UIApplicationDidEnterBackgroundNotification, object: nil) - } - - deinit { - NSNotificationCenter.defaultCenter().removeObserver(self) } // MARK: - Caching @@ -93,38 +80,4 @@ public class HybridCache: NSObject { } } } - - // MARK: - Notifications - - func applicationDidReceiveMemoryWarning() { - frontStorage.clearExpired(nil) - } - - func applicationWillTerminate() { - backStorage.clearExpired(nil) - } - - func applicationDidEnterBackground() { - let application = UIApplication.sharedApplication() - var backgroundTask: UIBackgroundTaskIdentifier? - - backgroundTask = application.beginBackgroundTaskWithExpirationHandler { [weak self] in - guard let weakSelf = self, var backgroundTask = backgroundTask else { return } - - weakSelf.endBackgroundTask(&backgroundTask) - } - - backStorage.clearExpired { [weak self] in - guard let weakSelf = self, var backgroundTask = backgroundTask else { return } - - dispatch_async(dispatch_get_main_queue()) { - weakSelf.endBackgroundTask(&backgroundTask) - } - } - } - - func endBackgroundTask(inout task: UIBackgroundTaskIdentifier) { - UIApplication.sharedApplication().endBackgroundTask(task) - task = UIBackgroundTaskInvalid - } } diff --git a/Source/Cache/Cache.swift b/Source/Shared/Cache.swift similarity index 90% rename from Source/Cache/Cache.swift rename to Source/Shared/Cache.swift index 1fa57620..0a16b5a7 100644 --- a/Source/Cache/Cache.swift +++ b/Source/Shared/Cache.swift @@ -1,6 +1,6 @@ import Foundation -public class Cache: HybridCache { +public class Cache: BasicHybridCache { public override init(name: String, config: Config = Config.defaultConfig) { super.init(name: name, config: config) diff --git a/Source/Config.swift b/Source/Shared/Config.swift similarity index 100% rename from Source/Config.swift rename to Source/Shared/Config.swift diff --git a/Source/DataStructures/Cachable.swift b/Source/Shared/DataStructures/Cachable.swift similarity index 100% rename from Source/DataStructures/Cachable.swift rename to Source/Shared/DataStructures/Cachable.swift diff --git a/Source/DataStructures/Capsule.swift b/Source/Shared/DataStructures/Capsule.swift similarity index 100% rename from Source/DataStructures/Capsule.swift rename to Source/Shared/DataStructures/Capsule.swift diff --git a/Source/DataStructures/Expiry.swift b/Source/Shared/DataStructures/Expiry.swift similarity index 100% rename from Source/DataStructures/Expiry.swift rename to Source/Shared/DataStructures/Expiry.swift diff --git a/Source/DataStructures/JSON.swift b/Source/Shared/DataStructures/JSON.swift similarity index 100% rename from Source/DataStructures/JSON.swift rename to Source/Shared/DataStructures/JSON.swift diff --git a/Source/DataStructures/StorageKind.swift b/Source/Shared/DataStructures/StorageKind.swift similarity index 100% rename from Source/DataStructures/StorageKind.swift rename to Source/Shared/DataStructures/StorageKind.swift diff --git a/Source/Extensions/JSON+Cache.swift b/Source/Shared/Extensions/JSON+Cache.swift similarity index 100% rename from Source/Extensions/JSON+Cache.swift rename to Source/Shared/Extensions/JSON+Cache.swift diff --git a/Source/Extensions/NSData+Cache.swift b/Source/Shared/Extensions/NSData+Cache.swift similarity index 100% rename from Source/Extensions/NSData+Cache.swift rename to Source/Shared/Extensions/NSData+Cache.swift diff --git a/Source/Extensions/NSDate+Cache.swift b/Source/Shared/Extensions/NSDate+Cache.swift similarity index 100% rename from Source/Extensions/NSDate+Cache.swift rename to Source/Shared/Extensions/NSDate+Cache.swift diff --git a/Source/Extensions/String+Cache.swift b/Source/Shared/Extensions/String+Cache.swift similarity index 100% rename from Source/Extensions/String+Cache.swift rename to Source/Shared/Extensions/String+Cache.swift diff --git a/Source/Library/DefaultCacheConverter.swift b/Source/Shared/Library/DefaultCacheConverter.swift similarity index 96% rename from Source/Library/DefaultCacheConverter.swift rename to Source/Shared/Library/DefaultCacheConverter.swift index 4005f134..59ed9dac 100644 --- a/Source/Library/DefaultCacheConverter.swift +++ b/Source/Shared/Library/DefaultCacheConverter.swift @@ -1,4 +1,4 @@ -import UIKit +import Foundation public enum EncodingError: ErrorType { case InvalidSize diff --git a/Source/Storage/DiskStorage.swift b/Source/Shared/Storage/DiskStorage.swift similarity index 100% rename from Source/Storage/DiskStorage.swift rename to Source/Shared/Storage/DiskStorage.swift diff --git a/Source/Storage/MemoryStorage.swift b/Source/Shared/Storage/MemoryStorage.swift similarity index 100% rename from Source/Storage/MemoryStorage.swift rename to Source/Shared/Storage/MemoryStorage.swift diff --git a/Source/Storage/StorageAware.swift b/Source/Shared/Storage/StorageAware.swift similarity index 100% rename from Source/Storage/StorageAware.swift rename to Source/Shared/Storage/StorageAware.swift diff --git a/Source/Storage/StorageFactory.swift b/Source/Shared/Storage/StorageFactory.swift similarity index 100% rename from Source/Storage/StorageFactory.swift rename to Source/Shared/Storage/StorageFactory.swift diff --git a/Source/Extensions/UIImage+Cache.swift b/Source/iOS/Extensions/UIImage+Cache.swift similarity index 100% rename from Source/Extensions/UIImage+Cache.swift rename to Source/iOS/Extensions/UIImage+Cache.swift diff --git a/Source/iOS/HybridCache.swift b/Source/iOS/HybridCache.swift new file mode 100644 index 00000000..4b0680e1 --- /dev/null +++ b/Source/iOS/HybridCache.swift @@ -0,0 +1,57 @@ +import UIKit + +public class HybridCache: BasicHybridCache { + + // MARK: - Inititalization + + public override init(name: String, config: Config = Config.defaultConfig) { + super.init(name: name, config: config) + + let notificationCenter = NSNotificationCenter.defaultCenter() + + notificationCenter.addObserver(self, selector: "applicationDidReceiveMemoryWarning", + name: UIApplicationDidReceiveMemoryWarningNotification, object: nil) + notificationCenter.addObserver(self, selector: "applicationWillTerminate", + name: UIApplicationWillTerminateNotification, object: nil) + notificationCenter.addObserver(self, selector: "applicationDidEnterBackground", + name: UIApplicationDidEnterBackgroundNotification, object: nil) + } + + deinit { + NSNotificationCenter.defaultCenter().removeObserver(self) + } + + // MARK: - Notifications + + func applicationDidReceiveMemoryWarning() { + frontStorage.clearExpired(nil) + } + + func applicationWillTerminate() { + backStorage.clearExpired(nil) + } + + func applicationDidEnterBackground() { + let application = UIApplication.sharedApplication() + var backgroundTask: UIBackgroundTaskIdentifier? + + backgroundTask = application.beginBackgroundTaskWithExpirationHandler { [weak self] in + guard let weakSelf = self, var backgroundTask = backgroundTask else { return } + + weakSelf.endBackgroundTask(&backgroundTask) + } + + backStorage.clearExpired { [weak self] in + guard let weakSelf = self, var backgroundTask = backgroundTask else { return } + + dispatch_async(dispatch_get_main_queue()) { + weakSelf.endBackgroundTask(&backgroundTask) + } + } + } + + func endBackgroundTask(inout task: UIBackgroundTaskIdentifier) { + UIApplication.sharedApplication().endBackgroundTask(task) + task = UIBackgroundTaskInvalid + } +} diff --git a/SupportFiles/Mac/Info.plist b/SupportFiles/Mac/Info.plist new file mode 100644 index 00000000..df780ed5 --- /dev/null +++ b/SupportFiles/Mac/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2015 Hyper Interaktiv AS. All rights reserved. + NSPrincipalClass + + + diff --git a/SupportFiles/Info.plist b/SupportFiles/iOS/Info.plist similarity index 100% rename from SupportFiles/Info.plist rename to SupportFiles/iOS/Info.plist diff --git a/Tests/Mac/Helpers/NSImage+CacheTests.swift b/Tests/Mac/Helpers/NSImage+CacheTests.swift new file mode 100644 index 00000000..0e612be0 --- /dev/null +++ b/Tests/Mac/Helpers/NSImage+CacheTests.swift @@ -0,0 +1,20 @@ +import Cocoa +@testable import Cache + +extension NSImage { + + func isEqualToImage(image: NSImage) -> Bool { + return data.isEqualToData(image.data) + } + + var data: NSData { + let representation = TIFFRepresentation! + + let imageFileType: NSBitmapImageFileType = hasAlpha + ? .NSPNGFileType + : .NSJPEGFileType + + return (NSBitmapImageRep(data: representation)?.representationUsingType( + imageFileType, properties: [:]))! + } +} diff --git a/Tests/Mac/Helpers/SpecHelper+OSX.swift b/Tests/Mac/Helpers/SpecHelper+OSX.swift new file mode 100644 index 00000000..49519791 --- /dev/null +++ b/Tests/Mac/Helpers/SpecHelper+OSX.swift @@ -0,0 +1,12 @@ +import Cocoa + +struct SpecHelper { + + static func image(color: NSColor = NSColor.redColor(), size: NSSize = CGSize(width: 1, height: 1)) -> NSImage { + let image = NSImage(size: size) + image.lockFocus() + color.drawSwatchInRect(NSMakeRect(0, 0, size.width, size.height)) + image.unlockFocus() + return image + } +} diff --git a/Tests/Info.plist b/Tests/Mac/Info.plist similarity index 100% rename from Tests/Info.plist rename to Tests/Mac/Info.plist diff --git a/Tests/Mac/Specs/Extensions/NSImage+CacheSpec.swift b/Tests/Mac/Specs/Extensions/NSImage+CacheSpec.swift new file mode 100644 index 00000000..e2ee84ff --- /dev/null +++ b/Tests/Mac/Specs/Extensions/NSImage+CacheSpec.swift @@ -0,0 +1,41 @@ +import Quick +import Nimble +@testable import Cache + +class NSImageCacheSpec: QuickSpec { + + override func spec() { + describe("NSImage+Cache") { + + describe("Cachable") { + describe(".decode") { + it("decodes from NSData") { + let image = SpecHelper.image() + let data = image.encode()! + let result = NSImage.decode(data)! + + expect(result.isEqualToImage(image)).to(beTrue()) + } + } + + describe("#encode") { + it("encodes to NSData") { + let image = SpecHelper.image() + let representation = image.TIFFRepresentation! + + let imageFileType: NSBitmapImageFileType = image.hasAlpha + ? .NSPNGFileType + : .NSJPEGFileType + + let data = NSBitmapImageRep(data: representation)!.representationUsingType( + imageFileType, properties: [:]) + + let result = image.encode()! + + expect(result).to(equal(data)) + } + } + } + } + } +} diff --git a/Tests/Helpers/SpecHelper.swift b/Tests/iOS/Helpers/SpecHelper.swift similarity index 100% rename from Tests/Helpers/SpecHelper.swift rename to Tests/iOS/Helpers/SpecHelper.swift diff --git a/Tests/Helpers/Extensions/UIImage+CacheTests.swift b/Tests/iOS/Helpers/UIImage+CacheTests.swift similarity index 100% rename from Tests/Helpers/Extensions/UIImage+CacheTests.swift rename to Tests/iOS/Helpers/UIImage+CacheTests.swift diff --git a/Tests/Helpers/Data/User.swift b/Tests/iOS/Helpers/User.swift similarity index 100% rename from Tests/Helpers/Data/User.swift rename to Tests/iOS/Helpers/User.swift diff --git a/Tests/iOS/Info.plist b/Tests/iOS/Info.plist new file mode 100644 index 00000000..ba72822e --- /dev/null +++ b/Tests/iOS/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Tests/Specs/CacheSpec.swift b/Tests/iOS/Specs/CacheSpec.swift similarity index 100% rename from Tests/Specs/CacheSpec.swift rename to Tests/iOS/Specs/CacheSpec.swift diff --git a/Tests/Specs/ConfigSpec.swift b/Tests/iOS/Specs/ConfigSpec.swift similarity index 100% rename from Tests/Specs/ConfigSpec.swift rename to Tests/iOS/Specs/ConfigSpec.swift diff --git a/Tests/Specs/DataStructures/CapsuleSpec.swift b/Tests/iOS/Specs/DataStructures/CapsuleSpec.swift similarity index 100% rename from Tests/Specs/DataStructures/CapsuleSpec.swift rename to Tests/iOS/Specs/DataStructures/CapsuleSpec.swift diff --git a/Tests/Specs/DataStructures/ExpirySpec.swift b/Tests/iOS/Specs/DataStructures/ExpirySpec.swift similarity index 100% rename from Tests/Specs/DataStructures/ExpirySpec.swift rename to Tests/iOS/Specs/DataStructures/ExpirySpec.swift diff --git a/Tests/Specs/DataStructures/JSONSpec.swift b/Tests/iOS/Specs/DataStructures/JSONSpec.swift similarity index 100% rename from Tests/Specs/DataStructures/JSONSpec.swift rename to Tests/iOS/Specs/DataStructures/JSONSpec.swift diff --git a/Tests/Specs/DataStructures/StorageKindSpec.swift b/Tests/iOS/Specs/DataStructures/StorageKindSpec.swift similarity index 100% rename from Tests/Specs/DataStructures/StorageKindSpec.swift rename to Tests/iOS/Specs/DataStructures/StorageKindSpec.swift diff --git a/Tests/Specs/Extensions/JSON+CacheSpec.swift b/Tests/iOS/Specs/Extensions/JSON+CacheSpec.swift similarity index 100% rename from Tests/Specs/Extensions/JSON+CacheSpec.swift rename to Tests/iOS/Specs/Extensions/JSON+CacheSpec.swift diff --git a/Tests/Specs/Extensions/NSData+CacheSpec.swift b/Tests/iOS/Specs/Extensions/NSData+CacheSpec.swift similarity index 100% rename from Tests/Specs/Extensions/NSData+CacheSpec.swift rename to Tests/iOS/Specs/Extensions/NSData+CacheSpec.swift diff --git a/Tests/Specs/Extensions/NSDate+CacheSpec.swift b/Tests/iOS/Specs/Extensions/NSDate+CacheSpec.swift similarity index 100% rename from Tests/Specs/Extensions/NSDate+CacheSpec.swift rename to Tests/iOS/Specs/Extensions/NSDate+CacheSpec.swift diff --git a/Tests/Specs/Extensions/String+CacheSpec.swift b/Tests/iOS/Specs/Extensions/String+CacheSpec.swift similarity index 100% rename from Tests/Specs/Extensions/String+CacheSpec.swift rename to Tests/iOS/Specs/Extensions/String+CacheSpec.swift diff --git a/Tests/Specs/Extensions/UIImage+CacheSpec.swift b/Tests/iOS/Specs/Extensions/UIImage+CacheSpec.swift similarity index 100% rename from Tests/Specs/Extensions/UIImage+CacheSpec.swift rename to Tests/iOS/Specs/Extensions/UIImage+CacheSpec.swift diff --git a/Tests/Specs/Library/DefaultCacheConverterSpec.swift b/Tests/iOS/Specs/Library/DefaultCacheConverterSpec.swift similarity index 100% rename from Tests/Specs/Library/DefaultCacheConverterSpec.swift rename to Tests/iOS/Specs/Library/DefaultCacheConverterSpec.swift diff --git a/Tests/Specs/Storage/DiskStorageSpec.swift b/Tests/iOS/Specs/Storage/DiskStorageSpec.swift similarity index 100% rename from Tests/Specs/Storage/DiskStorageSpec.swift rename to Tests/iOS/Specs/Storage/DiskStorageSpec.swift diff --git a/Tests/Specs/Storage/MemoryStorageSpec.swift b/Tests/iOS/Specs/Storage/MemoryStorageSpec.swift similarity index 100% rename from Tests/Specs/Storage/MemoryStorageSpec.swift rename to Tests/iOS/Specs/Storage/MemoryStorageSpec.swift diff --git a/Tests/Specs/Storage/StorageFactorySpec.swift b/Tests/iOS/Specs/Storage/StorageFactorySpec.swift similarity index 100% rename from Tests/Specs/Storage/StorageFactorySpec.swift rename to Tests/iOS/Specs/Storage/StorageFactorySpec.swift