NSCalendar
class NSCalendar
class NSCalendar
import Foundation
class NSObject
The root class of most Foundation class hierarchies.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol NSCoding
The NSCoding
protocol declares the two methods that a class must implement so that instances of that class can be encoded and decoded. This capability provides the basis for archiving (where objects and other structures are stored on disk) and distribution (where objects are copied to different address spaces).
protocol NSCopying
The NSCopying
protocol declares a method for providing functional copies of an object. The exact meaning of “copy” can vary from class to class, but a copy must be a functionally independent object with values identical to the original at the time the copy was made.
protocol NSObjectProtocol : AnyObject
The NSObjectProtocol
groups methods that are fundamental to all Foundation objects.
protocol NSSecureCoding : NSCoding
Conforming to the NSSecureCoding
protocol indicates that an object handles encoding and decoding instances of itself in a manner that is robust against object substitution attacks.
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 Options
struct Unit