RSDDateCoder
public protocol RSDDateCoder : Codable
RSDDateCoder is used to handle specifying date encoding/decoding. If the calendar components supported by
this formatter only include a subset of all the components then only those components should be displayed
in the UI.
-
The formatter to use for encoding and decoding the result.
Seealso
RSDAnswerResultTypeDeclaration
Swift
var resultFormatter: DateFormatter -
Formatter to use for decoding dates used to set up a date range.
Seealso
RSDDateRangeObjectDeclaration
Swift
var inputFormatter: DateFormatter -
Calendar components that are included for this date range.
Declaration
Swift
var calendarComponents: Set<Calendar.Component> -
The calendar used by this date range when formatting a
DateComponentsobject.Declaration
Swift
var calendar: Calendar
-
string(from:isResultCoding:)Extension methodUse the coder to encode a date as a string.
Declaration
Swift
public func string(from date: Date, isResultCoding: Bool = false) -> String?Parameters
dateThe date to encode.
isResultCodingShould this value be encoded using the result formatter?
-
string(from:isResultCoding:)Extension methodUse the coder to encode date components as a string.
Declaration
Swift
public func string(from dateComponents: DateComponents, isResultCoding: Bool = false) -> String?Parameters
dateComponentsThe date components to encode.
isResultCodingShould this value be encoded using the result formatter?
-
date(from:isResultCoding:)Extension methodUse the coder to decode a date from a string.
Declaration
Swift
public func date(from string: String, isResultCoding: Bool = false) -> Date?Parameters
stringThe string to decode.
isResultCodingShould this value be encoded using the result formatter?
-
dateComponents(from:isResultCoding:)Extension methodUse the coder to decode date components from a string.
Declaration
Swift
public func dateComponents(from string: String, isResultCoding: Bool = false) -> DateComponents?Parameters
stringThe string to decode.
isResultCodingShould this value be encoded using the result formatter?
View on GitHub
RSDDateCoder Protocol Reference