0

Help me please with my ViewControllers closing. Im open new ViewController ("SettingsPage") with this code:

settingClass = storyboard?.instantiateViewControllerWithIdentifier("SettingsPage") as! SettingsClass
settingClass.modalPresentationStyle = .OverFullScreen
settingClass.modalTransitionStyle = .CrossDissolve
self.presentViewController(settingClass, animated: true, completion: nil)

Then im need to go back (close SettingsPage) and when im used this method ill get doubles of MainView

mainClass = storyboard?.instantiateViewControllerWithIdentifier("MainView") as! ViewController
mainClass.modalTransitionStyle = .CrossDissolve
self.presentViewController(mainClass, animated: true, completion: nil)

how to correctly close new ViewController ("SettingsPage") witch open like .OverFullScreen, and go back to my MainView?

Skie
  • 91
  • 1
  • 2
  • 13

1 Answers1

1

Try to close it like this

mainClass.dismissViewControllerAnimated(true, completion: {});
Evgeny Karkan
  • 8,782
  • 2
  • 32
  • 38
  • Thanks! its work in ViewController witch i want to close I'm use your code `self.dismissViewControllerAnimated(true, completion: nil)` – Skie Apr 24 '16 at 22:07