We will show you how to ignore safe area when using UIScrollView.


When we use UIScrollView, It can’t ignore safe area by default. or even you set the constraints of scrollView to the superView.


Set content inset by programmatically.

yourScrollView.contentInsetAdjustmentBehavior = .never

or set it in your storyboard



In this article, I would like to show you how to create extension for add your childView.

protocol Containable {
func add(childView: UIViewController, container: UIView)
func remove(childView: UIViewController)
extension Containable where Self: UIViewController {
func add(
childView: UIViewController,
container: UIView) {