Options
struct Options
struct Options
import Foundation
class NSCalendar
init?(calendarIdentifier ident: NSCalendar.Identifier)
required convenience init?(coder aDecoder: NSCoder)
init?(identifier calendarIdentifierConstant: NSCalendar.Identifier)
static var supportsSecureCoding: Bool { get }
class var autoupdatingCurrent: Calendar { get }
class var current: Calendar { get }
var amSymbol: String { get }
var calendarIdentifier: NSCalendar.Identifier { get }
override var description: String { get }
var eraSymbols: [String] { get }
var firstWeekday: Int { get set }
override var hash: Int { get }
var locale: Locale? { get set }
var longEraSymbols: [String] { get }
var minimumDaysInFirstWeek: Int { get set }
var monthSymbols: [String] { get }
var pmSymbol: String { get }
var quarterSymbols: [String] { get }
var shortMonthSymbols: [String] { get }
var shortQuarterSymbols: [String] { get }
var shortStandaloneMonthSymbols: [String] { get }
var shortStandaloneQuarterSymbols: [String] { get }
var shortStandaloneWeekdaySymbols: [String] { get }
var shortWeekdaySymbols: [String] { get }
var standaloneMonthSymbols: [String] { get }
var standaloneQuarterSymbols: [String] { get }
var standaloneWeekdaySymbols: [String] { get }
var timeZone: TimeZone { get set }
var veryShortMonthSymbols: [String] { get }
var veryShortStandaloneMonthSymbols: [String] { get }
var veryShortStandaloneWeekdaySymbols: [String] { get }
var veryShortWeekdaySymbols: [String] { get }
var weekdaySymbols: [String] { get }
func compare(_ date1: Date, to date2: Date, toUnitGranularity unit: NSCalendar.Unit) -> ComparisonResult
func component(_ unit: NSCalendar.Unit, from date: Date) -> Int
func components(_ unitFlags: NSCalendar.Unit, from date: Date) -> DateComponents
func components(_ unitFlags: NSCalendar.Unit, from startingDateComp: DateComponents, to resultDateComp: DateComponents, options: NSCalendar.Options = []) -> DateComponents
func components(_ unitFlags: NSCalendar.Unit, from startingDate: Date, to resultDate: Date, options opts: NSCalendar.Options = []) -> DateComponents
func components(in timezone: TimeZone, from date: Date) -> DateComponents
override func copy() -> Any
func copy(with zone: NSZone? = nil) -> Any
func date(_ date: Date, matchesComponents components: DateComponents) -> Bool
func date(byAdding comps: DateComponents, to date: Date, options opts: NSCalendar.Options = []) -> Date?
func date(byAdding unit: NSCalendar.Unit, value: Int, to date: Date, options: NSCalendar.Options = []) -> Date?
func date(bySettingHour h: Int, minute m: Int, second s: Int, of date: Date, options opts: NSCalendar.Options = []) -> Date?
func date(bySettingUnit unit: NSCalendar.Unit, value v: Int, of date: Date, options opts: NSCalendar.Options = []) -> Date?
func date(era eraValue: Int, year yearValue: Int, month monthValue: Int, day dayValue: Int, hour hourValue: Int, minute minuteValue: Int, second secondValue: Int, nanosecond nanosecondValue: Int) -> Date?
func date(era eraValue: Int, yearForWeekOfYear yearValue: Int, weekOfYear weekValue: Int, weekday weekdayValue: Int, hour hourValue: Int, minute minuteValue: Int, second secondValue: Int, nanosecond nanosecondValue: Int) -> Date?
func date(from comps: DateComponents) -> Date?
func encode(with aCoder: NSCoder)
func enumerateDates(startingAfter start: Date, matching comps: DateComponents, options opts: NSCalendar.Options = [], using block: (Date?, Bool, UnsafeMutablePointer<ObjCBool>) -> Void)
func getEra(_ eraValuePointer: UnsafeMutablePointer<Int>?, year yearValuePointer: UnsafeMutablePointer<Int>?, month monthValuePointer: UnsafeMutablePointer<Int>?, day dayValuePointer: UnsafeMutablePointer<Int>?, from date: Date)
func getEra(_ eraValuePointer: UnsafeMutablePointer<Int>?, yearForWeekOfYear yearValuePointer: UnsafeMutablePointer<Int>?, weekOfYear weekValuePointer: UnsafeMutablePointer<Int>?, weekday weekdayValuePointer: UnsafeMutablePointer<Int>?, from date: Date)
func getHour(_ hourValuePointer: UnsafeMutablePointer<Int>?, minute minuteValuePointer: UnsafeMutablePointer<Int>?, second secondValuePointer: UnsafeMutablePointer<Int>?, nanosecond nanosecondValuePointer: UnsafeMutablePointer<Int>?, from date: Date)
func isDate(_ date1: Date, equalTo date2: Date, toUnitGranularity unit: NSCalendar.Unit) -> Bool
func isDate(_ date1: Date, inSameDayAs date2: Date) -> Bool
func isDateInToday(_ date: Date) -> Bool
func isDateInTomorrow(_ date: Date) -> Bool
func isDateInWeekend(_ date: Date) -> Bool
func isDateInYesterday(_ date: Date) -> Bool
override func isEqual(_ value: Any?) -> Bool
func maximumRange(of unit: NSCalendar.Unit) -> NSRange
func minimumRange(of unit: NSCalendar.Unit) -> NSRange
func nextDate(after date: Date, matching comps: DateComponents, options: NSCalendar.Options = []) -> Date?
func nextDate(after date: Date, matching unit: NSCalendar.Unit, value: Int, options: NSCalendar.Options = []) -> Date?
func nextDate(after date: Date, matchingHour hourValue: Int, minute minuteValue: Int, second secondValue: Int, options: NSCalendar.Options = []) -> Date?
func nextWeekendAfter(_ date: Date, options: NSCalendar.Options) -> DateInterval?
Revised API for avoiding usage of AutoreleasingUnsafeMutablePointer. The current exposed API in Foundation on Darwin platforms is: open func nextWeekendStartDate(_ datep: AutoreleasingUnsafeMutablePointer<NSDate?>, interval tip: UnsafeMutablePointer
func ordinality(of smaller: NSCalendar.Unit, in larger: NSCalendar.Unit, for date: Date) -> Int
func range(of unit: NSCalendar.Unit, for date: Date) -> DateInterval?
Revised API for avoiding usage of AutoreleasingUnsafeMutablePointer. The current exposed API in Foundation on Darwin platforms is: open func rangeOfUnit(_ unit: Unit, startDate datep: AutoreleasingUnsafeMutablePointer<NSDate?>, interval tip: UnsafeMutablePointer
func range(of smaller: NSCalendar.Unit, in larger: NSCalendar.Unit, for date: Date) -> NSRange
func range(ofWeekendContaining date: Date) -> DateInterval?
Revised API for avoiding usage of AutoreleasingUnsafeMutablePointer. The current exposed API in Foundation on Darwin platforms is: open func rangeOfWeekendStartDate(_ datep: AutoreleasingUnsafeMutablePointer<NSDate?>, interval tip: UnsafeMutablePointer
func startOfDay(for date: Date) -> Date
struct Identifier
struct Unit
protocol Equatable
A type that can be compared for value equality.
protocol ExpressibleByArrayLiteral
A type that can be initialized using an array literal.
protocol OptionSet : RawRepresentable, SetAlgebra
A type that presents a mathematical set interface to a bit set.
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol Sendable
protocol SetAlgebra<Element> : Equatable, ExpressibleByArrayLiteral
A type that provides mathematical set operations.
init(rawValue: UInt)
static let matchFirst: NSCalendar.Options
static let matchLast: NSCalendar.Options
static let matchNextTime: NSCalendar.Options
static let matchNextTimePreservingSmallerUnits: NSCalendar.Options
static let matchPreviousTimePreservingSmallerUnits: NSCalendar.Options
static let matchStrictly: NSCalendar.Options
static let searchBackwards: NSCalendar.Options
static let wrapComponents: NSCalendar.Options
let rawValue: UInt
init()
Creates an empty option set.
init<S>(_ sequence: S) where S : Sequence, Self.Element == S.Element
Creates a new set from a finite sequence of items.
init(arrayLiteral: Self.Element...)
Creates a set containing the elements of the given array literal.
var isEmpty: Bool { get }
A Boolean value that indicates whether the set has no elements.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
func contains(_ member: Self) -> Bool
Returns a Boolean value that indicates whether a given element is a member of the option set.
mutating func formIntersection(_ other: Self)
Removes all elements of this option set that are not also present in the given set.
mutating func formSymmetricDifference(_ other: Self)
Replaces this set with a new set containing all elements contained in either this set or the given set, but not in both.
mutating func formUnion(_ other: Self)
Inserts the elements of another set into this option set.
@discardableResult mutating func insert(_ newMember: Self.Element) -> (inserted: Bool, memberAfterInsert: Self.Element)
Adds the given element to the option set if it is not already a member.
func intersection(_ other: Self) -> Self
Returns a new option set with only the elements contained in both this set and the given set.
func isDisjoint(with other: Self) -> Bool
Returns a Boolean value that indicates whether the set has no members in common with the given set.
func isStrictSubset(of other: Self) -> Bool
Returns a Boolean value that indicates whether this set is a strict subset of the given set.
func isStrictSuperset(of other: Self) -> Bool
Returns a Boolean value that indicates whether this set is a strict superset of the given set.
func isSubset(of other: Self) -> Bool
Returns a Boolean value that indicates whether the set is a subset of another set.
func isSuperset(of other: Self) -> Bool
Returns a Boolean value that indicates whether the set is a superset of the given set.
@discardableResult mutating func remove(_ member: Self.Element) -> Self.Element?
Removes the given element and all elements subsumed by it.
mutating func subtract(_ other: Self)
Removes the elements of the given set from this set.
func subtracting(_ other: Self) -> Self
Returns a new set containing the elements of this set that do not occur in the given set.
func symmetricDifference(_ other: Self) -> Self
Returns a new option set with the elements contained in this set or in the given set, but not in both.
func union(_ other: Self) -> Self
Returns a new option set of the elements contained in this set, in the given set, or in both.
@discardableResult mutating func update(with newMember: Self.Element) -> Self.Element?
Inserts the given element into the set.