GooglePlacesSwift Framework Reference

AdvancedPlaceDetailsCompactView

@MainActor
struct AdvancedPlaceDetailsCompactView
extension AdvancedPlaceDetailsCompactView : SearchMediaSupportable, Sendable, SendableMetatype, View

A premium view that displays place details results.

Has additional configurations compared to its basic counterpart (PlaceDetailsCompactView).

  • 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 of the content that can be displayed for the view.

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    @MainActor
    var configuration: AdvancedPlaceDetailsCompactConfiguration
  • Adds a closure to be called when place actions are requested for the corner area of the place view.

    Actions are presented starting from the corner and extend inwards.

    Declaration

    Swift

    @MainActor
    func cornerActions(actionsProvider: @escaping (Place) -> [CornerPlaceActionElement]) -> AdvancedPlaceDetailsCompactView

    Parameters

    actionsProvider

    A closure that returns a list of CornerPlaceActionElements to be displayed for the specified location. An empty array should be returned if no elements are desired.

    Return Value

    The AdvancedPlaceDetailsCompactView with the closure added.

  • Initializes a new instance of AdvancedPlaceDetailsCompactView.

    Declaration

    Swift

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

    Parameters

    orientation

    The orientation of the view.

    query

    The query that should be performed for the view.

    configuration

    The configuration of the view.

    placeDetailsCallback

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

  • Adds a closure to be called when place actions are requested for the main body area of the place view.

    Declaration

    Swift

    @MainActor
    func mainActions(actionsProvider: @escaping (Place) -> [MainPlaceActionElement]) -> AdvancedPlaceDetailsCompactView

    Parameters

    actionsProvider

    A closure that returns a list of MainPlaceActionElements to be displayed for the specified location. An empty array should be returned if no elements are desired.

    Return Value

    The AdvancedPlaceDetailsCompactView with the closure added.

  • 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: built-in place actions behave as usual, and custom actions call only their MainPlaceAction.onTap or CornerPlaceAction.onTap closure.

    Declaration

    Swift

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

    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 AdvancedPlaceDetailsCompactView with the closure added.

  • The orientation of the view.

    Declaration

    Swift

    @MainActor
    var orientation: PlaceViewOrientation
  • The query that should be performed for the view.

    Declaration

    Swift

    @Binding
    @MainActor
    var query: PlaceDetailsQuery { get nonmutating set }
  • A set of standard content to be displayed for the view.

    Declaration

    Swift

    @MainActor
    static let standardContent: Set<AdvancedPlaceDetailsCompactContent>