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

问题描述 投票:1回答:1

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

在最新版本的GooglePlaces cocoapod(3.3.7)中,尽管[class]接口中存在该字段,但无法访问viewport字段

//
//  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兼容,并且该字段对于应用程序的业务逻辑非常重要,我该怎么办?

谢谢!

cocoapods viewport google-places gmsplace
1个回答
0
投票

确保同时导入GooglePlaces

© www.soinside.com 2019 - 2024. All rights reserved.