GooglePlacesSwift Framework Reference

PlaceDetailsCompactView

@MainActor
struct PlaceDetailsCompactView
extension PlaceDetailsCompactView : Sendable, SendableMetatype, View
  • Declaration

    Swift

    @MainActor
    var $query: Binding<PlaceDetailsQuery> { get }
  • The type of view representing the body of this view.

    When you create a custom view, Swift infers this type from your implementation of the required View/body-swift.property property.

    Declaration

    Swift

    typealias Body = some View
  • All PlaceDetailsCompactContent types for the place details compact view.

    Declaration

    Swift

    @MainActor
    static let allContent: Set<PlaceDetailsCompactContent>
  • The body of the place details compact view.

    Declaration

    Swift

    @MainActor
    @preconcurrency
    var body: some View { get }
  • The configuration of the place details compact view.

    Declaration

    Swift

    @MainActor
    var configuration: PlaceDetailsCompactConfiguration
  • Initializer for the place details compact view.

    Declaration

    Swift

    @MainActor
    init(orientation: PlaceViewOrientation = .vertical, query: Binding<PlaceDetailsQuery>, configuration: PlaceDetailsCompactConfiguration, placeDetailsCallback: @escaping (PlaceDetailsResult) -> Void)

    Parameters

    orientation

    The orientation of the place details view.

    query

    The place details component query.

    configuration

    The configuration of the place details compact view.

    placeDetailsCallback

    The callback to be invoked when the place details view is loaded.

  • Makes the place card tappable and adds a closure to be called when the user taps it.

    The card becomes tappable once its place loads; it is not tappable while loading or after an error. Taps on buttons inside the card do not tap the card.

    Declaration

    Swift

    @MainActor
    func onTap(_ callback: @escaping (Place) -> Void) -> PlaceDetailsCompactView

    Parameters

    callback

    A closure to be called with the place when the user taps the card. The place contains only its ID, coordinate, and viewport.

    Return Value

    The PlaceDetailsCompactView with the closure added.

  • The orientation of the place details view.

    Declaration

    Swift

    @MainActor
    var orientation: PlaceViewOrientation
  • The place details component query.

    Declaration

    Swift

    @Binding
    @MainActor
    var query: PlaceDetailsQuery { get nonmutating set }
  • The standard PlaceDetailsCompactContent types for the place details compact view.

    Declaration

    Swift

    @MainActor
    static let standardContent: Set<PlaceDetailsCompactContent>