CPCViewTitleStyle
public struct CPCViewTitleStyle : Hashable, RawRepresentable, ExpressibleByStringLiteral
A value that holds information about formatting month titles.
-
Declaration
Swift
public typealias RawValue = String
-
Declaration
Swift
public typealias StringLiteralType = String
-
Month titles are not rendered.
Declaration
Swift
public static let none: (String) -> CPCViewTitleStyle
-
Short title format: one-digit month number and full year.
Declaration
Swift
public static var short: CPCViewTitleStyle { get }
-
Medium title format: two-digit zero-padded month number and full year.
Declaration
Swift
public static var medium: CPCViewTitleStyle { get }
-
Long title format: abbreviated month name and full year.
Declaration
Swift
public static var long: CPCViewTitleStyle { get }
-
Full title format: full month name and full year.
Declaration
Swift
public static var full: CPCViewTitleStyle { get }
-
Default month title format, which is used when no format was explicitly set.
Declaration
Swift
public static var `default`: CPCViewTitleStyle { get }
-
Create a new month title format using date format template for current locale.
Declaration
Swift
public static func customTemplate(_ template: String) -> CPCViewTitleStyle!
Parameters
template
Date format template compatible with DateFormatter.
Return Value
Month title format that matches supplied parameters or
nil
if format template is invalid. -
Create a new month title format using date format template.
Declaration
Swift
public static func customTemplate(_ template: String, locale: Locale) -> CPCViewTitleStyle!
Parameters
template
Date format template compatible with DateFormatter.
locale
Locale to evaluate format template.
Return Value
Month title format that matches supplied parameters or
nil
if format template is invalid. -
Create a new month title format using exact date format.
Declaration
Swift
public static func custom(_ format: String) -> CPCViewTitleStyle
Parameters
format
Date format to use for month title.
Return Value
Month title format that uses exact date
format
. -
Declaration
Swift
public let rawValue: String
-
Declaration
Swift
public init(rawValue: String)
-
Creates a new month title format from a string literal.
Firstly, given
stringLiteral
is evaluated as a date format template with current locale. If this evaluation fails,stringLiteral
is used as an exact date format.Declaration
Swift
public init(stringLiteral: String)
Parameters
stringLiteral
Requested date template format or an exact date format.
-
Create a new month title format using date format template for current locale.
Declaration
Swift
public init?(templateValue template: String)
Parameters
template
Date format template compatible with DateFormatter.
-
Create a new month title format using date format template.
Declaration
Swift
public init?(templateValue template: String, locale: Locale)
Parameters
template
Date format template compatible with DateFormatter.
locale
Locale to evaluate format template.