In a certain viewcontroller say 'viewcontroller1', on clicking a button I am setting a variable. Now I click on my hamburger button(created using SWRevealViewController) and go to another viewcontroller I want to use the value I set in viewcontroller1 in the other viewcontroller. How can I achieve this..Also, I am using swift.
You can set a variable in App Delegate say..'myVariable'. In your 'viewcontroller1' you can set the variable as 'appDelegate.myVariable'. You can use this format to access the variable also from another viewcontroller.