examples.md
January 11, 2021 ยท View on GitHub
Examples
The PinLayout's Example exposes some usage example of PinLayout.
The Example App is available in the Example folder.
Running the Example app
- Do a
pod installfrom the PinLayout root directory. - Open the newly generated
PinLayout.xcworkspaceXcode workspace. - Select the
PinLayoutSampletarget. - Run the app on your device or simulator.
Intro Example
PinLayout introduction example presented in the README.
Relative Edges Layout Example
Example showing how to layout views relative to other views.
Between Example
Example showing how to use horizontallyBetween() to position a view between two other views.
Source code
UITableView Example
Example using a UITableView with variable height cells.
UITableView Example with cells using pin.readableMargins
Similar to the UITableView Example, but in this one cells use pin.readableMargins to layout their content inside the zone defined by UIView.readableContentGuide.
UICollectionView Example
Example using a UICollectionView with variable height cells.
Animations Example
Example showing how to animate views with PinLayout.
Right to left language support Example
This example show how PinLayout can support simultaneously Left to right and right to left languages.
pin.safeArea example
Example showing the usage of UIView.pin.safeArea] with UINavigationController and UITabViewController:
Also display the usage of pin.readableMargins and pin.layoutMargins:
Adjust To Container Example
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.
wrapContent Example
This example show how to use the wrapContent() method. This method is particularly useful to wrap a group of views and center them.
Form Example
This example is a basic form containing 4 fields.
Auto Adjusting Size Example
This example show how fixed size views and expandable views can be layouted using PinLayout to fill the available space.
Automatic Sizing Example
This example show how to use Automatic Sizing (autoSizeThatFits()) to compute views size.
Source code
