Skip to content

Commit

Permalink
Merge branch 'release/3.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krüger committed Apr 7, 2017
2 parents 5594f60 + edd7692 commit bb21c1c
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 9 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Version 3.0.3

- [x] Podspec fixed (I missed the last release in Cocoapods)
- [x] Constraints on a view that relate to the view itself were previously created on the superview.
This is now fixed, the constraints are created on the view itself which makes the

## Version 3.0.2

- [x] Swift 3.1 / Xcode 8.3 compatibility

## Version 3.0.1

- [x] Swift 3.0.1 / Xcode 8.1 compatibility
Expand Down
2 changes: 1 addition & 1 deletion Manuscript-Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.0.2</string>
<string>3.0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
13 changes: 13 additions & 0 deletions Manuscript-iOSTests/TargetViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ class TargetViewTests: XCTestCase {
XCTAssertEqual(parentView.constraints.count, 1, "")
XCTAssertEqual(parentView, layoutItem!.targetItem, "")
}

func testCreatedRelatedConstraintOnTheItemItselfWhenItsTheSame() {
let view = UIView(frame: .zero)

var layoutItem: LayoutItem? = nil

Manuscript.layout(view) { c in
layoutItem = c.make(.height, equalTo: view, s: .width)
}

XCTAssertEqual(view.constraints.count, 1)
XCTAssertEqual(view, layoutItem!.targetItem)
}

func testCreatedRelatedConstraintOnTheParentItemWhenUsingMake() {
let parentView = UIView(frame: CGRect.zero)
Expand Down
2 changes: 1 addition & 1 deletion Manuscript.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Manuscript"
s.version = "3.0.1"
s.version = "3.0.3"
s.summary = "AutoLayoutKit in pure Swift."
s.description = <<-DESC
It's like AutoLayoutKit but written in Swift. For pure Swift projects. And it's super simple.
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
[![CocoaPods](https://img.shields.io/cocoapods/v/Manuscript.svg)](https://github.com/floriankrueger/Manuscript)
[![Swift](https://img.shields.io/badge/Swift-3.0-orange.svg)](https://swift.org)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/floriankrueger/Manuscript/master/LICENSE)

[![Gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square)](https://gitmoji.carloscuesta.me)

![Manuscript: Dead-Simple AutoLayout](https://raw.githubusercontent.com/floriankrueger/Manuscript/assets/manuscript.png)

It's like [AutoLayoutKit](https://github.com/floriankrueger/AutoLayoutKit) but written in Swift.
Expand All @@ -24,7 +25,7 @@ Have a look at the [Changelog](CHANGELOG.md) for more details.

- iOS 8.0+
- Xcode 8.x
- Swift 3
- Swift 3.1

### Bonus: Support for iOS 7.0+ and/or tvOS

Expand Down Expand Up @@ -189,8 +190,14 @@ If you need to support Swift 2.3 then please use the last compatible version 2.1
```ogdl
github "floriankrueger/Manuscript" == 2.1.0
```

If you need to support Swift 3.0 then please use the last compatible version 3.0.1

```ogdl
github "floriankrueger/Manuscript" == 3.0.1
```

If your Swift 3 compiler isn't compatible with the framework binary from the github release then
If your Swift 3.1 compiler isn't compatible with the framework binary from the github release then
please use the following command to build Manuscript yourself:

```
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info-iOS.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.0.2</string>
<string>3.0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info-tvOS.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.0.2</string>
<string>3.0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
7 changes: 5 additions & 2 deletions Sources/Manuscript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ public struct Manuscript {
if let b = b {

// Quick-check the most likely possibilities

if a === b { return a } // (a) and (b) are actually the same view

let (aSuper, bSuper) = (a.superview, b.superview)
if a == bSuper { return a }
if b == aSuper { return b }
if a == bSuper { return a } // (a) is the superview of (b)
if b == aSuper { return b } // (b) is the superview of (a)
if aSuper == bSuper { return aSuper }

// None of those; run the general algorithm
Expand Down

0 comments on commit bb21c1c

Please sign in to comment.