Skip to content
This repository has been archived by the owner on Sep 15, 2019. It is now read-only.

Commit

Permalink
Udpated README
Browse files Browse the repository at this point in the history
  • Loading branch information
Satinder Singh committed Mar 24, 2017
1 parent 70bd4a6 commit 2fef115
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Concise API for iOS Auto Layout. SnapLayout extends `UIView` to deliver a list o
Imagine applying any or all of the following constraints in one line of code: top, leading, trailing, bottom, width, height, centerX, centerY. This is possible with `SnapLayout`.

### Table of Contents
1. [Setup](#setup)
* [Requirements](#requirements)
* [Installation](#installation)
2. [Usage](#usage)
* [Sample Code](#sample-Code)
* [Example App](#example-app)
1. [Setup](#setup)
* [Requirements](#requirements)
* [Installation](#installation)
1. [Usage](#usage)
* [Sample Code](#sample-code)
* [Example App](#example-app)

## Setup
### Requirements
Expand All @@ -36,15 +36,16 @@ it, simply add the following line to your Podfile:
pod "SnapLayout"
```

## Overview
SnapLayout offers many `UIView` extension methods available in the [source files](SnapLayout/SnapLayout/Classes/SnapLayout.swift).
## Usage

### Overview

* All methods are prefixed with `snap` for quick Xcode autocomplete.
* Directly uses NSLayoutAnchor under the hood so the API is developer friendly
* Any view using `SnapLayout` will not only have its `translatesAutoresizingMaskIntoConstraints` set to false, but also have its constraint activated.
* Any view using `SnapLayout` will not only have its `translatesAutoresizingMaskIntoConstraints` set to `false`, but also have its constraint activated.
* Amazing constraint situations such as snapping a button to the label on top of it is an effortless process now: `button.snapVertically(topView: label, constant: 8)`

## Usage

### [`UIView`](SnapLayout/Classes/SnapLayout.swift) extension methods
```swift
func snap(to view: UIView? = nil, top: CGFloat? = nil, leading: CGFloat? = nil, bottom: CGFloat? = nil, trailing: CGFloat? = nil, width: CGFloat? = nil, height: CGFloat? = nil, centerX: Bool? = nil, centerY: Bool? = nil)
Expand Down

0 comments on commit 2fef115

Please sign in to comment.