title: Get the presenting viewController of viewController.view in swift
body: <p>i am trying to get the presenting viewController of a viewController's view 
  The idea is like that :
  i have a </p>
  
  <p><code>viewController = CategoriesViewController</code></p>
  
  <p>and i am presenting its view inside anther </p>
  
  <p><code>viewController = HomeViewController</code></p>
  
  <p>by using </p>
  
  <p><code>CategoriesViewController.view</code>
  so when i want to reach the </p>
  
  <p><code>HomeViewController</code> from <code>CategoriesViewController</code></p>
  
  <p>i do this </p>
  
  <p><code>let vc = self.presentingViewController as? HomeViewController</code></p>
  
  <p>but it is telling me that it is nil
  i tried the </p>
  
  <p><code>.parentViewController</code> </p>
  
  <p>and it is returning </p>
  
  <p><code>CategoriesViewController</code></p>