如何解决使用未解决的标识符“ SetOptions”?

Tom*_* B. 2 ios firebase swift google-cloud-firestore

我已经更新了Firestore以进行后续操作。现在,我不能使用它了。我删除了,重新安装了几次。但是没有变化。我迷失了方向。问题是:

“使用未解决的标识符'SetOptions'”。

db.collection("").document("").setData([ "p1answered":false, "p1OutofTime": false ], options: SetOptions.merge())

Bolts (1.9.0)
Using BoringSSL (10.0.2)
Using FBSDKCoreKit (4.33.0)
Using FBSDKLoginKit (4.33.0)
Using Firebase (5.0.1)
Using FirebaseAnalytics (5.0.0)
Using FirebaseAuth (5.0.0)
Using FirebaseCore (5.0.1)
Using FirebaseFirestore (0.12.1)
Using FirebaseInstanceID (3.0.0)
Using FirebaseUI (5.0.0)
Using GTMOAuth2 (1.1.6)
Using GTMSessionFetcher (1.1.15)
Using Google-Mobile-Ads-SDK (7.31.0)
Using GoogleSignIn (4.1.2)
Using GoogleToolboxForMac (2.1.4)
Using Protobuf (3.5.0)
Using SwiftySound (1.0.0)
Using TwitterCore (3.1.0)
Using TwitterKit (3.3.0)
Using gRPC (1.12.0)
Using gRPC-Core (1.12.0)
Using gRPC-ProtoRPC (1.12.0)
Using gRPC-RxLibrary (1.12.0)
Using leveldb-library (1.20)
Using nanopb (0.3.8)
Run Code Online (Sandbox Code Playgroud)

// Pod文件

取消注释下一行以定义项目的全球平台

平台:ios,“ 9.0”

目标'Tahmin Et'做#如果您不使用Swift且不​​想使用动态框架use_frameworks,请在下一行注释!

 # Pods for My App

    pod 'SwiftySound'
    pod 'FirebaseUI/Google'
    pod 'FirebaseUI/Facebook'
    pod 'Google-Mobile-Ads-SDK'
    pod 'FirebaseUI/Twitter'
    pod 'FirebaseCore'
    pod 'FirebaseAuth'
    pod 'FirebaseFirestore'

end
Run Code Online (Sandbox Code Playgroud)

The*_*ger 5

您的代码还可以,您只需要import FirebaseFirestore在您的课程中就可以了。

编辑:讨论后

pod 'FirebaseFirestore'也不正确。应该是pod 'Firebase/Firestore'。看一下Firebase入门指南,在“ 设置开发环境”下选择“ iOS”选项卡。

编辑:2

在最新文档中,它类似于:

db.collection("cities").document("BJ").setData([ "capital": true ], merge: true)
Run Code Online (Sandbox Code Playgroud)