title: Can't figure out why I am getting "Class ViewController has no initializers" Error in Swift iOS App Code
body: <p>I was trying to  make a tutorial screen in my iOS app where the user swipes past a few pictures to learn a bit about the said application. Everything looks fine, except when I build my project, I get the following error on the very first line of code: </p>
  
  <blockquote>
    <p>Class ViewController has no initializers</p>
  </blockquote>
  
  <p>What did I do wrong?</p>
  
  <p>My ViewController.swift code is below</p>
  
  <pre><code>import UIKit
  
  //line below is where I get the error
  
  class ViewController: UIViewController, UIPageViewControllerDataSource {
  
  //end
  
  var pageViewController: UIPageViewController
  var pageTitles: NSArray!
  var pageImages: NSArray!
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      self.pageTitles = NSArray(objects: "", "", "")
      self.pageImages = NSArray(objects: "page1", "page2", "page3")
  
      self.pageViewController = self.storyboard?.instantiateViewControllerWithIdentifier("PageViewController") as!
      UIPageViewController
  
      self.pageViewController.dataSource = self
  
      var startVC = self.viewControllerAtIndex(0) as ContentViewController
      var viewControllers = NSArray(object: startVC)
  
      self.pageViewController.setViewControllers(viewControllers as [AnyObject], direction: .Forward, animated: true, completion: nil)
  
      self.addChildViewController(self.pageViewController)
      self.view.addSubview(self.pageViewController.view)
      self.pageViewController.didMoveToParentViewController(self)
  
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  @IBAction func restartAction(sender: AnyObject) {
  }
  
  func viewControllerAtIndex(index: Int) -&gt; ContentViewController
  {
  
      if ((self.pageTitles.count == 0) || (index &gt;= self.pageTitles.count))
      {
          return ContentViewController()
      }
  
      var vc: ContentViewController = self.storyboard?.instantiateViewControllerWithIdentifier("ContentViewController") as! ContentViewController
  
      vc.imageFile = self.pageImages[index] as! String
      vc.titleText = self.pageTitles[index] as! String
  
      vc.pageIndex = index
  
      return vc
  
  }
  
  // Mark: - Page View Controller Data Source
  
  func pageViewController(pageViewController: UIPageViewController, viewControllerBeforeViewController viewController: UIViewController) -&gt; UIViewController? {
  
      var vc = viewController as! ContentViewController
      var index = vc.pageIndex as Int
  
      if (index == 0 || index == NSNotFound)
      {
          return nil
      }
  
      index--
      return self.viewControllerAtIndex(index)
  
  }
  
  func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController viewController: UIViewController) -&gt; UIViewController? {
  
      var vc = viewController as! ContentViewController
      var index = vc.pageIndex as Int
  
      if (index == NSNotFound)
      {
          return nil
      }
  
      index++
  
      if (index == self.pageTitles.count)
      {
          return nil
      }
  
      return self.viewControllerAtIndex(index)
  }
  
  func presentationCountForPageViewController(pageViewController: UIPageViewController) -&gt; Int {
      return self.pageTitles.count
  }
  
  func presentationIndexForPageViewController(pageViewController: UIPageViewController) -&gt; Int {
      return 0
  }
  
  }
  </code></pre>