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 06a650a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 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
11 changes: 7 additions & 4 deletions SnapLayout.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@

Pod::Spec.new do |s|
s.name = 'SnapLayout'
s.version = '1.0.2'
s.version = '1.0.4'
s.summary = 'Concise API for iOS Auto Layout'

s.description = <<-DESC
# SnapLayout
Concise API for iOS Auto Layout. SnapLayout extends UIView to deliver a list of APIs to improve readability while
also shortening constraint code. Internally using AutoLayout to provide the best experience. With SnapLayout,
developers can pin, anchor, snap, or align views easily!
Concise API for iOS Auto Layout. SnapLayout extends `UIView` to deliver a list of APIs to improve
readability while also shortening constraint code. Internally uses AutoLayout to provide the best
experience. With SnapLayout, developers can remove boilerplate code but not at the cost of readability.
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`.
DESC

s.homepage = 'https://github.com/sp71/SnapLayout'
Expand Down

0 comments on commit 06a650a

Please sign in to comment.