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()
Btn training bbbdf557d2 Next iOS training: 25. Februar - 01. März 2019, Stuttgart
Btn about 5378472193 About me · Contact