Skip to content

Commit

Permalink
Hotfix build error on watchOS
Browse files Browse the repository at this point in the history
  • Loading branch information
kishikawakatsumi committed Oct 12, 2015
1 parent a4a4d2f commit cddc4c0
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions Lib/KeychainAccess/Keychain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public struct AuthenticationPolicy : OptionSetType {
even if fingers are added or removed.
*/
@available(iOS 8.0, OSX 10.10, *)
@available(watchOS, unavailable)
public static let UserPresence = AuthenticationPolicy(rawValue: 1 << 0)

/**
Expand All @@ -148,7 +147,6 @@ public struct AuthenticationPolicy : OptionSetType {
*/
@available(iOS 9.0, *)
@available(OSX, unavailable)
@available(watchOS, unavailable)
public static let TouchIDAny = AuthenticationPolicy(rawValue: 1 << 1)

/**
Expand All @@ -158,14 +156,12 @@ public struct AuthenticationPolicy : OptionSetType {
*/
@available(iOS 9.0, *)
@available(OSX, unavailable)
@available(watchOS, unavailable)
public static let TouchIDCurrentSet = AuthenticationPolicy(rawValue: 1 << 3)

/**
Constraint: Device passcode
*/
@available(iOS 9.0, OSX 10.11, *)
@available(watchOS, unavailable)
public static let DevicePasscode = AuthenticationPolicy(rawValue: 1 << 4)

/**
Expand All @@ -174,7 +170,6 @@ public struct AuthenticationPolicy : OptionSetType {
*/
@available(iOS 9.0, *)
@available(OSX, unavailable)
@available(watchOS, unavailable)
public static let Or = AuthenticationPolicy(rawValue: 1 << 14)

/**
Expand All @@ -183,15 +178,13 @@ public struct AuthenticationPolicy : OptionSetType {
*/
@available(iOS 9.0, *)
@available(OSX, unavailable)
@available(watchOS, unavailable)
public static let And = AuthenticationPolicy(rawValue: 1 << 15)

/**
Create access control for private key operations (i.e. sign operation)
*/
@available(iOS 9.0, *)
@available(OSX, unavailable)
@available(watchOS, unavailable)
public static let PrivateKeyUsage = AuthenticationPolicy(rawValue: 1 << 30)

/**
Expand All @@ -200,7 +193,6 @@ public struct AuthenticationPolicy : OptionSetType {
*/
@available(iOS 9.0, *)
@available(OSX, unavailable)
@available(watchOS, unavailable)
public static let ApplicationPassword = AuthenticationPolicy(rawValue: 1 << 31)

public let rawValue : Int
Expand Down Expand Up @@ -246,7 +238,6 @@ private let ValueData = kSecValueData as String

/** Other Constants */
@available(iOS 8.0, OSX 10.10, *)
@available(watchOS, unavailable)
private let UseOperationPrompt = kSecUseOperationPrompt as String

#if os(iOS)
Expand All @@ -255,23 +246,18 @@ private let UseNoAuthenticationUI = kSecUseNoAuthenticationUI as String
#endif

@available(iOS 9.0, OSX 10.11, *)
@available(watchOS, unavailable)
private let UseAuthenticationUI = kSecUseAuthenticationUI as String

@available(iOS 9.0, OSX 10.11, *)
@available(watchOS, unavailable)
private let UseAuthenticationContext = kSecUseAuthenticationContext as String

@available(iOS 9.0, OSX 10.11, *)
@available(watchOS, unavailable)
private let UseAuthenticationUIAllow = kSecUseAuthenticationUIAllow as String

@available(iOS 9.0, OSX 10.11, *)
@available(watchOS, unavailable)
private let UseAuthenticationUIFail = kSecUseAuthenticationUIFail as String

@available(iOS 9.0, OSX 10.11, *)
@available(watchOS, unavailable)
private let UseAuthenticationUISkip = kSecUseAuthenticationUISkip as String

#if os(iOS)
Expand Down Expand Up @@ -309,7 +295,6 @@ public class Keychain {
}

@available(iOS 8.0, OSX 10.10, *)
@available(watchOS, unavailable)
public var authenticationPolicy: AuthenticationPolicy? {
return options.authenticationPolicy
}
Expand All @@ -327,7 +312,6 @@ public class Keychain {
}

@available(iOS 8.0, OSX 10.10, *)
@available(watchOS, unavailable)
public var authenticationPrompt: String? {
return options.authenticationPrompt
}
Expand Down Expand Up @@ -400,7 +384,6 @@ public class Keychain {
}

@available(iOS 8.0, OSX 10.10, *)
@available(watchOS, unavailable)
public func accessibility(accessibility: Accessibility, authenticationPolicy: AuthenticationPolicy) -> Keychain {
var options = self.options
options.accessibility = accessibility
Expand All @@ -427,7 +410,6 @@ public class Keychain {
}

@available(iOS 8.0, OSX 10.10, *)
@available(watchOS, unavailable)
public func authenticationPrompt(authenticationPrompt: String) -> Keychain {
var options = self.options
options.authenticationPrompt = authenticationPrompt
Expand Down Expand Up @@ -1011,13 +993,11 @@ extension Options {
query[AttributeAuthenticationType] = authenticationType.rawValue
}

#if !os(watchOS)
if #available(iOS 8.0, OSX 10.10, *) {
if authenticationPrompt != nil {
query[UseOperationPrompt] = authenticationPrompt
}
}
#endif

return query
}
Expand Down

0 comments on commit cddc4c0

Please sign in to comment.