Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cache.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '11.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '11.0'
s.watchos.deployment_target = '5.0'

s.requires_arc = true
s.ios.source_files = 'Source/{iOS,Shared}/**/*'
s.osx.source_files = 'Source/{Mac,Shared}/**/*'
s.tvos.source_files = 'Source/{iOS,Shared}/**/*'
s.watchos.source_files = 'Source/{iOS,Shared}/**/*'
s.resources = 'Source/PrivacyInfo.xcprivacy'

s.frameworks = 'Foundation'
Expand Down
208 changes: 208 additions & 0 deletions Cache.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Source/Shared/Configuration/DiskConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public struct DiskConfig {
public let maxSize: UInt
/// A folder to store the disk cache contents. Defaults to a prefixed directory in Caches if nil
public let directory: URL?
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(watchOS)
/// Data protection is used to store files in an encrypted format on disk and to decrypt them on demand.
/// Support only on iOS and tvOS.
public let protectionType: FileProtectionType?
Expand Down
2 changes: 1 addition & 1 deletion Source/Shared/Library/ImageWrapper.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

#if os(iOS) || os(tvOS) || os(macOS)
#if os(iOS) || os(tvOS) || os(macOS) || os(watchOS)
public struct ImageWrapper: Codable {
public let image: Image

Expand Down
2 changes: 1 addition & 1 deletion Source/Shared/Library/TransformerFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class TransformerFactory {
return Transformer<Data>(toData: toData, fromData: fromData)
}

#if os(iOS) || os(tvOS) || os(macOS) || os(visionOS)
#if os(iOS) || os(tvOS) || os(macOS) || os(watchOS) || os(visionOS)
public static func forImage() -> Transformer<Image> {
let toData: (Image) throws -> Data = { image in
return try image.cache_toData().unwrapOrThrow(error: StorageError.transformerFail)
Expand Down
2 changes: 1 addition & 1 deletion Source/Shared/Library/Types.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(iOS) || os(tvOS) || os(visionOS)
#if os(iOS) || os(tvOS) || os(watchOS) || os(visionOS)
import UIKit
public typealias Image = UIImage
#elseif os(watchOS)
Expand Down
2 changes: 1 addition & 1 deletion Source/Shared/Storage/DiskStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final public class DiskStorage<Key: Hashable, Value> {
try createDirectory()

// protection
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(watchOS)
if let protectionType = config.protectionType {
try setDirectoryAttributes([
FileAttributeKey.protectionKey: protectionType
Expand Down
2 changes: 1 addition & 1 deletion Source/Shared/Storage/Storage+Transform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public extension Storage {
}


#if os(iOS) || os(tvOS) || os(macOS)
#if os(iOS) || os(tvOS) || os(macOS) || os(watchOS)
func transformImage() -> Storage<Key, Image> {
let storage = transform(transformer: TransformerFactory.forImage())
return storage
Expand Down
22 changes: 22 additions & 0 deletions SupportFiles/watchOS/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>