Open devoloopsw opened 8 years ago
If you don't want the frontViewController to be reallocated each time, you can delete the segue in the storyboard. Then you could have a property of your frontViewController and instantiate it if the property is nil (the first time) programmatically like this :
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"YourStroryboardName" bundle:nil];
self.yourController = [storyBoard instantiateViewControllerWithIdentifier:@"YourControllerIdentifier"];
and push it with:
[self.revealViewController pushFrontViewController:_yourController animated:YES];
Hi, I have only one storyboard which is Main how can I handle this issue with swift?
What issue?
the issue is I would to stop the current active view controller from being reloaded when the cell in the side menu that is linked to it is selected. How can I achieve this with swift?
btw I don't have objective-c background :(
let storyboard = UIStoryboard(name: "Main", bundle: nil)
self.yourController = storyboard.instantiateViewControllerWithIdentifier("YourControllerIdentifier") as! UIViewController
self.revealViewController?.pushFrontViewController(_yourController, animated: true)
where should I call this code block? and should I do for every VC ?
When a cell is selected (didSelectRowAtIndexPath) in your menu. if your controller's property is not already set then instantiate the controller from your storyboard and set it, else push it directly.
my menu tableview is static I just push child VC from each static cell so there is no VC for it where can I trigger?
??
my sw_rear is tableview VC but each row is not dynamic all of them static it means I added each cell manually in storyboard so there is no assigned tableview VC to it
Provide a sample project please
project is private on bitbucket if u provide ur email address I can give authority to read my code or if u use TeamViewer or skype I can share my screen to show u all staff
I did not ask to provide your project bu a sample. Can you create a new sample project?
ok I'm creating right now
I'm uploading project right now
You have to create a new file (MenuTableViewController for example) and implement :
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath)
Hi, I have some properties in my Main front ViewController that need to save when my rear is called and reload when my front is reallocated, because when reallocating it turns the properties on their default values (in viewDidLoad) but I rather would like to reload the parameters as before the rear calling. Don't really realize how to do this...maybe with segues? Thank you