Autolayout Fundamental

Setting the frame of a view:-

Refer apple doc for more on autoresizing mask

Autoresizing in IB

Positioning a view with AutoLayout:-

Autolayout in IB

Autolayout workFlow:-

What is Constrains?

image taken from apple doc.

Intrinsic Content Size:-

Intrinsic content size for common controls. referred from: apple document.

How Autolayout represent view’s intrinsic content size?

Button compression resistance with 750 priority and button width with 1000 priority
Button compression resistance with 1000 priority and button width with 750 priority

Intrinsic Content Size Versus Fitting Size:-

How do we implement Auto-Layout?

adding constraints in IB/Storyboard
CHCR and constraints added to button

TranslatesAutoresizingMaskIntoConstraints:-

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store