---
title: "reference(to:allowedFields:maxFieldCount:thresholdField:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/formatstyle/reference(to:allowedfields:maxfieldcount:thresholdfield:)"
---

# reference(to:allowedFields:maxFieldCount:thresholdField:)

## Declaration

```swift
static func reference(to date: Date, allowedFields: Set<Date.RelativeFormatStyle.Field> = [.year, .month, .day, .hour, .minute], maxFieldCount: Int = 2, thresholdField: Date.RelativeFormatStyle.Field = .day) -> SystemFormatStyle.DateReference
```
