title: Scroll view not being able to zoom in or out in swift
body: <p>I'm trying to get my image to be able to zoom in and zoom out inside a page view controller.</p>
  
  <p>Layers:</p>
  
  <p>--UIPageViewController</p>
  
  <p>----CustomPageContentController</p>
  
  <p>------ScrollView</p>
  
  <p>--------UIImageView</p>
  
  <p>----------UIImage</p>
  
  <p>The image is showing fine, but I'm not able to zoom in or zoom out via a pinch.</p>
  
  <p>How is this action enabled via code in swift?</p>
  
  <p>This is what I currently have:</p>
  
  <pre><code>class PublicationPageView: UIViewController, UIScrollViewDelegate{
  
      var pageIndex:Int = 0
      var publicationImageView:UIImageView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          println("pageIndex: \(pageIndex)")
          publicationImageView.contentMode = UIViewContentMode.ScaleAspectFit
  
  
          // Need to reposition the image
          publicationImageView.frame = CGRectMake(0, 0, view.frame.width, view.frame.height-65-65)
          println(publicationImageView.bounds.size)
  
  
          var scrollView = UIScrollView(frame: CGRectMake(0, 0, view.frame.width, view.frame.height-65-65))
  
          scrollView.addSubview(publicationImageView)
          scrollView.contentMode = UIViewContentMode.ScaleAspectFit
          scrollView.maximumZoomScale = 4.0
          scrollView.minimumZoomScale = 1.0
  
          self.view.addSubview(scrollView)
  
  
  
      }
  
  }
  </code></pre>
  
  <p>Is this a best practice way? Or would there be a better way to be doing this? I'm open to suggestions. </p>
  
  <p>Thanks in advance </p>