Package
public final class Package
extension Package: NSCopying
extension Package: Equatable
extension Package: CustomStringConvertible, CustomDebugStringConvertible
This is a DTO to transfer data between controllers.
-
The action, useful to configure properly the destination controller.
Declaration
Swift
public private(set) var action: AnyHashable? { get }
-
Create a new Package with no data.
Declaration
Swift
public init(action: AnyHashable? = nil)
Parameters
action
the action to configure properly the destination controller.
-
Undocumented
Declaration
Swift
public subscript<T>(key: AnyHashable) -> T? { get set }
-
Undocumented
Declaration
Swift
public subscript<T>(key: AnyHashable, defaultValue: T) -> T { get }
-
Insert a data in this package, with an associated key.
Declaration
Swift
@discardableResult public func put<T>(key: AnyHashable, element: T?) -> Self
Parameters
key
the associated key to get the element on the other side.
element
the element to transfer.
Return Value
Self for chaining.
-
Get the element with an associated key.
Declaration
Swift
public func get<T>(key: AnyHashable) -> T?
Parameters
key
the associated key.
Return Value
the element.
-
Get the element with an associated key. If the element is not present in this package, this function returns the default value.
Declaration
Swift
public func get<T>(key: AnyHashable, defaultValue: T) -> T
Parameters
key
the associated key
defaultValue
the default value if the key is not present in this package.
Return Value
the element or the defaultValue if none.
-
Undocumented
Declaration
Swift
public func copy(with zone: NSZone? = nil) -> Any
-
Declaration
Swift
public static func == (lhs: Package, rhs: Package) -> Bool
-
Declaration
Swift
public var debugDescription: String { get }
-
Declaration
Swift
public var description: String { get }