---
title: "init(calendar:frequency:interval:end:matchingPolicy:repeatedTimePolicy:months:daysOfTheYear:daysOfTheMonth:weeks:weekdays:hours:minutes:seconds:setPositions:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/calendar/recurrencerule/init(calendar:frequency:interval:end:matchingpolicy:repeatedtimepolicy:months:daysoftheyear:daysofthemonth:weeks:weekdays:hours:minutes:seconds:setpositions:)"
---

# init(calendar:frequency:interval:end:matchingPolicy:repeatedTimePolicy:months:daysOfTheYear:daysOfTheMonth:weeks:weekdays:hours:minutes:seconds:setPositions:)

## Declaration

```swift
init(calendar: Calendar, frequency: Calendar.RecurrenceRule.Frequency, interval: Int = 1, end: Calendar.RecurrenceRule.End = .never, matchingPolicy: Calendar.MatchingPolicy = .nextTimePreservingSmallerComponents, repeatedTimePolicy: Calendar.RepeatedTimePolicy = .first, months: [Calendar.RecurrenceRule.Month] = [], daysOfTheYear: [Int] = [], daysOfTheMonth: [Int] = [], weeks: [Int] = [], weekdays: [Calendar.RecurrenceRule.Weekday] = [], hours: [Int] = [], minutes: [Int] = [], seconds: [Int] = [], setPositions: [Int] = [])
```
