How to fix error “Ambiguous use of 'increment'” on iOS Firestore increment()

前端 未结 1 643
忘了有多久
忘了有多久 2021-01-12 05:47

I receive a compiler error when trying to use firebase FieldValue.increment(1) in iOS using swift. The error only says \"Ambiguous use of \'increment\'\"

1条回答
  •  再見小時候
    2021-01-12 06:29

    As noted in the comments, the "Ambiguous use of 'increment'" error is solved for me by changing the code in the example to FieldValue.increment(Int64(1)). The compiler provides an option of double or int64 for the increment operator and I guess it does not know which one to choose.

    0 讨论(0)
提交回复
热议问题