title: Accessing UI operations from another class
body: <p>I have a "Share on Facebook" button in my app at 3 different view controllers. So I wrote a class which name is "ShareCentral" and i want to do all sharing operations in this class. But for showing share dialog i need to pass uiviewcontroller to my ShareCentral class. I did like that:</p>
  
  <pre><code>class ShareCentral {
  
  
  
      var UIVC: UIViewController
  
  
      init(vc:UIViewController) {
          self.UIVC = vc
      }
  
      func shareOnFacebook() {
          var content = LinkShareContent(url: URL(string:userProfileLink)!)
          do {
              try ShareDialog.show(from: UIVC, content: content)
          }catch (let error) {
              print(error)
          }
      }
  }
  </code></pre>
  
  <p>And this is my view controller:</p>
  
  <pre><code>class SettingsViewController: UIViewController {
  
      let shareCentral = ShareCentral(vc: self)
  
  
      @IBAction func shareButtonClicked(_ sender: AnyObject) {
            self.shareCentral.shareOnFacebook()
      }
  }
  </code></pre>
  
  <p>I am getting following compiler error:</p>
  
  <pre><code>SettingsViewController.swift:40:41: Cannot convert value of type '(SettingsViewController) -&gt; () -&gt; (SettingsViewController)' to expected argument type 'UIViewController'
  </code></pre>
  
  <p>I know if i change the type of UIVC to "SettingsViewController" the problem will disappear. But as i said before i am gonna use this method in three different view controllers. </p>
  
  <p>How can i resolve this problem?</p>