GooglePlacesSwift Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
-
The raw type that can be used to represent all values of the conforming
type.
Every distinct value of the conforming type has a corresponding unique
value of the RawValue
type, but there may be values of the RawValue
type that don’t have a corresponding value of the conforming type.
Declaration
Swift
typealias RawValue = UInt
-
-
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"
Declaration
Swift
init?(rawValue: UInt)
Parameters
rawValue
|
The raw value to use for the new instance.
|
-
-
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"
Declaration
Swift
var rawValue: UInt { get }
-
-
-
-
-
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eDayOfWeek\u003c/code\u003e is an enumeration representing the days of the week.\u003c/p\u003e\n"],["\u003cp\u003eIt conforms to \u003ccode\u003eEquatable\u003c/code\u003e, \u003ccode\u003eHashable\u003c/code\u003e, and \u003ccode\u003eRawRepresentable\u003c/code\u003e protocols, allowing for comparison, hashing, and raw value representation.\u003c/p\u003e\n"],["\u003cp\u003eEach day of the week (Monday through Sunday) is represented by a distinct case within the enumeration.\u003c/p\u003e\n"],["\u003cp\u003eThe raw value of each case is a \u003ccode\u003eUInt\u003c/code\u003e and aligns with \u003ccode\u003eNSDateComponents.weekday\u003c/code\u003e index (refer to the provided Apple documentation link for details).\u003c/p\u003e\n"],["\u003cp\u003eAn initializer \u003ccode\u003einit(rawValue:)\u003c/code\u003e is available to create an instance of \u003ccode\u003eDayOfWeek\u003c/code\u003e from a raw value.\u003c/p\u003e\n"]]],["`DayOfWeek` is an enum representing days of the week, matching `NSDateComponents.weekday` index. It conforms to `Equatable`, `Hashable`, and `RawRepresentable`. The `RawValue` is a `UInt`. Each day (monday, tuesday, wednesday, thursday, friday, saturday, sunday) is defined as a case. It can be initialized from a `UInt` raw value. A `rawValue` property provides the corresponding `UInt` for each day.\n"],null,["# GooglePlacesSwift Framework Reference\n\nDayOfWeek\n=========\n\n enum DayOfWeek\n\n extension DayOfWeek : Copyable, Equatable, Escapable, Hashable, RawRepresentable\n\nThe fields represent individual days of the week.\n\nMatches NSDateComponents.weekday index.\nRefer to \u003chttps://developer.apple.com/documentation/foundation/nsdatecomponents/1410442-weekday\u003e\n- `\n ``\n ``\n `\n\n ### [RawValue](#/s:17GooglePlacesSwift9DayOfWeekO8RawValuea)\n\n `\n ` \n The raw type that can be used to represent all values of the conforming\n type.\n\n Every distinct value of the conforming type has a corresponding unique\n value of the `RawValue` type, but there may be values of the `RawValue`\n type that don't have a corresponding value of the conforming type. \n\n #### Declaration\n\n Swift \n\n typealias RawValue = UInt\n\n- `\n ``\n ``\n `\n\n ### [friday](#/s:17GooglePlacesSwift9DayOfWeekO6fridayyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case friday\n\n- `\n ``\n ``\n `\n\n ### [init(rawValue:)](#/s:17GooglePlacesSwift9DayOfWeekO8rawValueACSgSu_tcfc)\n\n `\n ` \n Creates a new instance with the specified raw value.\n\n If there is no value of the type that corresponds with the specified raw\n value, this initializer returns `nil`. For example: \n\n enum PaperSize: String {\n case A4, A5, Letter, Legal\n }\n\n print(PaperSize(rawValue: \"Legal\"))\n // Prints \"Optional(PaperSize.Legal)\"\n\n print(PaperSize(rawValue: \"Tabloid\"))\n // Prints \"nil\"\n\n #### Declaration\n\n Swift \n\n init?(rawValue: UInt)\n\n #### Parameters\n\n |------------------|--------------------------------------------|\n | ` `*rawValue*` ` | The raw value to use for the new instance. |\n\n- `\n ``\n ``\n `\n\n ### [monday](#/s:17GooglePlacesSwift9DayOfWeekO6mondayyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case monday\n\n- `\n ``\n ``\n `\n\n ### [rawValue](#/s:17GooglePlacesSwift9DayOfWeekO8rawValueSuvp)\n\n `\n ` \n The corresponding value of the raw type.\n\n A new instance initialized with `rawValue` will be equivalent to this\n instance. For example: \n\n enum PaperSize: String {\n case A4, A5, Letter, Legal\n }\n\n let selectedSize = PaperSize.Letter\n print(selectedSize.rawValue)\n // Prints \"Letter\"\n\n print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)\n // Prints \"true\"\n\n #### Declaration\n\n Swift \n\n var rawValue: UInt { get }\n\n- `\n ``\n ``\n `\n\n ### [saturday](#/s:17GooglePlacesSwift9DayOfWeekO8saturdayyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case saturday\n\n- `\n ``\n ``\n `\n\n ### [sunday](#/s:17GooglePlacesSwift9DayOfWeekO6sundayyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case sunday\n\n- `\n ``\n ``\n `\n\n ### [thursday](#/s:17GooglePlacesSwift9DayOfWeekO8thursdayyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case thursday\n\n- `\n ``\n ``\n `\n\n ### [tuesday](#/s:17GooglePlacesSwift9DayOfWeekO7tuesdayyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case tuesday\n\n- `\n ``\n ``\n `\n\n ### [wednesday](#/s:17GooglePlacesSwift9DayOfWeekO9wednesdayyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case wednesday"]]