Skip to content

Latest commit

 

History

History
127 lines (72 loc) · 5.51 KB

examples.md

File metadata and controls

127 lines (72 loc) · 5.51 KB

Examples

The PinLayout's Example exposes some usage example of PinLayout.

The Example App is available in the Example folder.

Running the Example app

  1. Do a pod install from the PinLayout root directory.
  2. Open the newly generated PinLayout.xcworkspace Xcode workspace.
  3. Select the PinLayoutSample target.
  4. Run the app on your device or simulator.

Intro Example

PinLayout introduction example presented in the README.

Source code

Relative Edges Layout Example

Example showing how to layout views relative to other views.

Source code

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.

Source code

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.

Source code

UICollectionView Example

Example using a UICollectionView with variable height cells.

Source code

Animations Example

Example showing how to animate views with PinLayout.

Source code

Right to left language support Example

This example show how PinLayout can support simultaneously Left to right and right to left languages.

Source code

pin.safeArea example

Example showing the usage of UIView.pin.safeArea] with UINavigationController and UITabViewController:

Source code

Also display the usage of pin.readableMargins and pin.layoutMargins:

Source code

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.

Source code

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.

Source code

Form Example

This example is a basic form containing 4 fields.

Source code

Auto Adjusting Size Example

This example show how fixed size views and expandable views can be layouted using PinLayout to fill the available space.

Source code

Automatic Sizing Example

This example show how to use Automatic Sizing (autoSizeThatFits()) to compute views size. Source code