iOS Swift LoginController how to stay logged

Hello to everyone and I want to congratulate you on the excellent service. My problem is very simple but it is a couple of days that I can not solve it.
For my application I created this LoginController but I have problem with

 backendless.userService.setStayLoggedIn( true )

Every time I start my app, the application does not perform the auto-login and I have to type my user-credentials again. I ’ m reading the doc https://backendless.com/documentation/users/ios/users_login.htm but i could’t find a solution
here’s my code.
thanks :slight_smile:

class LoginController : UIViewController {


    
    
    @IBOutlet weak var emailTextField: UITextField!
    @IBOutlet weak var passwordTextField: UITextField!
    
    var backendless = Backendless.sharedInstance()


    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
    }


    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
   
    //StayLogged
    func remeberMe(sender: UISwitch) {
       
            backendless.userService.setStayLoggedIn( true  )
     
    }




    
    
    @IBAction func loginUserAsync() {
   
            let email = emailTextField.text
            let password = passwordTextField.text
        


            backendless.userService.login(
                email, password: password,
                response: { ( user : BackendlessUser!) -> () in
                    print("User has been logged in (ASYNC): \(user)")
                    
                    
                    //send to LoginView
                    let viewController:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("MenuTabBar")
                    //open the view
                    self.presentViewController(viewController, animated: true, completion: nil)


                },
                error: { ( fault : Fault!) -> () in
                    print("Server reported an error: \(fault)")
                }
            )
        }
    
    
    }

sorry, it was a problem. How I can delete this post?

I will delete it for you. I assume you found a solution by checking if the user token is valid? If it is, then the login form should not be shown.

Mark