i would like create my function to navigate through my views.
i have a function
func ShowView(name:String,caller:AppDelegate){
//story board
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let initViewController: UIViewController = storyBoard.instantiateViewControllerWithIdentifier(name) as UIViewController
caller.UIWindow?.rootViewController = initViewController
}
but i need to call this function from AppDelegate and UIViewController , how can i get uiwindow from UIViewController , from AppDelegate is ok but i can't keep AppDelegate like caller parameter cause i would like that it work with UIViewController. I don't really know which i must use for my parameter.
many thanks