SKDataWrapper
@objc
public class SKDataWrapper : NSObject, NSSecureCoding
Undocumented
-
Undocumented
Declaration
Swift
public class var supportsSecureCoding: Bool { get }
-
Undocumented
Declaration
Swift
public let data: Data
-
Undocumented
Declaration
Swift
public init(data: Data)
-
Undocumented
Declaration
Swift
public required init?(coder aDecoder: NSCoder)
-
Creates a new data wrapper for an
Encodable
object.Throws
ASKXPCError
, if encoding fails.Declaration
Swift
public convenience init<T>(xpcObject: T) throws where T : Encodable
Parameters
object
The object to encode and store.
-
Creates a new data wrapper for an
Encodable
object.Throws
ASKError
, if encoding fails.Declaration
Swift
public convenience init<T>(object: T) throws where T : Encodable
Parameters
object
The object to encode and store.
-
A convenience initializer that tries to create a data wrapper from an object.
Throws
AnSKError
if encoding fails.Declaration
Swift
public convenience init(_ object: SourceKitRepresentable) throws
Parameters
object
The object to encode.
-
A convenience initializer that tries to create a data wrapper from an object.
If succesfully encodes the object, it is passed in to the
reply
closure. If it fails, it passes theSKXPCError
in to thereply
closure, and rethrows the error.Throws
AnSKXPCError
if encoding fails.Declaration
Swift
public convenience init(_ object: SourceKitRepresentable, reply: (SKDataWrapper?, SKXPCError?) -> Void) throws
Parameters
object
The object to encode.
reply
The XPC reply closure.
-
Undocumented
Declaration
Swift
public func encode(with aCoder: NSCoder)
-
Returns a value of the type you specify, decoded from this wrapper’s data.
Throws
ASKXPCError
, if decoding fails.Declaration
Swift
public func xpcDecodeData<T>() throws -> T where T : Decodable
Return Value
A value of the requested type.
-
Returns a value of the type you specify, decoded from this wrapper’s data.
Throws
ASKError
, if decoding fails.Declaration
Swift
public func decodeData<T>() throws -> T where T : Decodable
Return Value
A value of the requested type.