I am creating an ios app with swift. I have an UIViewController and an "UserManager" class which inherits from NSObject. Basically, when the user opens the app, the code within UIViewController is executed. UIViewController calls a function in UserManager. When this function has finished, I want that a segue be performed (a segue called "connectSegue" in my code). I am a beginner...
What I have done (and didn't work!) :
Here is my ViewController :
import UIKit
var profileUser = UserManager()
class ViewController : UIViewController{
override func viewDidLoad() {login()}
func login()->Void {profileUser.createUser()}
func handleSegue()->Void {self.performSegueWithIdentifier("connectSegue",sender: self)}
}
Here is my UserManager class :
import Foundation
class UserManager: NSObject {
//Some properties
func createUser()->Void {
//Some code
var segueHandler = ViewController()
segueHandler.handleSegue()
}
}
How can I do that? Thank you