From 4386d4cbe04e44957d9d47fcc83d7629931b80a5 Mon Sep 17 00:00:00 2001 From: Daniele Pantaleone Date: Wed, 7 Feb 2024 13:39:12 +0100 Subject: [PATCH] Added privacy manifest file --- Package.swift | 3 ++- PersistedProperty.podspec | 24 ++++++++++-------- README.md | 18 +++++-------- .../{Storage => }/Common/AnyOptional.swift | 0 .../{Storage => }/Common/Mutex.swift | 0 .../{Storage => }/Common/MutexType.swift | 0 .../{Storage => }/Common/StorageCoder.swift | 0 Sources/PersistedProperty/Persisted.swift | 6 ++--- .../PersistedProperty/PrivacyInfo.xcprivacy | 25 +++++++++++++++++++ .../Services/KeyChainStorageService.swift | 4 +-- .../Services/UserDefaultsStorageService.swift | 0 .../{Storage => }/Storage.swift | 0 .../{Storage => }/StorageService.swift | 0 13 files changed, 52 insertions(+), 28 deletions(-) rename Sources/PersistedProperty/{Storage => }/Common/AnyOptional.swift (100%) rename Sources/PersistedProperty/{Storage => }/Common/Mutex.swift (100%) rename Sources/PersistedProperty/{Storage => }/Common/MutexType.swift (100%) rename Sources/PersistedProperty/{Storage => }/Common/StorageCoder.swift (100%) create mode 100644 Sources/PersistedProperty/PrivacyInfo.xcprivacy rename Sources/PersistedProperty/{Storage => }/Services/KeyChainStorageService.swift (98%) rename Sources/PersistedProperty/{Storage => }/Services/UserDefaultsStorageService.swift (100%) rename Sources/PersistedProperty/{Storage => }/Storage.swift (100%) rename Sources/PersistedProperty/{Storage => }/StorageService.swift (100%) diff --git a/Package.swift b/Package.swift index ed08cfa..f503b64 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,8 @@ let package = Package( targets: [ .target( name: "PersistedProperty", - dependencies: []), + dependencies: [], + resources: [.copy("PrivacyInfo.xcprivacy")]), .testTarget( name: "PersistedPropertyTests", dependencies: ["PersistedProperty"]) diff --git a/PersistedProperty.podspec b/PersistedProperty.podspec index 0cb0172..8db1a92 100755 --- a/PersistedProperty.podspec +++ b/PersistedProperty.podspec @@ -1,12 +1,16 @@ Pod::Spec.new do |s| - s.name = "PersistedProperty" - s.version = "1.0.0" - s.summary = "A lightweight framework to persist iOS properties written in Swift" - s.license = { :type => "MIT", :file => "LICENSE" } - s.homepage = "https://github.com/danielepantaleone/PersistedProperty" - s.authors = { "Daniele Pantaleone" => "danielepantaleone@me.com" } - s.ios.deployment_target = "11.0" - s.source = { :git => "https://github.com/danielepantaleone/PersistedProperty.git", :tag => "#{s.version}" } - s.source_files = "Sources/PersistedProperty/**/*.swift" - s.swift_version = "5.7" + s.name = "PersistedProperty" + s.version = "1.1.0" + s.summary = "A lightweight framework to persist iOS properties written in Swift" + s.license = { :type => "MIT", :file => "LICENSE" } + s.homepage = "https://github.com/danielepantaleone/PersistedProperty" + s.authors = { "Daniele Pantaleone" => "danielepantaleone@me.com" } + s.ios.deployment_target = "11.0" + s.osx.deployment_target = "10.14" + s.tvos.deployment_target = "13.0" + s.watchos.deployment_target = "8.0" + s.source = { :git => "https://github.com/danielepantaleone/PersistedProperty.git", :tag => "#{s.version}" } + s.source_files = "Sources/PersistedProperty/**/*.swift" + s.resources = "Sources/PersistedProperty/**/*.xcprivacy" + s.swift_version = "5.7" end diff --git a/README.md b/README.md index 7bb331c..6b2695c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ A Swift-based lightweight framework that enable the persistence of Swift propert ## Feature Highlights -- Compatible with **iOS 11+** +- Compatible with iOS, macOS, watchOS and tvOS - Native support for `UserDefaults` based storage - Native support for iOS `KeyChain` based storage - Property persistence achieved through the `@Persisted` property wrapper @@ -61,17 +61,11 @@ Additionally, you can specify your custom storage service by creating your stora /// A custom storage provider conforming to the StorageService protocol class MyCustomStorageService: StorageService { - func load(key: String) -> ValueType? where ValueType: Codable { - // your code goes here - } + func load(key: String) -> ValueType? where ValueType: Codable ... - func save(_ value: ValueType, key: String) where ValueType: Codable { - // your code goes here - } + func save(_ value: ValueType, key: String) where ValueType: Codable ... - func remove(key: String) { - // your code goes here - } + func remove(key: String) ... } @@ -89,7 +83,7 @@ var myProperty: Double = 10.0 Add the dependency to the `PersistedProperty` framework in your `Podfile`: ```ruby -pod 'PersistedProperty', '~> 1.0.0' +pod 'PersistedProperty', '~> 1.1.0' ``` ### Swift Package Manager @@ -98,7 +92,7 @@ Add it as a dependency in a Swift Package: ```swift dependencies: [ - .package(url: "https://github.com/danielepantaleone/PersistedProperty.git", .upToNextMajor(from: "1.0.0")) + .package(url: "https://github.com/danielepantaleone/PersistedProperty.git", .upToNextMajor(from: "1.1.0")) ] ``` diff --git a/Sources/PersistedProperty/Storage/Common/AnyOptional.swift b/Sources/PersistedProperty/Common/AnyOptional.swift similarity index 100% rename from Sources/PersistedProperty/Storage/Common/AnyOptional.swift rename to Sources/PersistedProperty/Common/AnyOptional.swift diff --git a/Sources/PersistedProperty/Storage/Common/Mutex.swift b/Sources/PersistedProperty/Common/Mutex.swift similarity index 100% rename from Sources/PersistedProperty/Storage/Common/Mutex.swift rename to Sources/PersistedProperty/Common/Mutex.swift diff --git a/Sources/PersistedProperty/Storage/Common/MutexType.swift b/Sources/PersistedProperty/Common/MutexType.swift similarity index 100% rename from Sources/PersistedProperty/Storage/Common/MutexType.swift rename to Sources/PersistedProperty/Common/MutexType.swift diff --git a/Sources/PersistedProperty/Storage/Common/StorageCoder.swift b/Sources/PersistedProperty/Common/StorageCoder.swift similarity index 100% rename from Sources/PersistedProperty/Storage/Common/StorageCoder.swift rename to Sources/PersistedProperty/Common/StorageCoder.swift diff --git a/Sources/PersistedProperty/Persisted.swift b/Sources/PersistedProperty/Persisted.swift index ae5f50a..e0b6d66 100644 --- a/Sources/PersistedProperty/Persisted.swift +++ b/Sources/PersistedProperty/Persisted.swift @@ -12,7 +12,7 @@ import Foundation /// Property wrapper to make properties persistable in a pre-configured storage. -/// In order to mark a property with `@Persisted` the property type must conform to the `Codable` protocol. +/// In order to mark a property with ``@Persisted`` the property type must conform to the ``Codable`` protocol. /// /// Typical usage would be to decorate a property, providing a storage key: /// @@ -22,13 +22,13 @@ import Foundation /// ``` /// /// You can optionally specify the desired storage to use when configuring the property wrapper. -/// If you don't, a default storage backed by the standard `UserDefaults` will be used. +/// If you don't, a default storage backed by the standard ``UserDefaults`` will be used. /// /// ```swift /// @Persisted(key: "storage.password", storage: .keychain) /// var aPassword: String = "abcdefghijklmnopqrstuvwxyz" /// ``` -/// Additionally, you can also create your own storage by adopting to the `StorageService` protocol +/// Additionally, you can also create your own storage by adopting to the ``StorageService`` protocol /// in your custom implementation and specifying the `.custom(service: myService)` storage /// when configuring the property wrapper: /// diff --git a/Sources/PersistedProperty/PrivacyInfo.xcprivacy b/Sources/PersistedProperty/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..b04d9ad --- /dev/null +++ b/Sources/PersistedProperty/PrivacyInfo.xcprivacy @@ -0,0 +1,25 @@ + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + + + + + diff --git a/Sources/PersistedProperty/Storage/Services/KeyChainStorageService.swift b/Sources/PersistedProperty/Services/KeyChainStorageService.swift similarity index 98% rename from Sources/PersistedProperty/Storage/Services/KeyChainStorageService.swift rename to Sources/PersistedProperty/Services/KeyChainStorageService.swift index db120b6..06932e1 100644 --- a/Sources/PersistedProperty/Storage/Services/KeyChainStorageService.swift +++ b/Sources/PersistedProperty/Services/KeyChainStorageService.swift @@ -11,11 +11,11 @@ import Foundation -typealias Query = [CFString: Any] - /// Storage service implementation that persists properties into the iOS `KeyChain`. open class KeyChainStorageService: StorageService { + typealias Query = [CFString: Any] + // MARK: - Shared /// Reference to the shared keychain storage service. diff --git a/Sources/PersistedProperty/Storage/Services/UserDefaultsStorageService.swift b/Sources/PersistedProperty/Services/UserDefaultsStorageService.swift similarity index 100% rename from Sources/PersistedProperty/Storage/Services/UserDefaultsStorageService.swift rename to Sources/PersistedProperty/Services/UserDefaultsStorageService.swift diff --git a/Sources/PersistedProperty/Storage/Storage.swift b/Sources/PersistedProperty/Storage.swift similarity index 100% rename from Sources/PersistedProperty/Storage/Storage.swift rename to Sources/PersistedProperty/Storage.swift diff --git a/Sources/PersistedProperty/Storage/StorageService.swift b/Sources/PersistedProperty/StorageService.swift similarity index 100% rename from Sources/PersistedProperty/Storage/StorageService.swift rename to Sources/PersistedProperty/StorageService.swift