ScrollView doesn't scroll in swift
<p>I have an UIView and add an UIScrollView to it. Inside the scrollView is an UIImageView.<br>
I want to zoom the image view by pressing a button. If the image view is zoomed you should be able to scroll but that's not working.     </p>

<p>Currently I have that: </p>

<pre><code>self.imageView = UIImageView()
self.imageView.image = image
self.imageView.frame = self.contentView.bounds

self.scrollView = UIScrollView()
self.scrollView.frame = self.contentView.bounds
self.scrollView.contentSize = self.contentView.bounds.size
self.scrollView.addSubview(self.imageView)

self.contentView.addSubview(self.scrollView)
</code></pre>

<p>and that:</p>

<pre><code>@IBAction func zoomPicture() {
    if (scale &lt;= 1.5) {
        scale = scale + 0.1
        scrollView.transform = CGAffineTransformMakeScale(scale, scale)
        scrollView.zoomScale = scale
        scrollView.maximumZoomScale = 1.5
        scrollView.minimumZoomScale = 1.0
        scrollView.contentSize = contentView.bounds.size
        scrollView.scrollEnabled = true
    }
}
</code></pre>

<p>my class also implements <code>UIScrollViewDelegate</code>and I set the delegate in the viewDidLoad() function. I have also added the <code>viewForZoomingInScrollView</code> function. The zoom works but I can't scroll.    </p>