This project demonstrates UIKit's layout margins in action.
Created by Marina Gornostaeva for Detail-oriented UI with Layout Margins talk @ NSSpain 2019.
Recording: Vimeo | Slides: SpeakerDeck
Layout margin propagation is a really powerful thing. Try it out yourself!
A simple gesture recognizer changes the frame of the red view, showing how margins change when the subview is positioned close to the edge of its parent.
This behaviour can be enabled by setting preservesSuperviewLayoutMargins
to true
on your views.
Requirements: Xcode 11, iOS 9.0+
-
WWDC 2018 Session UIKit: Apps for Every Size and Shape