i have an issue. I would like to change the view controller in swift.
This is a part of my code:
if success == "1" {
NSLog("Login SUCCESS");
var prefs:NSUserDefaults = NSUserDefaults.standardUserDefaults()
prefs.setObject(mobile, forKey: "USERNAME")
prefs.setInteger(1, forKey: "ISLOGGEDIN")
prefs.synchronize()
self.presentViewController(OtpVC(), animated: true, completion: nil)
}
my OtpVC file is:
class OtpVC: UIViewController {
@IBOutlet weak var smsfield: UITextField!
@IBAction func continueButton(sender: AnyObject) {
}
}
The problem now is that when is login successful the page change and goes all black!
How i can fix that? Thanks in advance.