Skip to content

Commit bb21c1c

Browse files
author
Florian Krüger
committed
Merge branch 'release/3.0.3'
2 parents 5594f60 + edd7692 commit bb21c1c

8 files changed

Lines changed: 42 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## Version 3.0.3
4+
5+
- [x] Podspec fixed (I missed the last release in Cocoapods)
6+
- [x] Constraints on a view that relate to the view itself were previously created on the superview.
7+
This is now fixed, the constraints are created on the view itself which makes the
8+
9+
## Version 3.0.2
10+
11+
- [x] Swift 3.1 / Xcode 8.3 compatibility
12+
313
## Version 3.0.1
414

515
- [x] Swift 3.0.1 / Xcode 8.1 compatibility

Manuscript-Example/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>3.0.2</string>
18+
<string>3.0.3</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Manuscript-iOSTests/TargetViewTests.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@ class TargetViewTests: XCTestCase {
5959
XCTAssertEqual(parentView.constraints.count, 1, "")
6060
XCTAssertEqual(parentView, layoutItem!.targetItem, "")
6161
}
62+
63+
func testCreatedRelatedConstraintOnTheItemItselfWhenItsTheSame() {
64+
let view = UIView(frame: .zero)
65+
66+
var layoutItem: LayoutItem? = nil
67+
68+
Manuscript.layout(view) { c in
69+
layoutItem = c.make(.height, equalTo: view, s: .width)
70+
}
71+
72+
XCTAssertEqual(view.constraints.count, 1)
73+
XCTAssertEqual(view, layoutItem!.targetItem)
74+
}
6275

6376
func testCreatedRelatedConstraintOnTheParentItemWhenUsingMake() {
6477
let parentView = UIView(frame: CGRect.zero)

Manuscript.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Manuscript"
3-
s.version = "3.0.1"
3+
s.version = "3.0.3"
44
s.summary = "AutoLayoutKit in pure Swift."
55
s.description = <<-DESC
66
It's like AutoLayoutKit but written in Swift. For pure Swift projects. And it's super simple.

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
[![CocoaPods](https://img.shields.io/cocoapods/v/Manuscript.svg)](https://github.com/floriankrueger/Manuscript)
55
[![Swift](https://img.shields.io/badge/Swift-3.0-orange.svg)](https://swift.org)
66
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/floriankrueger/Manuscript/master/LICENSE)
7-
7+
[![Gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square)](https://gitmoji.carloscuesta.me)
8+
89
![Manuscript: Dead-Simple AutoLayout](https://raw.githubusercontent.com/floriankrueger/Manuscript/assets/manuscript.png)
910

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

2526
- iOS 8.0+
2627
- Xcode 8.x
27-
- Swift 3
28+
- Swift 3.1
2829

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

@@ -189,8 +190,14 @@ If you need to support Swift 2.3 then please use the last compatible version 2.1
189190
```ogdl
190191
github "floriankrueger/Manuscript" == 2.1.0
191192
```
193+
194+
If you need to support Swift 3.0 then please use the last compatible version 3.0.1
195+
196+
```ogdl
197+
github "floriankrueger/Manuscript" == 3.0.1
198+
```
192199

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

196203
```

Sources/Info-iOS.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>3.0.2</string>
18+
<string>3.0.3</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Sources/Info-tvOS.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>3.0.2</string>
18+
<string>3.0.3</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Sources/Manuscript.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,12 @@ public struct Manuscript {
7070
if let b = b {
7171

7272
// Quick-check the most likely possibilities
73+
74+
if a === b { return a } // (a) and (b) are actually the same view
75+
7376
let (aSuper, bSuper) = (a.superview, b.superview)
74-
if a == bSuper { return a }
75-
if b == aSuper { return b }
77+
if a == bSuper { return a } // (a) is the superview of (b)
78+
if b == aSuper { return b } // (b) is the superview of (a)
7679
if aSuper == bSuper { return aSuper }
7780

7881
// None of those; run the general algorithm

0 commit comments

Comments
 (0)