InstanceHolder
public class InstanceHolder<T> where T : Equatable
The InstanceHolder class provides a shared instance memory management.
-
Creates a new InstanceHolder.
Declaration
Swift
public init(factory: @escaping () -> T)
-
Retains an instance object if needed.
Declaration
Swift
public func retain() -> T?
-
Releases an instance object if needed.
Declaration
Swift
public func release(_ instance: T?)