Skip to content

Commit eef9ef6

Browse files
committed
Update to Swift 4.2
1 parent 90f7c78 commit eef9ef6

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ Swiftly is available through [Carthage](Swiftly/Swiftly.swift). To install
3333
it, simply add the following line to your Cartfile:
3434

3535
```ogdl
36-
github "Imperiopolis/Swiftly" ~> 1.0
36+
github "Imperiopolis/Swiftly" ~> 2.0
3737
```
3838

3939
### Swift Version
4040

41-
Swiftly 1.0 and later require Swift 3.0. For older versions of Swift, please use the Swiftly 0.1.0 build.
41+
Swiftly 2.0 and later require Swift 4.2. For older versions of Swift, please use the Swiftly 1.0 build.
4242

4343
## Custom Operators
4444

@@ -82,7 +82,7 @@ __Note:__ Any view which has `applyLayout` called on it will automatically set `
8282

8383
## Documentation
8484

85-
Read the documentation [here](http://cocoadocs.org/docsets/Grapher).
85+
Read the documentation [here](http://cocoadocs.org/docsets/Swiftly).
8686

8787
## About Swiftly
8888

Swiftly.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Swiftly"
3-
s.version = "1.0.0"
3+
s.version = "2.0.0"
44
s.summary = "Swiftly generate Auto Layout constraints."
55
s.description = <<-DESC
66
Swiftly generate Auto Layout constraints and interact with them with all of Apple's built in functions.
@@ -11,7 +11,7 @@ Swiftly generate Auto Layout constraints and interact with them with all of Appl
1111
s.source = { :git => "https://github.com/imperiopolis/Swiftly.git", :tag => s.version.to_s }
1212
s.social_media_url = 'https://twitter.com/imperiopolis'
1313

14-
s.platform = :ios, '8.0'
14+
s.platform = :ios, '10.0'
1515
s.requires_arc = true
1616

1717
s.source_files = 'Swiftly/*.swift'

Swiftly.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257
PRODUCT_NAME = "$(TARGET_NAME)";
258258
SKIP_INSTALL = YES;
259259
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
260-
SWIFT_VERSION = 3.0;
260+
SWIFT_VERSION = 4.2;
261261
};
262262
name = Debug;
263263
};
@@ -276,7 +276,7 @@
276276
PRODUCT_BUNDLE_IDENTIFIER = com.trappdesign.Swiftly;
277277
PRODUCT_NAME = "$(TARGET_NAME)";
278278
SKIP_INSTALL = YES;
279-
SWIFT_VERSION = 3.0;
279+
SWIFT_VERSION = 4.2;
280280
};
281281
name = Release;
282282
};

Swiftly/Swiftly.swift

+11-11
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public extension Swiftlyable {
4444
}
4545

4646
let constraints = layoutArray.flatMap { l -> [NSLayoutConstraint] in
47-
let attributes: [NSLayoutAttribute]
47+
let attributes: [NSLayoutConstraint.Attribute]
4848
if let attrs = l.attributes {
4949
attributes = attrs
5050
} else if let attr = l.attribute {
@@ -53,7 +53,7 @@ public extension Swiftlyable {
5353
fatalError("You must define an attribute.")
5454
}
5555

56-
let otherAttributes: [NSLayoutAttribute]
56+
let otherAttributes: [NSLayoutConstraint.Attribute]
5757
if let otherAttrs = l.otherAttributes {
5858
otherAttributes = otherAttrs
5959
} else if let otherAttr = l.otherAttribute {
@@ -668,17 +668,17 @@ public struct Swiftly {
668668
return Swiftly(.centerYWithinMargins)
669669
}
670670

671-
let attribute: NSLayoutAttribute?
672-
let attributes: [NSLayoutAttribute]?
673-
var relatedBy: NSLayoutRelation?
674-
var otherAttribute: NSLayoutAttribute?
675-
var otherAttributes: [NSLayoutAttribute]?
671+
let attribute: NSLayoutConstraint.Attribute?
672+
let attributes: [NSLayoutConstraint.Attribute]?
673+
var relatedBy: NSLayoutConstraint.Relation?
674+
var otherAttribute: NSLayoutConstraint.Attribute?
675+
var otherAttributes: [NSLayoutConstraint.Attribute]?
676676
var multiplier: CGFloat
677677
var constant: CGFloat
678678
var toItem: Swiftlyable?
679679
var priority: UILayoutPriority?
680680

681-
init(_ a: NSLayoutAttribute? = nil, attributes atts: [NSLayoutAttribute]? = nil, relatedBy r: NSLayoutRelation? = .equal, toItem ti: Swiftlyable? = nil, otherAttribute oa: NSLayoutAttribute? = nil, otherAttributes otherAtts: [NSLayoutAttribute]? = nil, multiplier m: CGFloat = 1, constant c: CGFloat = 0) {
681+
init(_ a: NSLayoutConstraint.Attribute? = nil, attributes atts: [NSLayoutConstraint.Attribute]? = nil, relatedBy r: NSLayoutConstraint.Relation? = .equal, toItem ti: Swiftlyable? = nil, otherAttribute oa: NSLayoutConstraint.Attribute? = nil, otherAttributes otherAtts: [NSLayoutConstraint.Attribute]? = nil, multiplier m: CGFloat = 1, constant c: CGFloat = 0) {
682682
attribute = a
683683
attributes = atts
684684
relatedBy = r
@@ -719,7 +719,7 @@ public func ==(left: Swiftly, right: CGFloat) -> Swiftly {
719719
if left.attribute != nil {
720720
result.otherAttribute = .notAnAttribute
721721
} else if let attrsCount = left.attributes?.count {
722-
result.otherAttributes = [NSLayoutAttribute](repeating: .notAnAttribute, count: attrsCount)
722+
result.otherAttributes = [NSLayoutConstraint.Attribute](repeating: .notAnAttribute, count: attrsCount)
723723
}
724724

725725
return result
@@ -796,7 +796,7 @@ public func >=(left: Swiftly, right: CGFloat) -> Swiftly {
796796
if left.attribute != nil {
797797
result.otherAttribute = .notAnAttribute
798798
} else if let attrsCount = left.attributes?.count {
799-
result.otherAttributes = [NSLayoutAttribute](repeating: .notAnAttribute, count: attrsCount)
799+
result.otherAttributes = [NSLayoutConstraint.Attribute](repeating: .notAnAttribute, count: attrsCount)
800800
}
801801

802802
result.relatedBy = .greaterThanOrEqual
@@ -847,7 +847,7 @@ public func <=(left: Swiftly, right: CGFloat) -> Swiftly {
847847
if left.attribute != nil {
848848
result.otherAttribute = .notAnAttribute
849849
} else if let attrsCount = left.attributes?.count {
850-
result.otherAttributes = [NSLayoutAttribute](repeating: .notAnAttribute, count: attrsCount)
850+
result.otherAttributes = [NSLayoutConstraint.Attribute](repeating: .notAnAttribute, count: attrsCount)
851851
}
852852

853853
result.relatedBy = .lessThanOrEqual

0 commit comments

Comments
 (0)