我有一个名为 WareHouse 的类和一个必需的 init() 我想像下面的示例一样调用它,但我不知道如何对其进行编程。有什么建议么?
Warehouse(databaseName:"GoogleService-Info").share.signIn(withEmail:xxxx, withPassword:XXX)
以下是我的示例代码
class WareHouse{
public static let shared = WareHouse(databaseName: "GoogleService-Info-WarehouseDev")
....
required init(databaseName:String) {
let filePath = Bundle.main.path(forResource: databaseName, ofType: "plist")
if let filePath = filePath {
let fileopts = FirebaseOptions(contentsOfFile: filePath)
FirebaseApp.configure(name: "Warehouse", options: fileopts!)
app = FirebaseApp.app(name: "Warehouse")
}
}
func signIn(withEmail:String, withPassword:String){
}
}