title: Swift: call function from storyboard view controller I presented?
body: <p>Ok, Ive tried the usual methods here but can't figure out this relatively simple issue - </p>
  
  <p>I have a view controller that I present here:</p>
  
  <pre><code>self.presentViewController((self.storyboard?.instantiateViewControllerWithIdentifier("createEvent"))!, animated: true, completion: nil)
  </code></pre>
  
  <p>And I need to call a function in my original main VC from this createEvent VC. I have tried putting:</p>
  
  <pre><code>weak var superv: MainViewController!
  </code></pre>
  
  <p>in the create event class then doing something like this:</p>
  
  <pre><code>let create = self.storyboard?.instantiateViewControllerWithIdentifier("createEvent")
  create.superv = self //error here
  </code></pre>
  
  <p>Then in create doing:</p>
  
  <pre><code>superv.updateThings()
  </code></pre>
  
  <p>But I get an error trying to tie the presented VC to my MainViewController. What am I doing wrong here?</p>
  
  <p>I have seen use of protocols but I would like to avoid that. What is the simplest way to do this?</p>
  
  <p>This is what I did:
  In main:</p>
  
  <pre><code>var create = UIViewController()
  create = (self.storyboard?.instantiateViewControllerWithIdentifier("createEvent"))!
          create.delegate = self //error here
  </code></pre>
  
  <p>In create:</p>
  
  <pre><code> weak var delegate: CreateEventDelegate!
  protocol CreateEventDelegate: class {
      func doSomeFunction ()
  }
  </code></pre>
  
  <p>And the error is <code>value of type uiviewcontroller has no member delegate</code></p>
  
  <p>The function in main I need to call is:</p>
  
  <pre><code>self.tableView.reloadData()
  </code></pre>
  
  <p>Error:</p>
  
  <p><a href="https://i.stack.imgur.com/MUfgq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MUfgq.png" alt="enter image description here"></a></p>