diff --git a/DataStoreManager.podspec b/DataStoreManager.podspec index 7e10bdc..c47a4ce 100644 --- a/DataStoreManager.podspec +++ b/DataStoreManager.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "DataStoreManager" - s.version = "0.4.0" + s.version = "0.5.0" s.summary = "This library allows you to easily manage persistent data in your iOS app." # This description is used to generate tags and improve search results. diff --git a/README.md b/README.md index e622767..06806dc 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,9 @@ class ViewController: UIViewController, DataStoreManagerDataSource { } } - manager.read(forKey: "Key", forType: .keychain) { (object) in + manager.read(forKey: "Key", forType: .keychainServices) { (object) in if let object = object { - print("successfully read \(object) from SecItem") + print("successfully read \(object) from Keychain Services") } } @@ -62,7 +62,7 @@ class ViewController: UIViewController, DataStoreManagerDataSource { } } - manager.create(value: object, forKey: "Key", forType: .keychain) { (isSuccessful) in + manager.create(value: object, forKey: "Key", forType: .keychainServices) { (isSuccessful) in if isSuccessful { print("successfully write to SecItem") } @@ -81,7 +81,7 @@ class ViewController: UIViewController, DataStoreManagerDataSource { if manager.tag == 3 { return .userDefaults } else { - return .keychain + return .keychainServices } } } @@ -137,7 +137,7 @@ To install it, simply add the following line to your **Package.swift**: ```swift dependencies: [ - .package(url: "https://github.com/zaidmsaid/DataStoreManager.git", .upToNextMinor(from: "0.4.0")) + .package(url: "https://github.com/zaidmsaid/DataStoreManager.git", .upToNextMinor(from: "0.5.0")) ] ``` @@ -145,7 +145,7 @@ or more strict: ```swift dependencies: [ - .package(url: "https://github.com/zaidmsaid/DataStoreManager.git", .exact("0.4.0")) + .package(url: "https://github.com/zaidmsaid/DataStoreManager.git", .exact("0.5.0")) ] ``` diff --git a/Sources/DataStoreManager/DataStoreManager.swift b/Sources/DataStoreManager/DataStoreManager.swift index 9b25522..06a7b66 100644 --- a/Sources/DataStoreManager/DataStoreManager.swift +++ b/Sources/DataStoreManager/DataStoreManager.swift @@ -95,34 +95,41 @@ import Foundation /// Constants that provide information regarding storage type of data store manager. @objc public enum StorageType : Int, CaseIterable { - /// The storage type UserDefaults. + /// The storage type [UserDefaults](apple-reference-documentation://hsARFaqWd3). case userDefaults - /// The storage type FileManager with the search path document directory. + /// The storage type [FileManager](apple-reference-documentation://hsQQiy1kjA) + /// with the search path document directory. case documentDirectory - /// The storage type FileManager with the search path user home directories (/Users). + /// The storage type [FileManager](apple-reference-documentation://hsQQiy1kjA) + /// with the search path user home directories (`/Users`). case userDirectory - /// The storage type FileManager with the search path various user-visible documentation, support, and configuration files (/Library). + /// The storage type [FileManager](apple-reference-documentation://hsQQiy1kjA) + /// with the search path various user-visible documentation, support, and + /// configuration files (`/Library`). case libraryDirectory - /// The storage type FileManager with the search path supported applications (/Applications). + /// The storage type [FileManager](apple-reference-documentation://hsQQiy1kjA) + /// with the search path supported applications (`/Applications`). case applicationDirectory - /// The storage type FileManager with the search path core services (System/Library/CoreServices). + /// The storage type [FileManager](apple-reference-documentation://hsQQiy1kjA) + /// with the search path core services (`System/Library/CoreServices`). case coreServiceDirectory - /// The storage type FileManager with the temporary directory for the current user. + /// The storage type [FileManager](apple-reference-documentation://hsQQiy1kjA) + /// with the temporary directory for the current user. case temporaryDirectory - /// The storage type NSCache. + /// The storage type [NSCache](apple-reference-documentation://hs3dlYnTwl). case cache - /// The storage type SecItem. - case keychain + /// The storage type [SecItem](https://developer.apple.com/documentation/security/keychain_services). + case keychainServices - /// The storage type NSUbiquitousKeyValueStore. + /// The storage type [NSUbiquitousKeyValueStore](apple-reference-documentation://hskNNwzU6H). case ubiquitous /// Converts the storage type value to a native string. @@ -154,7 +161,7 @@ import Foundation case .cache: return "NSCache" - case .keychain: + case .keychainServices: return "SecItem" case .ubiquitous: @@ -237,7 +244,7 @@ import Foundation case .cache: cacheWorker.create(value: value, forKey: key, completionHandler: completionHandler) - case .keychain: + case .keychainServices: securityItemWorker.create(value: value, forKey: key, completionHandler: completionHandler) case .ubiquitous: @@ -294,7 +301,7 @@ import Foundation case .cache: cacheWorker.read(forKey: key, completionHandler: completionHandler) - case .keychain: + case .keychainServices: securityItemWorker.read(forKey: key, completionHandler: completionHandler) case .ubiquitous: @@ -353,7 +360,7 @@ import Foundation case .cache: cacheWorker.update(value: value, forKey: key, completionHandler: completionHandler) - case .keychain: + case .keychainServices: securityItemWorker.update(value: value, forKey: key, completionHandler: completionHandler) case .ubiquitous: @@ -410,7 +417,7 @@ import Foundation case .cache: cacheWorker.delete(forKey: key, completionHandler: completionHandler) - case .keychain: + case .keychainServices: securityItemWorker.delete(forKey: key, completionHandler: completionHandler) case .ubiquitous: @@ -465,7 +472,7 @@ import Foundation case .cache: cacheWorker.deleteAll(completionHandler: completionHandler) - case .keychain: + case .keychainServices: securityItemWorker.deleteAll(completionHandler: completionHandler) case .ubiquitous: