iOS 10 Issue: UIScrollView Not Scrolling, Even When ContentSize Is Set
<p><strong><em>UPDATE:</strong> This is an iOS 10 issue. This still works as before in iOS 9.</em></p>

<p>This is ...interesting.</p>

<p>I just converted my "teaching project" (a "toy" app) to Swift 3.</p>

<p>It has been working for a couple of years under Swift 1.2.</p>

<p>All of a sudden, my UIScrollView is not scrolling, even when I set the contentSize way past its lower boundary.</p>

<p>Here's the relevant code (the displayTags routine is called with an array of images that are displayed centered and slightly vertically offset, leading to a vertical chain):</p>

<pre><code>    /*******************************************************************************************/
    /**
        \brief  Displays the tags in the scroll view.

        \param inTagImageArray the array of tag images to be displayed.
    */
    func displayTags ( inTagImageArray:[UIImage] )
    {
        self.tagDisplayView!.bounds = self.tagDisplayScroller!.bounds
        if ( inTagImageArray.count &gt; 0 )    // We need to have images to display
        {
            var offset:CGFloat = 0.0    // This will be the vertical offset for each tag.

            for tag in inTagImageArray
            {
                self.displayTag ( inTag: tag, inOffset: &amp;offset )
            }
        }
    }
    /*******************************************************************************************/
    /**
        \brief  Displays a single tag in the scroll view.

        \param inTag a UIImage of the tag to be displayed.
        \param inOffset the vertical offset (from the top of the display view) of the tag to be drawn.
    */
    func displayTag ( inTag:UIImage, inOffset:inout CGFloat )
    {
        let imageView:UIImageView = UIImageView ( image:inTag )
        var containerRect:CGRect = self.tagDisplayView!.frame   // See what we have to work with.
        containerRect.origin = CGPoint.zero
        let targetRect:CGRect = CGRect ( x: (containerRect.size.width - inTag.size.width) / 2.0, y: inOffset, width: inTag.size.width, height: inTag.size.height )
        imageView.frame = targetRect
        containerRect.size.height = max ( (targetRect.origin.y + targetRect.size.height), (containerRect.origin.y + containerRect.size.height) )
        self.tagDisplayView!.frame = containerRect
        self.tagDisplayView!.addSubview ( imageView )
        self.tagDisplayScroller!.contentSize = containerRect.size
        print ( "Tag Container Rect: \(containerRect)" )
        print ( "    Tag ScrollView Bounds: \(self.tagDisplayScroller!.bounds)" )
        inOffset = inOffset + (inTag.size.height * 0.31)
    }
</code></pre>

<p>Note that the scrollView's contentSize is expanded each time a tag is added. I checked (see the print statements), and the value seems to be correct.</p>

<p><a href="https://bitbucket.org/bmlt/nacc-ios-app" rel="nofollow">The project itself is completely open-source.</a></p>

<p><a href="https://bitbucket.org/bmlt/nacc-ios-app/src/3025fc7f3589605f1e7ef28b4de392e83fcbc876/NACC-iOS/NACC_MainViewController.swift?at=master&amp;fileviewer=file-view-default#NACC_MainViewController.swift-34" rel="nofollow">This is where this issue manifests</a> (I have other bugs, but I'll get around to fixing them after I nail this one).</p>

<p>I'm sure that I am doing something obvious and boneheaded (usually the case).</p>

<p>Anyone have any ideas?</p>