SetupResult
public enum SetupResult<T> : Hashable where T : StorageInterface
The SetupResult indicates the result of an asynchronous initialization of a persistent store.
The SetupResult can be treated as a boolean:
try! CoreStore.addStorage(
SQLiteStore(),
completion: { (result: SetupResult) -> Void in
if result {
// succeeded
}
else {
// failed
}
}
)
or as an enum, where the resulting associated object can also be inspected:
try! CoreStore.addStorage(
SQLiteStore(),
completion: { (result: SetupResult) -> Void in
switch result {
case .success(let storage):
// storage is the related StorageInterface instance
case .failure(let error):
// error is the CoreStoreError enum value for the failure
}
}
)
-
SetupResult.successindicates that the storage setup succeeded. The associated object for thisenumvalue is the relatedStorageInterfaceinstance.Declaration
Swift
case success(T) -
SetupResult.failureindicates that the storage setup failed. The associated object for this value is the relatedCoreStoreErrorenum value.Declaration
Swift
case failure(CoreStoreError) -
Returns
trueif the result indicates.success,falseif the result is.failure.Declaration
Swift
public var isSuccess: Bool { get }
-
Declaration
Swift
public static func == <T, U>(lhs: SetupResult<T>, rhs: SetupResult<U>) -> Bool where T : StorageInterface, U : StorageInterface
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public var debugDescription: String { get }
View on GitHub
SetupResult Enumeration Reference