From 9ac4c9377dc9306b326b1059dfbbb50cff558259 Mon Sep 17 00:00:00 2001 From: Yannik Ehlert Date: Wed, 14 Sep 2022 15:18:37 +0200 Subject: [PATCH] Fix Xcode 14 tvOS builds (#170) Fix tvOS builds --- SimpleKeychain/SimpleKeychain.swift | 4 ++-- SimpleKeychainTests/SimpleKeychainSpec.swift | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SimpleKeychain/SimpleKeychain.swift b/SimpleKeychain/SimpleKeychain.swift index 1847778..2e9e6ee 100644 --- a/SimpleKeychain/SimpleKeychain.swift +++ b/SimpleKeychain/SimpleKeychain.swift @@ -20,7 +20,7 @@ public struct SimpleKeychain { var retrieve: RetrieveFunction = SecItemCopyMatching var remove: RemoveFunction = SecItemDelete - #if canImport(LocalAuthentication) + #if canImport(LocalAuthentication) && !os(tvOS) let context: LAContext? /// Initializes a ``SimpleKeychain`` instance. @@ -272,7 +272,7 @@ extension SimpleKeychain { if let accessGroup = self.accessGroup { query[kSecAttrAccessGroup as String] = accessGroup } - #if canImport(LocalAuthentication) + #if canImport(LocalAuthentication) && !os(tvOS) if let context = self.context { query[kSecUseAuthenticationContext as String] = context } diff --git a/SimpleKeychainTests/SimpleKeychainSpec.swift b/SimpleKeychainTests/SimpleKeychainSpec.swift index d29c844..5191d86 100644 --- a/SimpleKeychainTests/SimpleKeychainSpec.swift +++ b/SimpleKeychainTests/SimpleKeychainSpec.swift @@ -44,7 +44,7 @@ class SimpleKeychainSpec: QuickSpec { expect(sut.attributes["foo"] as? String) == "bar" } - #if canImport(LocalAuthentication) + #if canImport(LocalAuthentication) && !os(tvOS) it("should init with custom local authentication context") { let context = LAContext() sut = SimpleKeychain(context: context) @@ -253,7 +253,7 @@ class SimpleKeychainSpec: QuickSpec { expect((query[kSecValueData as String] as? Data)).to(beNil()) expect((query[kSecAttrAccessGroup as String] as? String)).to(beNil()) expect((query[kSecAttrSynchronizable as String] as? Bool)).to(beNil()) - #if canImport(LocalAuthentication) + #if canImport(LocalAuthentication) && !os(tvOS) expect((query[kSecUseAuthenticationContext as String] as? LAContext)).to(beNil()) #endif } @@ -298,7 +298,7 @@ class SimpleKeychainSpec: QuickSpec { expect((query[kSecAttrSynchronizable as String] as? Bool)) == sut.isSynchronizable } - #if canImport(LocalAuthentication) + #if canImport(LocalAuthentication) && !os(tvOS) it("should include context attribute") { sut = SimpleKeychain(context: LAContext()) let query = sut.baseQuery()