One Logo Pool Ball
WeatherKit · IOS API REFERENCE

MoonPhase

enum · iOS 16.0+ · SDK 27.1

@frozen enum MoonPhase

An enumeration that specifies the moon phase kind. Waxing and waning provide information about direction. Crescent and gibbous describe shape.

Members (6)

get · iOS 16.0+

symbolName

TypeScript
getSymbolName($self: MoonPhase): string
Swift declaration
var symbolName: String { get }

The SF Symbol icon that represents the moon phase.

get · iOS 16.0+

description

TypeScript
getDescription($self: MoonPhase): string
Swift declaration
var description: String { get }

A localized string describing the moon phase.

get · iOS 16.0+

accessibilityDescription

TypeScript
getAccessibilityDescription($self: MoonPhase): string
Swift declaration
var accessibilityDescription: String { get }

A localized accessibility description describing the moon phase. This description is suitable for Voice Over and other assistive technologies.

get · iOS 16.0+

allCases

TypeScript
get allCases(): Array<MoonPhase>
Swift declaration
nonisolated static var allCases: [MoonPhase] { get }

A collection of all values of this type.

init · iOS 16.0+

init

TypeScript
init(rawValue: string): (MoonPhase) | null
Swift declaration
init?(rawValue: String)

Creates a new instance with the specified raw value. If there is no value of the type that corresponds with the specified raw value, this initializer returns `nil`. For example: enum PaperSize: String { case A4, A5, Letter, Legal } print(PaperSize(rawValue: "Legal")) // Prints "Optional(PaperSize.Legal)" print(PaperSize(rawValue: "Tabloid")) // Prints "nil" - Parameter rawValue: The raw value to use for the new instance.

get · iOS 16.0+

rawValue

TypeScript
getRawValue($self: MoonPhase): string
Swift declaration
var rawValue: String { get }

The corresponding value of the raw type. A new instance initialized with `rawValue` will be equivalent to this instance. For example: enum PaperSize: String { case A4, A5, Letter, Legal } let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter" print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"

Skipped declarations

No declarations were skipped in this snapshot.

All WeatherKit types →