ODENZA

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

Problem:

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

Solved:

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) {
addChild(childView)…

--

--