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 = Int
-
-
-
-
-
-
-
-
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: Int)
Parameters
rawValue
|
The raw value to use for the new instance.
|
-
-
-
Declaration
Swift
case onlineServiceHours
-
-
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: Int { 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\u003eHoursType\u003c/code\u003e is an enum used to identify the type of secondary opening hours for a place, like delivery or takeout.\u003c/p\u003e\n"],["\u003cp\u003eIt's only used for secondary opening hours, which are obtained from a \u003ccode\u003ePlace\u003c/code\u003e object's \u003ccode\u003esecondaryOpeningHours\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eHoursType\u003c/code\u003e conforms to \u003ccode\u003eEquatable\u003c/code\u003e, \u003ccode\u003eHashable\u003c/code\u003e, and \u003ccode\u003eRawRepresentable\u003c/code\u003e protocols, meaning its values can be compared, hashed, and represented by raw integer values.\u003c/p\u003e\n"],["\u003cp\u003eA full list of possible \u003ccode\u003eHoursType\u003c/code\u003e values and their meanings is available in the Google Maps Places API documentation.\u003c/p\u003e\n"]]],["`HoursType` is an enum identifying secondary opening hours from the Place API. It conforms to `Equatable`, `Hashable`, and `RawRepresentable`, with an `Int` raw value. It includes cases like `access`, `breakfast`, `brunch`, `delivery`, `dinner`, `driveThrough`, `happyHour`, `kitchen`, `lunch`, `onlineServiceHours`, `pickup`, `seniorHours`, and `takeout`. `init?(rawValue:)` initializes an instance, returning `nil` if no matching value exists. `rawValue` retrieves the integer representation.\n"],null,["# GooglePlacesSwift Framework Reference\n\nHoursType\n=========\n\n enum HoursType\n\n extension HoursType : Copyable, Equatable, Escapable, Hashable, RawRepresentable\n\nIdentifies the type of secondary opening hours.\n\n`HoursType` is only set for secondary opening hours (i.e. opening hours\nreturned from [Place](../Structs/Place.html) secondaryOpeningHours).\nHours types described here:\n\u003chttps://developers.google.com/maps/documentation/places/web-service/details#PlaceOpeningHours-type\u003e\n- `\n ``\n ``\n `\n\n ### [RawValue](#/s:17GooglePlacesSwift9HoursTypeO8RawValuea)\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 = Int\n\n- `\n ``\n ``\n `\n\n ### [access](#/s:17GooglePlacesSwift9HoursTypeO6accessyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case access\n\n- `\n ``\n ``\n `\n\n ### [breakfast](#/s:17GooglePlacesSwift9HoursTypeO9breakfastyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case breakfast\n\n- `\n ``\n ``\n `\n\n ### [brunch](#/s:17GooglePlacesSwift9HoursTypeO6brunchyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case brunch\n\n- `\n ``\n ``\n `\n\n ### [delivery](#/s:17GooglePlacesSwift9HoursTypeO8deliveryyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case delivery\n\n- `\n ``\n ``\n `\n\n ### [dinner](#/s:17GooglePlacesSwift9HoursTypeO6dinneryA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case dinner\n\n- `\n ``\n ``\n `\n\n ### [driveThrough](#/s:17GooglePlacesSwift9HoursTypeO12driveThroughyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case driveThrough\n\n- `\n ``\n ``\n `\n\n ### [happyHour](#/s:17GooglePlacesSwift9HoursTypeO9happyHouryA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case happyHour\n\n- `\n ``\n ``\n `\n\n ### [init(rawValue:)](#/s:17GooglePlacesSwift9HoursTypeO8rawValueACSgSi_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: Int)\n\n #### Parameters\n\n |------------------|--------------------------------------------|\n | ` `*rawValue*` ` | The raw value to use for the new instance. |\n\n- `\n ``\n ``\n `\n\n ### [kitchen](#/s:17GooglePlacesSwift9HoursTypeO7kitchenyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case kitchen\n\n- `\n ``\n ``\n `\n\n ### [lunch](#/s:17GooglePlacesSwift9HoursTypeO5lunchyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case lunch\n\n- `\n ``\n ``\n `\n\n ### [onlineServiceHours](#/s:17GooglePlacesSwift9HoursTypeO013onlineServiceD0yA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case onlineServiceHours\n\n- `\n ``\n ``\n `\n\n ### [pickup](#/s:17GooglePlacesSwift9HoursTypeO6pickupyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case pickup\n\n- `\n ``\n ``\n `\n\n ### [rawValue](#/s:17GooglePlacesSwift9HoursTypeO8rawValueSivp)\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: Int { get }\n\n- `\n ``\n ``\n `\n\n ### [seniorHours](#/s:17GooglePlacesSwift9HoursTypeO06seniorD0yA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case seniorHours\n\n- `\n ``\n ``\n `\n\n ### [takeout](#/s:17GooglePlacesSwift9HoursTypeO7takeoutyA2CmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case takeout"]]