![](/img/trans.png)
[英]Swift - Value of Type ViewController has no member *functionName*
[英]Value of type 'ViewController' has no member 'authUI'?
我是iOS开发的新手。.我想实现Firebase不礼貌的UI
这是我的ViewController文件
import UIKit
import Firebase
import FirebaseCore
import FirebaseAuth
import FirebaseUI
import FirebaseFirestore
class ViewController: UIViewController{
//let authUI = FUIAuth.defaultAuthUI()
//let authui = FirebaseApp.configure()
override func viewDidLoad() {
super.viewDidLoad()
// FirebaseApp.configure()
if FirebaseApp.app() == nil {
FirebaseApp.configure()
}
print("came inside viewdialoadds")
// logiin()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
print("came inside parttwoooooooooooo")
}
@IBAction func loginfunction(_: UIButton) {
print("Tappeddddddddddddddddddddd")
logiin()
}
func logiin() {
print("login called")
if FirebaseApp.app() == nil {
print("login called firebase now confieeddd")
FirebaseApp.configure()
}
// FirebaseApp.configure()
print("login called firebase UI confieeddd")
let authUI = FUIAuth.defaultAuthUI()
// You need to adopt a FUIAuthDelegate protocol to receive callback
authUI?.delegate = self as? FUIAuthDelegate
// authUI.delegate = self
let providers: [FUIAuthProvider] = [
FUIGoogleAuth(),
FUIPhoneAuth(authUI:FUIAuth.defaultAuthUI()!),
]
self.authUI.providers = providers
func application(_ app: UIApplication, open url: URL,
options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
let sourceApplication = options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String?
if FUIAuth.defaultAuthUI()?.handleOpen(url, sourceApplication: sourceApplication) ?? false {
return true
}
// other URL handling goes here.
return false
}
}
我收到编译时间错误,请在下面添加屏幕截图,请检查一下
任何人都请指定我的代码有什么问题。...我在这里https://firebase.google.com/docs/auth/ios/firebaseui?authuser=0找到了文档
尝试删除self,您在函数中具有局部变量authUI。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.