首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GMSPlace类型的值在GooglePlaces Cocoapod 3.3.7中没有成员'viewport‘

GMSPlace类型的值在GooglePlaces Cocoapod 3.3.7中没有成员'viewport‘
EN

Stack Overflow用户
提问于 2020-02-04 11:05:49
回答 1查看 363关注 0票数 1

几年后,这个question中描述的问题再次出现,

在最新版本的GooglePlaces cocoapod (3.3.7)中,视图字段是不可访问的,尽管该字段存在于类接口中

代码语言:javascript
复制
//
//  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和字段是非常重要的应用程序的业务逻辑,我能做什么?

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60056005

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档