MarksCode
MarksCode

Reputation: 8584

Firebase push data Swift?

I know for the web Firebase API there is a .push() option that will guarantee the entries will be in the order they were inserted into your database. However, using Swift the only way to add data is to use the .set() and .updateChildValues() methods.

Is there anything like the .push() for Swift where I can make sure my data appears in the order it was inserted?

Upvotes: 1

Views: 1715

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598740

In iOS the method to generate such unique keys is called childByAutoId().

See the Firebase documentation on adding an item to a list.

Upvotes: 7

Related Questions