 
     private static let sessionKey = "sessionKey"
 
-    private static let keychain = UICKeyChainStore(server: URL(string: "https://soundcloud.com")!,
-        protocolType: .HTTPS)
+    private static let keychain = Keychain(server: "https://soundcloud.com", protocolType: .https)
+
 
     /// The session property is only set when a user has logged in.
     public fileprivate(set) static var session: Session? = {
-        if let data = keychain.data(forKey: sessionKey), let session = NSKeyedUnarchiver.unarchiveObject(with: data) as? Session {
+        if let data = keychain[data: sessionKey],
+            let session = NSKeyedUnarchiver.unarchiveObject(with: data) as? Session {
             return session
         }
         return nil

        didSet {
            if let session = session {
                let data = NSKeyedArchiver.archivedData(withRootObject: session)
                keychain.setData(data, forKey: sessionKey)
            } else {
                keychain.removeItem(forKey: sessionKey)
            }
        }
    }


import Foundation
#if os(iOS) || os(OSX)
    import KeychainAccess
#endif

// MARK: - Errors
