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

    A SKXPCError, 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

    A SKError, 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

    An SKError 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 the SKXPCError in to the reply closure, and rethrows the error.

    Throws

    An SKXPCError 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

    A SKXPCError, 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

    A SKError, if decoding fails.

    Declaration

    Swift

    public func decodeData<T>() throws -> T where T : Decodable

    Return Value

    A value of the requested type.