You can keep a reference to the class and have a method in it that loads the content inside it.
class gameViewController : UIViewController {
func loadContent() {
// this method should refresh content everytime.
}
}
In some other class, where ever you wish to, just create a reference to previous class.
class SomeClass {
var referenceToGameClass : gameViewController!
func someFunc() {
self.referenceToGameClass.loadContent()
}
}
But how can you save the same reference while going out of the gameViewController class? You can add this line in your prepareforsegue method maybe, let's say while going to above mentioned 'SomeClass' :
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if(segue.identifier == "segueID") {
let svc = segue.destinationViewController as! SomeClass
svc.referenceToGameClass = self
}
}
And conveniently, to move out of 'SomeClass' back to same gameViewController, simply use :
self.presentViewController(self.referenceToGameClass, animated: true, completion: nil)
This can get a bit confusing, but if you read it a couple times carefully, you will get it. You can also ask me questions!