 
 /**
 Latch is a simple abstraction around the iOS and OS X keychain API.
-Multiple Latch instances can use the same service, accessGroup, and 
+Multiple Latch instances can use the same service, accessGroup, and
 accessibility attributes.
 */
 public struct Latch {


    // MARK - Private

    private func baseQuery(forKey key: String) -> [String : AnyObject] {
        var query = [String : AnyObject]()
        if state.service.characters.count > 0 {
            query[kSecAttrService as String] = state.service
        }
        query[kSecClass as String] = kSecClassGenericPassword as String
        query[kSecAttrAccount as String] = key

        #if TARGET_OS_IOS && !TARGET_OS_SIMULATOR
        // Ignore the access group if running on the iPhone simulator.

    */
    public var rawValue: CFString {
        switch self {
        case .whenUnlocked:
            return kSecAttrAccessibleWhenUnlocked
        case .afterFirstUnlock:
            return kSecAttrAccessibleAfterFirstUnlock
        case .always:
            return kSecAttrAccessibleAlways
        case .whenUnlockedThisDeviceOnly:
            return kSecAttrAccessibleWhenUnlockedThisDeviceOnly
        case .afterFirstUnlockThisDeviceOnly:
            return kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
        case .alwaysThisDeviceOnly:
            return kSecAttrAccessibleAlwaysThisDeviceOnly
        }
    }
