UIScrollView

UIScrollView.playground is an starting point to experiment with UIScrollView in an interactive playground. It demonstrates how to use UIScrollView to create scrollable views with content views that are larger than the visible area:

UIView

import UIKit
import PlaygroundSupport

class ScrollingViewController : UIViewController {

    override func loadView() {

        let contentView = UIView(frame: CGRect(x: 0, y: 0, width: 5000, height: 5000))
        contentView.backgroundColor = .green

        let scrollView = UIScrollView()
        scrollView.contentSize = contentView.frame.size
        scrollView.addSubview(contentView)
        scrollView.flashScrollIndicators()
        scrollView.backgroundColor = .white

        self.view = scrollView
    }
    
}

PlaygroundPage.current.liveView = ScrollingViewController()
iOS Training Schulung Workshop
Nächste iOS-Schulung:
24. – 28. Juni 2019
Frankfurt am Main
iOS Buch
iOS 12-Apps entwickeln mit Swift & Xcode 10