-
Notifications
You must be signed in to change notification settings - Fork 4
[Feat] Add Universal Link #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
39b0b0e
[Feat] Add function for universal links
E-know 5496c0f
[Feat] URL Parsing
E-know dbbc9bd
[Feat] Add KeyChain for StampHistory
E-know c647808
Merge branch 'develop' into dev/universalLink
E-know e7a227f
[Feat] Keychain exception handling
E-know f0b5762
[Modify] Change variable to higher order function
E-know 4d93dd5
Update AsyncSwift/Observed/KeyChain.swift
E-know 6fe33bf
[Modify] KeyChain 값 AppData에 저장
E-know 69bf93f
Merge remote-tracking branch 'E-know/dev/universalLink' into dev/univ…
E-know 5b8340a
Merge pull request #2 from Async-Swift/develop
E-know 7125ad7
[Feat] seminar002 -> fetch Json File
E-know beb398b
[Fix] Change when Json files are called
E-know e9c0886
[Modify] Project Settings
E-know 4df1fba
[Modify] Stamp Model
E-know f478e6d
[Modify] Variable Description and Rename
E-know 170ea25
Update AsyncSwift/Observed/AppData.swift
E-know b3be393
[Modify] Change If -> switch
E-know cc3b0b7
[Modify] Rename Variable
E-know ac161f9
[Modify] Change Keychain return value
E-know 9495614
Merge remote-tracking branch 'E-know/dev/universalLink' into dev/univ…
E-know 2a0956f
Update AsyncSwift/Observed/KeyChain.swift
E-know 573dabf
Update AsyncSwift/Observed/KeyChain.swift
E-know ef2c321
[Modify] Weak reference guard handling
E-know 4f205c0
[Fix] Fix code error
E-know 23ecdb9
[Modify] Change to If statement return
E-know File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // | ||
| // Stamp.swift | ||
| // AsyncSwift | ||
| // | ||
| // Created by Inho Choi on 2022/09/15. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| struct Stamp: Decodable { | ||
| let title: String | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| // | ||
| // KeyChain.swift | ||
| // AsyncSwift | ||
| // | ||
| // Created by Inho Choi on 2022/09/15. | ||
| // | ||
|
|
||
| import Foundation | ||
| import UIKit | ||
|
|
||
| final class KeyChain { | ||
| static let shared = KeyChain() | ||
|
|
||
| private init() { } | ||
|
|
||
| func addItem(key: Any, pwd: Any) -> Bool { | ||
| let addQuery: [CFString: Any] = [kSecClass: kSecClassGenericPassword, | ||
| kSecAttrAccount: key, | ||
| kSecValueData: (pwd as AnyObject).data(using: String.Encoding.utf8.rawValue) as Any] | ||
|
|
||
| let status = SecItemAdd(addQuery as CFDictionary, nil) | ||
|
|
||
| switch status { | ||
| case errSecSuccess: | ||
| return true | ||
| case errSecDuplicateItem: | ||
| return updateItem(value: pwd, key: key) | ||
| default: | ||
| print("addItem Error : \(status.description))") | ||
| return false | ||
| } | ||
| } | ||
|
|
||
| func getItem(key: Any) -> Any? { | ||
| let getQuery: [CFString: Any] = [kSecClass: kSecClassGenericPassword, | ||
| kSecAttrAccount: key, | ||
| kSecReturnAttributes: true, | ||
| kSecReturnData: true] | ||
| var item: CFTypeRef? | ||
| let result = SecItemCopyMatching(getQuery as CFDictionary, &item) | ||
|
|
||
| if result == errSecSuccess, | ||
| let existingItem = item as? [String: Any], | ||
| let data = existingItem[kSecValueData as String] as? Data, | ||
| let password = String(data: data, encoding: .utf8) { | ||
| return password | ||
| } | ||
| print("getItem Error : \(result.description)") | ||
| return nil | ||
| } | ||
|
|
||
| func updateItem(value: Any, key: Any) -> Bool { | ||
| let prevQuery: [CFString: Any] = [kSecClass: kSecClassGenericPassword, | ||
| kSecAttrAccount: key] | ||
| let updateQuery: [CFString: Any] = [kSecValueData: (value as AnyObject).data(using: String.Encoding.utf8.rawValue) as Any] | ||
|
|
||
| let result: Bool = { | ||
| let status = SecItemUpdate(prevQuery as CFDictionary, updateQuery as CFDictionary) | ||
| return status == errSecSuccess | ||
| }() | ||
|
|
||
| return result | ||
| } | ||
|
|
||
| func deleteItem(key: String) -> Bool { | ||
| let deleteQuery: [CFString: Any] = [kSecClass: kSecClassGenericPassword, | ||
| kSecAttrAccount: key] | ||
| let status = SecItemDelete(deleteQuery as CFDictionary) | ||
| if status == errSecSuccess { | ||
| return true | ||
| } else { | ||
| print("deleteItem Error : \(status.description)") | ||
| return false | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.