Skip to content

Commit

Permalink
Fix Xcode 14 tvOS builds (#170)
Browse files Browse the repository at this point in the history
Fix tvOS builds
  • Loading branch information
yanniks committed Sep 14, 2022
1 parent 72acffd commit 9ac4c93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions SimpleKeychain/SimpleKeychain.swift
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions SimpleKeychainTests/SimpleKeychainSpec.swift
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 9ac4c93

Please sign in to comment.