Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 我知道Android中的代码,但我';我很难用Swift语言获得相同的输出_Java_Swift_Firebase_Firebase Realtime Database - Fatal编程技术网

Java 我知道Android中的代码,但我';我很难用Swift语言获得相同的输出

Java 我知道Android中的代码,但我';我很难用Swift语言获得相同的输出,java,swift,firebase,firebase-realtime-database,Java,Swift,Firebase,Firebase Realtime Database,代码是: DatabaseReference newDatabaseReference = mDatabaseReference.child("loccheck").push(); newDatabaseReference.getKey(); 我想要按下按键而不实际设置Firebase for iOS(Swift)中的数据您可能需要childByAutoIdSwift与android的push let key = mDatabaseReference.child("loccheck").ch

代码是:

DatabaseReference newDatabaseReference = mDatabaseReference.child("loccheck").push(); 
newDatabaseReference.getKey();

我想要按下按键而不实际设置Firebase for iOS(Swift)中的数据

您可能需要
childByAutoId
Swift与android的
push

let key = mDatabaseReference.child("loccheck").childByAutoId().key