evnaz / ENSwiftSideMenu

A simple side menu for iOS written in Swift.
MIT License
1.82k stars 281 forks source link

When I go back my previous screen data of text field disappears #173

Closed atalayasa closed 6 years ago

atalayasa commented 6 years ago

Hello first of all thanks for the library it makes my job easier. I have two independent view controller that uses side menu. When button pressed from first VC it is doing following code

    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    var destinationVC:UIViewController!
    destinationVC = storyboard.instantiateViewController(withIdentifier: "SicilBilgileriVC") as! SicilBilgileriVC
    sideMenuController()?.setContentViewController(destinationVC)
    hideSideMenuView()

When I pressed back button from my second vc it is triggering following code to go back first VC.

let storyboard = UIStoryboard(name: "Main", bundle: nil)
var destinationVC:UIViewController!
    destinationVC = storyboard.instantiateViewController(withIdentifier: "SicilBilgileriVC") as! SicilBilgileriVC
    sideMenuController()?.setContentViewController(destinationVC)
    hideSideMenuView()

However, inputs that I have added first VC has been gone somehow. I need to keep them even if user pressed back button? I also tried pushing two of VC's but I could not be successful. Where am I missing?