ios - 如何初始化和自定义 GMSPlace 对象

标签 ios swift core-location gmsplace

我想使用自定义变量初始化和自定义 GMSPlace 对象。我正在尝试执行以下操作:

import Foundation
import GooglePlaces

func parseObject() {
    let parsedGMS = GMSPlace()
    parsedGMS.coordinate.latitude = 4.0 
    parsedGMS.formattedAddress = "test test"
}

但问题是这些只是获取属性,所以我该怎么做?

enter image description here

最佳答案

你不能那样做。 GMSPlace是一个不可变的类。这意味着一旦创建了此类的对象,就无法更改其内容。您不应该从此类创建自己的自定义对象。

关于ios - 如何初始化和自定义 GMSPlace 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53656324/

相关文章:

ios - 使用 iOS 应用打开电池盒充电器

ios - SignificantLocationChanges 不适用于 iOS 8

ios - 即使在弹出 View Controller 之后,CLLocationManager 委托(delegate)仍然被调用

swift - 从 XIB-file-Button 显示 ViewController - Swift

ios - 当约束改变时如何改变 UITableViewCell 的高度?

ios - 如何在 UITableViewCell 中实现 UIPageViewController

ios - 使用 locationManager.requestLocation() 时应用程序崩溃

php - 将标签数据从 TableView 传递到另一个 View Controller

ios - 我们可以在属于同一开发者帐户的应用之间共享应用内购买吗?

ios - 如何在启动时实现像 UBER 应用程序文本这样的动画