getAttachments
TypeScriptgetAttachments(object: HKObject, completion: ((arg0: (Array<HKAttachment>) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc attachments(for object: HKObject) async throws -> [HKAttachment]class · iOS 16.0+ · SDK 27.1
class HKAttachmentStoregetAttachments(object: HKObject, completion: ((arg0: (Array<HKAttachment>) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc attachments(for object: HKObject) async throws -> [HKAttachment]getData(attachment: HKAttachment, completion: ((arg0: (ArrayBuffer) | null, arg1: (NativeError) | null) => void)): _Foundation_ProgressSwift declarationfunc getData(for attachment: HKAttachment, completion: @escaping (Data?, (any Error)?) -> Void) -> Progressstatic init(healthStore: HKHealthStore): HKAttachmentStoreSwift declarationinit(healthStore: HKHealthStore)removeAttachment(attachment: HKAttachment, object: HKObject, completion: ((arg0: boolean, arg1: (NativeError) | null) => void)): voidSwift declarationfunc removeAttachment(_ attachment: HKAttachment, from object: HKObject) async throwsstreamData(attachment: HKAttachment, dataHandler: ((arg0: (ArrayBuffer) | null, arg1: (NativeError) | null, arg2: boolean) => void)): _Foundation_ProgressSwift declarationfunc streamData(for attachment: HKAttachment, dataHandler: @escaping (Data?, (any Error)?, Bool) -> Void) -> ProgressdataReader(attachment: HKAttachment): HKAttachmentDataReaderSwift declarationfunc dataReader(for attachment: HKAttachment) -> HKAttachmentDataReaderAn HKAttachmentDataReader object for reading the given attachment's data.
addAttachmentToNameContentTypeUrlMetadataCompletion(object: HKObject, name: string, contentType: _UniformTypeIdentifiers_UTType, url: string, metadata: Record<string, unknown>, completion: ((arg0: (HKAttachment) | null, arg1: (NativeError) | null) => void)): voidSwift declaration@preconcurrency func addAttachment(to object: HKObject, name: String, contentType: UTType, url: URL, metadata: [String : Any] = [:], completion: @escaping @Sendable (HKAttachment?, (any Error)?) -> Void)Creates a new `HKAttachment` using the passed in `URL` and attaches it to the specified `HKObject`. - Parameters - object: The object for which to add the `HKAttachment`. - name: The name of the attachment. - contentType: The Uniform Type of the file. - URL: The `URL` to use to create the attachment. - metadata: Extra information describing the attachment. - completion: Called with an HKAttachment instance once the file was successfully saved and attached, otherwise called with an error.
addAttachmentToNameContentTypeUrlMetadata(object: HKObject, name: string, contentType: _UniformTypeIdentifiers_UTType, url: string, metadata?: Record<string, unknown>): Promise<HKAttachment>Swift declarationfunc addAttachment(to object: HKObject, name: String, contentType: UTType, url: URL, metadata: [String : Any] = [:]) async throws -> HKAttachmentCreates a new `HKAttachment` using the passed in `URL` and attaches it to the specified `HKObject`. - Parameters - object: The object for which to add the `HKAttachment`. - name: The name of the attachment. - contentType: The Uniform Type of the file. - URL: The `URL` to use to create the attachment. - metadata: Extra information describing the attachment. - Throws: `Error` if the attachment could not be saved. - Returns: An `HKAttachment` instance if the file was successfully saved and attached.
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
HKAttachmentStore.init()
inherited init: cannot prove legal (class declares 1 custom initializer)