Skip to content

Commit

Permalink
Added privacy manifest file
Browse files Browse the repository at this point in the history
  • Loading branch information
danielepantaleone committed Feb 7, 2024
1 parent 94ba01e commit 4386d4c
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 28 deletions.
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ let package = Package(
targets: [
.target(
name: "PersistedProperty",
dependencies: []),
dependencies: [],
resources: [.copy("PrivacyInfo.xcprivacy")]),
.testTarget(
name: "PersistedPropertyTests",
dependencies: ["PersistedProperty"])
Expand Down
24 changes: 14 additions & 10 deletions PersistedProperty.podspec
Original file line number Diff line number Diff line change
@@ -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" => "[email protected]" }
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" => "[email protected]" }
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
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<ValueType>(key: String) -> ValueType? where ValueType: Codable {
// your code goes here
}
func load<ValueType>(key: String) -> ValueType? where ValueType: Codable ...

func save<ValueType>(_ value: ValueType, key: String) where ValueType: Codable {
// your code goes here
}
func save<ValueType>(_ value: ValueType, key: String) where ValueType: Codable ...

func remove(key: String) {
// your code goes here
}
func remove(key: String) ...

}

Expand All @@ -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
Expand All @@ -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"))
]
```

Expand Down
6 changes: 3 additions & 3 deletions Sources/PersistedProperty/Persisted.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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:
///
Expand All @@ -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:
///
Expand Down
25 changes: 25 additions & 0 deletions Sources/PersistedProperty/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
</array>
</dict>
</plist>


Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
File renamed without changes.

0 comments on commit 4386d4c

Please sign in to comment.