title: Swift 3 - setting rootviewcontroller delegate to navigation controller
body: <p>In my Swift 3/Obj-C application, I'm trying to set the delegate of my rootviewcontroller to its navigation controller but am getting the following error:</p>
  
  <blockquote>
    <p>Cannot assign value of type 'NavController.Type' to type
    'RootViewControllerDelegate'</p>
  </blockquote>
  
  <p><strong>NavController.swift</strong></p>
  
  <pre><code>@available(iOS 10.0, *)
  @objc class NavController: UINavigationController, RootViewControllerDelegate {
  
      static func instantiate() -&gt; NavController? {
          let storyboard = UIStoryboard.init(name: "MyStoryboard", bundle: nil)
          let navVC = storyboard.instantiateViewController(withIdentifier: "NavController") as? NavController
  
          let rootVC = navVC?.viewControllers.first as! RootViewController
          rootVC.delegate = self // &lt;&lt;&lt;&lt; ERROR OCCURS HERE
  
          return navVC
      }
  
      func pressedNextButton()
      {
          NSLog("Next button works!")
      }
  }
  </code></pre>
  
  <p><strong>RootViewController.swift</strong></p>
  
  <pre><code>@objc protocol RootViewControllerDelegate {
      func pressedNextButton()
  }
  
  @available(iOS 10.0, *)
  @objc class RootViewController: UIViewController, NSFetchedResultsControllerDelegate, UITableViewDataSource, UITableViewDelegate {
  
      var delegate: RootViewControllerDelegate?
  
      @IBAction func nextButton(_ sender: UIBarButtonItem) {
          self.delegate?.pressedNextButton()
      }
  }
  </code></pre>
  
  <p><strong>MainProgram.m</strong></p>
  
  <pre><code>@interface MYQAddDeviceViewController () 
       @property (nonatomic, strong) NavController * navVC;
  @end
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      self.navVC = [NavController instantiate];
  }
  </code></pre>
  
  <p>Any ideas on how I can resolve that error?</p>