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

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
sp71 committed Oct 19, 2017
1 parent 586fb4d commit f17307c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Example/SnapLayout_ExampleTests/SnapLayoutTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ class SnapLayoutTests: BaseTestCase {
let snapManagerDefaultPriority = childView.snapHeight(to: childView2, multiplier: 0.5)
XCTAssertEqual(snapManagerDefaultPriority.height!.priority, LayoutPriorityRequired)

let snapManagerHighPriority = childView.snapWidth(to: childView2, priority: UILayoutPriorityDefaultHigh)
XCTAssertEqual(snapManagerHighPriority.width!.priority, UILayoutPriorityDefaultHigh)
let snapManagerHighPriority = childView.snapWidth(to: childView2, priority: .defaultHigh)
XCTAssertEqual(snapManagerHighPriority.width!.priority, .defaultHigh)

let snapManagerLowPriority = childView.snap(top: 100, priority: UILayoutPriorityDefaultLow)
XCTAssertEqual(snapManagerLowPriority.top!.priority, UILayoutPriorityDefaultLow)
let snapManagerLowPriority = childView.snap(top: 100, priority: .defaultLow)
XCTAssertEqual(snapManagerLowPriority.top!.priority, .defaultLow)
}

}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ button.snap(config: config)
SnapLayout assumes required priority (same default as Apple) unless otherwise specified for those created constraints.

```swift
button1.snap(trailingView: button2, constant: 8, priority: UILayoutPriorityDefaultLow)
button1.snap(trailingView: button2, constant: 8, priority: .low)
```

In the following example, the top, leading, bottom, and trailing constraint all have a priority of required; however, the height constraint has a `UILayoutPriorityDefaultHigh` priority. That's it!
In the following example, the top, leading, bottom, and trailing constraint all have a priority of required; however, the height constraint has a `UILayoutPriority.defaultHigh` priority. That's it!

```swift
rectangleView.snap(top: 48, leading: 16, bottom: 16, trailing: 16)
.snap(height: 40, priority: UILayoutPriorityDefaultHigh)
.snap(height: 40, priority: .defaultHigh)
```

### To Activate or not to Activate
Expand Down

0 comments on commit f17307c

Please sign in to comment.