KeychainKey.swift 543 Bytes
Newer Older
domenicw's avatar
domenicw committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//
//  KeychainKey.swift
//  Amiv
//
//  Created by Domenic Wüthrich on 23.09.18.
//  Copyright © 2018 Amiv an der ETH. All rights reserved.
//

import Foundation

public enum KeychainKey: String {
    
    case username
    case password
15
    case authToken
16
    case userID
17
18
19
20
21
22
23
24
25
26
27
28
    
}

extension KeychainKey {
    
    /// Gets associated value of key from keychain store
    public func getString() -> String? {
        let keychain = KeychainSwift()
        let string = keychain.get(self.rawValue)
        
        return string
    }
domenicw's avatar
domenicw committed
29
30
    
}