Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to iOS 17 and new Spezi version #16

Merged
merged 3 commits into from
Nov 8, 2023
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
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ SpeziStorage contributors

* [Paul Schmiedmayer](https://github.com/PSchmiedmayer)
* [Vishnu Ravi](https://github.com/vishnuravi)
* [Andreas Bauer](https://github.com/Supereg)
Supereg marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.9

//
// This source file is part of the Stanford Spezi open-source project
Expand All @@ -14,14 +14,14 @@ import PackageDescription
let package = Package(
name: "SpeziStorage",
platforms: [
.iOS(.v16)
.iOS(.v17)
],
products: [
.library(name: "SpeziLocalStorage", targets: ["SpeziLocalStorage"]),
.library(name: "SpeziSecureStorage", targets: ["SpeziSecureStorage"])
],
dependencies: [
.package(url: "https://github.com/StanfordSpezi/Spezi", .upToNextMinor(from: "0.7.0")),
.package(url: "https://github.com/StanfordSpezi/Spezi", .upToNextMinor(from: "0.8.0")),
.package(url: "https://github.com/StanfordBDHG/XCTRuntimeAssertions", .upToNextMinor(from: "0.2.5"))
],
targets: [
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ You can then use the [`LocalStorage`](https://swiftpackageindex.com/stanfordspez

```swift
struct ExampleStorageView: View {
@EnvironmentObject var secureStorage: LocalStorage
@EnvironmentObject var secureStorage: SecureStorage
@Environment(LocalStorage.self) var secureStorage
@Environment(SecureStorage.self) var secureStorage


var body: some View {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SpeziLocalStorage/LocalStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import SpeziSecureStorage
/// Use ``LocalStorage/store(_:storageKey:settings:)`` to store elements on disk and define the settings using a ``LocalStorageSetting`` instance.
///
/// Use ``LocalStorage/read(_:storageKey:settings:)`` to read elements on disk which are decoded as define by passed in ``LocalStorageSetting`` instance.
public final class LocalStorage: Module, DefaultInitializable {
public final class LocalStorage: Module, DefaultInitializable, EnvironmentAccessible {
private let encryptionAlgorithm: SecKeyAlgorithm = .eciesEncryptionCofactorX963SHA256AESGCM
@Dependency private var secureStorage = SecureStorage()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You can then use the ``LocalStorage`` class in any SwiftUI view.

```swift
struct ExampleStorageView: View {
@EnvironmentObject var localStorage: LocalStorage
@Environment(LocalStorage.self) var localStorage


var body: some View {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SpeziSecureStorage/SecureStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import XCTRuntimeAssertions
/// The ``SecureStorage`` serves as a reusable `Module` that can be used to store small chunks of data such as credentials and keys.
///
/// The storing of credentials and keys follows the Keychain documentation provided by Apple: https://developer.apple.com/documentation/security/keychain_services/keychain_items/using_the_keychain_to_manage_user_secrets.
public final class SecureStorage: Module, DefaultInitializable {
public final class SecureStorage: Module, DefaultInitializable, EnvironmentAccessible {
/// The ``SecureStorage`` serves as a reusable `Module` that can be used to store store small chunks of data such as credentials and keys.
///
/// The storing of credentials and keys follows the Keychain documentation provided by Apple:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You can then use the ``SecureStorage`` class in any SwiftUI view.

```swift
struct ExampleStorageView: View {
@EnvironmentObject var secureStorage: SecureStorage
@Environment(SecureStorage.self) var secureStorage


var body: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import XCTestApp


struct LocalStorageTestsView: View {
@EnvironmentObject var localStorage: LocalStorage
@EnvironmentObject var secureStorage: SecureStorage
@Environment(LocalStorage.self) var localStorage
@Environment(SecureStorage.self) var secureStorage


var body: some View {
TestAppView(testCase: LocalStorageTests(localStorage: localStorage, secureStorage: secureStorage))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import XCTestApp


struct SecureStorageTestsView: View {
@EnvironmentObject var secureStorage: SecureStorage
@Environment(SecureStorage.self) var secureStorage


var body: some View {
Expand Down
6 changes: 3 additions & 3 deletions Tests/UITests/UITests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -404,7 +404,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -567,7 +567,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down