The PinLayout's Example exposes some usage example of PinLayout.
The Example App is available in the Example
folder.
- Do a
pod install
from the PinLayout root directory. - Open the newly generated
PinLayout.xcworkspace
Xcode workspace. - Select the
PinLayoutSample
target. - Run the app on your device or simulator.
PinLayout introduction example presented in the README.
Example showing how to layout views relative to other views.
Example showing how to use horizontallyBetween()
to position a view between two other views.
Source code
Example using a UITableView with variable height cells.
Similar to the UITableView Example, but in this one cells use pin.readableMargins
to layout their content inside the zone defined by UIView.readableContentGuide
.
Example using a UICollectionView with variable height cells.
Example showing how to animate views with PinLayout.
This example show how PinLayout can support simultaneously Left to right and right to left languages.
Example showing the usage of UIView.pin.safeArea
] with UINavigationController and UITabViewController:
Also display the usage of pin.readableMargins
and pin.layoutMargins
:
Example showing how PinLayout can be used to adjust the layout depending of the space available.
In this example the UISegmentedControl is shown below its label if the available width is smaller than 500 pixels, or on the same line as the label if the width is wider.
This example show how to use the wrapContent()
method. This method is particularly useful to wrap a group of views and center them.
This example is a basic form containing 4 fields.
This example show how fixed size views and expandable views can be layouted using PinLayout to fill the available space.
This example show how to use Automatic Sizing (autoSizeThatFits()
) to compute views size.
Source code