Skip to content

Commit

Permalink
Merge pull request #16 from infinum/fix/missing-swift-annotations
Browse files Browse the repository at this point in the history
Fix/missing swift annotations
  • Loading branch information
Jasmin Abou Aldan committed Nov 7, 2019
2 parents 8e0cd56 + 3a85f75 commit 14debbb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Example/TouchID/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ extension ViewController {

var shouldUseAuthWithBiometrics: Bool {
get { return Locker.shouldUseAuthenticationWithBiometrics(for: identifier) }
set (newValue) { Locker.setShouldUseAuthenticationWithBiometrics(newValue, forUniqueIdentifier: identifier) }
set (newValue) { Locker.setShouldUseAuthenticationWithBiometrics(newValue, for: identifier) }
}

var didAskToUseAuthWithBiometrics: Bool {
get { return Locker.didAskToUseAuthenticationWithBiometrics(for: identifier) }
set (newValue) { Locker.setDidAskToUseAuthenticationWithBiometrics(true, forUniqueIdentifier: identifier) }
set (newValue) { Locker.setDidAskToUseAuthenticationWithBiometrics(true, for: identifier) }
}

var shouldAddSecretToKeychainOnNextLogin: Bool {
get { return Locker.shouldAddSecretToKeychainOnNextLogin(for: identifier) }
set (newValue) { Locker.setShouldAddSecretToKeychainOnNextLogin(true, forUniqueIdentifier: identifier) }
set (newValue) { Locker.setShouldAddSecretToKeychainOnNextLogin(true, for: identifier) }
}
}

Expand Down
2 changes: 1 addition & 1 deletion Locker.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Locker"
s.version = "2.0.0"
s.version = "2.0.1"
s.summary = "Securely lock your secrets under the watch of TouchID or FaceID keeper 🔒"
s.description = <<-DESC
Lightweight manager for saving, fetching and updating secrets (string value) in Keychain using Biometric Authentication.
Expand Down
6 changes: 3 additions & 3 deletions Locker/Locker/Locker.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN
@param shouldUseAuthenticationWithBiometrics used to determine whether user enabled authentication with biometrics
@param uniqueIdentifier used for saving shouldUseAuthenticationWithBiometrics value
*/
+ (void)setShouldUseAuthenticationWithBiometrics:(BOOL)shouldUseAuthenticationWithBiometrics forUniqueIdentifier:(NSString *)uniqueIdentifier;
+ (void)setShouldUseAuthenticationWithBiometrics:(BOOL)shouldUseAuthenticationWithBiometrics forUniqueIdentifier:(NSString *)uniqueIdentifier NS_SWIFT_NAME(setShouldUseAuthenticationWithBiometrics(_:for:));

/**
Used for fetching whether user was asked to use authentication with biometrics.
Expand All @@ -92,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN
@param askToUseAuthenticationWithBiometrics used to determine whether user was asked to use authentication with biometrics
@param uniqueIdentifier used for saving askToUseAuthenticationWithBiometrics value
*/
+ (void)setDidAskToUseAuthenticationWithBiometrics:(BOOL)askToUseAuthenticationWithBiometrics forUniqueIdentifier:(NSString *)uniqueIdentifier;
+ (void)setDidAskToUseAuthenticationWithBiometrics:(BOOL)askToUseAuthenticationWithBiometrics forUniqueIdentifier:(NSString *)uniqueIdentifier NS_SWIFT_NAME(setDidAskToUseAuthenticationWithBiometrics(_:for:));

/**
Used for fetching whether secret should be stored to Keychain on next login.
Expand All @@ -108,7 +108,7 @@ NS_ASSUME_NONNULL_BEGIN
@param shouldAddSecretToKeychainOnNextLogin used to determine whether secret should be stored to Keychain on next login
@param uniqueIdentifier used for saving shouldAddPasscodeToKeychainOnNextLogin value
*/
+ (void)setShouldAddSecretToKeychainOnNextLogin:(BOOL)shouldAddSecretToKeychainOnNextLogin forUniqueIdentifier:(NSString *)uniqueIdentifier;
+ (void)setShouldAddSecretToKeychainOnNextLogin:(BOOL)shouldAddSecretToKeychainOnNextLogin forUniqueIdentifier:(NSString *)uniqueIdentifier NS_SWIFT_NAME(setShouldAddSecretToKeychainOnNextLogin(_:for:));


#pragma mark - Data reset
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ You'll get Your data in `success` completion block. If, for some reason, Your da

```objective-c
// Objective-C
[Locker retrieveCurrentSecretForUniqueIdentifier:@"kUniqueIdentifier" operationPrompt:@"Touch ID description" success:^(NSString *secret) {
[Locker retrieveCurrentSecretForUniqueIdentifier:@"kUniqueIdentifier"
operationPrompt:@"Touch ID description" success:^(NSString *secret) {
// do sth with secret
} failure:^(OSStatus failureStatus) {
// handle failure
Expand All @@ -71,11 +72,15 @@ You'll get Your data in `success` completion block. If, for some reason, Your da
```swift
// Swift
Locker.retrieveCurrentSecret(for: "kUniqueIdentifier", operationPrompt: "Touch ID description", success: { (secret) in
Locker.retrieveCurrentSecret(
for: "kUniqueIdentifier",
operationPrompt: "Touch ID description",
success: { (secret) in
// do sth with secret
}, failure: { (failureStatus) in
}, failure: { (failureStatus) in
// handle failure
})
}
)
```

##### 3. Delete data with `deleteSecretForUniqueIdentifier:` method.
Expand Down

0 comments on commit 14debbb

Please sign in to comment.