几年后,这个question中描述的问题再次出现,
在最新版本的GooglePlaces cocoapod (3.3.7)中,视图字段是不可访问的,尽管该字段存在于类接口中
//
// GMSPlace.h
// Google Places SDK for iOS
//
// Copyright 2016 Google Inc.
//
// Usage of this SDK is subject to the Google Maps/Google Earth APIs Terms of
// Service: https://developers.google.com/maps/terms
//
.....
other fields
.....
/**
* The recommended viewport for this place. May be nil if the size of the place is not known.
*
* This returns a viewport of a size that is suitable for displaying this place. For example, a
* |GMSPlace| object representing a store may have a relatively small viewport, while a |GMSPlace|
* object representing a country may have a very large viewport.
*/
@property(nonatomic, strong, readonly, nullable) GMSCoordinateBounds *viewport;
.....
.....更新是必需的,以确保与API和字段是非常重要的应用程序的业务逻辑,我能做什么?
谢谢!
发布于 2020-03-15 09:40:36
确保您同时导入了GoogleMapsBase.和GooglePlaces
GMSCoordinateBounds是用GoogleMapBase定义的。
谷歌在3.5.0版changelog:https://developers.google.com/places/ios-sdk/releases中提到了这一更改
GooglePlace/GooglePlaces.h不再临时包含GoogleMapsBase.h中的类,因此如果在代码中使用GMSCoordinateBounds类,现在必须#导入GoogleMapsBase/GoogleMapsBase.h。
https://stackoverflow.com/questions/60056005
复制相似问题