Skip to content

Commit 9ac4c93

Browse files
authored
Fix Xcode 14 tvOS builds (#170)
Fix tvOS builds
1 parent 72acffd commit 9ac4c93

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

SimpleKeychain/SimpleKeychain.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public struct SimpleKeychain {
2020
var retrieve: RetrieveFunction = SecItemCopyMatching
2121
var remove: RemoveFunction = SecItemDelete
2222

23-
#if canImport(LocalAuthentication)
23+
#if canImport(LocalAuthentication) && !os(tvOS)
2424
let context: LAContext?
2525

2626
/// Initializes a ``SimpleKeychain`` instance.
@@ -272,7 +272,7 @@ extension SimpleKeychain {
272272
if let accessGroup = self.accessGroup {
273273
query[kSecAttrAccessGroup as String] = accessGroup
274274
}
275-
#if canImport(LocalAuthentication)
275+
#if canImport(LocalAuthentication) && !os(tvOS)
276276
if let context = self.context {
277277
query[kSecUseAuthenticationContext as String] = context
278278
}

SimpleKeychainTests/SimpleKeychainSpec.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class SimpleKeychainSpec: QuickSpec {
4444
expect(sut.attributes["foo"] as? String) == "bar"
4545
}
4646

47-
#if canImport(LocalAuthentication)
47+
#if canImport(LocalAuthentication) && !os(tvOS)
4848
it("should init with custom local authentication context") {
4949
let context = LAContext()
5050
sut = SimpleKeychain(context: context)
@@ -253,7 +253,7 @@ class SimpleKeychainSpec: QuickSpec {
253253
expect((query[kSecValueData as String] as? Data)).to(beNil())
254254
expect((query[kSecAttrAccessGroup as String] as? String)).to(beNil())
255255
expect((query[kSecAttrSynchronizable as String] as? Bool)).to(beNil())
256-
#if canImport(LocalAuthentication)
256+
#if canImport(LocalAuthentication) && !os(tvOS)
257257
expect((query[kSecUseAuthenticationContext as String] as? LAContext)).to(beNil())
258258
#endif
259259
}
@@ -298,7 +298,7 @@ class SimpleKeychainSpec: QuickSpec {
298298
expect((query[kSecAttrSynchronizable as String] as? Bool)) == sut.isSynchronizable
299299
}
300300

301-
#if canImport(LocalAuthentication)
301+
#if canImport(LocalAuthentication) && !os(tvOS)
302302
it("should include context attribute") {
303303
sut = SimpleKeychain(context: LAContext())
304304
let query = sut.baseQuery()

0 commit comments

Comments
 (0)