gpt4 book ai didi

ios - 使用适用于 iOS 的 Google Places API 声明类型时出错

转载 作者:行者123 更新时间:2023-11-30 12:17:03 24 4
gpt4 key购买 nike

基本上,我收到错误“类型‘GMSPlacesAutocompleteTypeFilter’没有包含以下 block 的成员‘food’:

    let filter = GMSAutocompleteFilter()
filter.type = .food
autocompleteController.autocompleteFilter = filter

根据here ,应识别食品类型。任何帮助,将不胜感激。如果我缺乏一些基本的东西,我也深表歉意 - 我是 Swift 的新手。

最佳答案

您可以在附近搜索请求中以及添加链接中显示的地点时使用此类型

Table 1: Types supported in place search and addition

You can use the following values in the types filter for place searches and when adding a place.

不是 GMSPlacesAutocompleteTypeFilter,这些值可以在 GMSPlacesAutocompleteTypeFilter 类型中使用,我认为在您的情况下必须使用 development

/**
* The type filters that may be applied to an autocomplete request to restrict results to different
* types.
*/
public enum GMSPlacesAutocompleteTypeFilter : Int {


/**
* All results.
*/
case noFilter

/**
* Geeocoding results, as opposed to business results.
*/
case geocode

/**
* Geocoding results with a precise address.
*/
case address

/**
* Business results.
*/
case establishment

/**
* Results that match the following types:
* "locality",
* "sublocality"
* "postal_code",
* "country",
* "administrative_area_level_1",
* "administrative_area_level_2"
*/
case region

/**
* Results that match the following types:
* "locality",
* "administrative_area_level_3"
*/
case city
}

希望这对你有帮助

关于ios - 使用适用于 iOS 的 Google Places API 声明类型时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45293654/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com