<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKVisionPrescription/init(type:dateIssued:expirationDate:device:metadata:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKVisionPrescription(cm)prescriptionWithType:dateIssued:expirationDate:device:metadata:"
  },
  "title" : "init(type:dateIssued:expirationDate:device:metadata:)"
}
-->

# init(type:dateIssued:expirationDate:device:metadata:)

Creates a new vision prescription sample.

```
convenience init(type: HKVisionPrescriptionType, dateIssued: Date, expirationDate: Date?, device: HKDevice?, metadata: [String : Any]?)
```

## Parameters

`type`

A value that indicates the type of prescription. For a list of possible values, see [`HKVisionPrescriptionType`](/documentation/HealthKit/HKVisionPrescriptionType).

`dateIssued`

The date when the doctor issued the prescription.

`expirationDate`

The date when the prescription expires.

`device`

The device that generated the sample.

`metadata`

Additional metadata about the sample.

## Discussion

Use this initializer to create an image-only prescription. Here, you attach the prescription as an image or PDF to a simple sample. The sample contains only basic information about the prescription, such as the issue and expiration dates. To see the prescription data, people must view the attached image or PDF.

To create a vision prescription sample that contains the full data for the prescription, use [`HKGlassesPrescription`](/documentation/HealthKit/HKGlassesPrescription) or [`HKContactsPrescription`](/documentation/HealthKit/HKContactsPrescription) instead.

## See Also

[`class HKGlassesPrescription`](/documentation/HealthKit/HKGlassesPrescription)

A sample that stores a prescription for glasses.

[`class HKContactsPrescription`](/documentation/HealthKit/HKContactsPrescription)

A sample that store a prescription for contacts.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)