PlaceAnalyticsEvent
struct PlaceAnalyticsEventextension PlaceAnalyticsEvent : Equatable, Hashable, Sendable, SendableMetatypeAn analytics event reported by a Places UI Kit component.
Places UI Kit components deliver events to handlers registered with
View.onPlaceAnalyticsEvent(_:).
-
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
aandb,a == bimplies thata != bisfalse.Declaration
Swift
static func == (a: PlaceAnalyticsEvent, b: PlaceAnalyticsEvent) -> Bool -
The Places UI Kit components that report analytics events.
Declaration
Swift
enum ComponentType -
The configurable content areas of a component that a
PlaceAnalyticsEventcan relate to.Declaration
Swift
enum ContentType -
Tags that describe what happened in a
PlaceAnalyticsEvent.Tags name the user’s intent or destination rather than the control that triggered it, so the same action reports the same tags wherever it appears. Events combine several independent tags; for example, tapping the Directions button reports
click,directions, andoutbound.Declaration
Swift
enum Tag -
The Places UI Kit component that reported the event.
One of the
PlaceAnalyticsEvent.ComponentTypeconstants, such asPlaceAnalyticsEvent.ComponentType.placeDetailsCompact.Declaration
Swift
var componentType: String -
The
PlaceAnalyticsEvent.ContentTypevalue of the configurable content area the event relates to, ornilif the event does not relate to a configurable content area.Declaration
Swift
var contentType: String? -
Hashes the essential components of this value by feeding them into the given hasher.
Implement this method to conform to the
Hashableprotocol. The components used for hashing must be the same as the components compared in your type’s==operator implementation. Callhasher.combine(_:)with each of these components.Important
In your implementation of
hash(into:), don’t callfinalize()on thehasherinstance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.Declaration
Swift
func hash(into hasher: inout Hasher) -
The hash value.
Hash values are not guaranteed to be equal across different executions of your program. Do not save hash values to use during a future execution.
Important
hashValueis deprecated as aHashablerequirement. To conform toHashable, implement thehash(into:)requirement instead. The compiler provides an implementation forhashValuefor you.Declaration
Swift
var hashValue: Int { get } -
Creates an analytics event.
Declaration
Swift
init(componentType: String, tags: Set<String> = [], places: [Place] = [], contentType: String? = nil)Parameters
componentTypeThe
PlaceAnalyticsEvent.ComponentTypevalue of the reporting component.tagsThe
PlaceAnalyticsEvent.Tagvalues that describe what happened.placesThe place(s) the event applies to.
contentTypeThe
PlaceAnalyticsEvent.ContentTypevalue of the related content area. -
The place(s) the event applies to, or an empty array if no place is loaded.
Each place contains only its ID, coordinate, and viewport.
Declaration
Swift
var places: [Place] -
The
PlaceAnalyticsEvent.Tagvalues that describe what happened, such asPlaceAnalyticsEvent.Tag.clickandPlaceAnalyticsEvent.Tag.outbound.Tags are independent of each other and have no order.
Declaration
Swift
var tags: Set<String>