小编Bra*_*don的帖子

即使关闭应用程序,如何保持用户登录?我正在使用swift 3和Firebase

我是编码和堆栈溢出的新手,我试图让用户在关闭应用程序后仍然保持登录状态.我也不希望他们总是在屏幕上看到登录.即使关闭应用程序并重新打开应用程序,我该如何保持用户登录.我正在使用Swift 3.0,Xcode 8和Firebase.

import UIKit
import Firebase
import SwiftKeychainWrapper


class LoginViewController: UIViewController {

    @IBOutlet weak var emailField: UITextField!
    @IBOutlet weak var pwField: UITextField!


    override func viewDidLoad() {
        super.viewDidLoad()
        let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(LoginViewController.dismissKeyboard))
        //Uncomment the line below if you want the tap not not interfere and cancel other interactions.
        //tap.cancelsTouchesInView = false

        view.addGestureRecognizer(tap)

        // Do any additional setup after loading the view.
    }


    func dismissKeyboard() {
        //Causes the view (or one of its embedded text fields) to …
Run Code Online (Sandbox Code Playgroud)

ios firebase swift swift3 xcode8

0
推荐指数
1
解决办法
5395
查看次数

标签 统计

firebase ×1

ios ×1

swift ×1

swift3 ×1

xcode8 ×1