Skip to content

Commit

Permalink
Converted the latest changes from master to Swift 3
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelcruzeiro committed Sep 1, 2016
1 parent 48da9de commit bceb091
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Cartography/Compound.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public protocol RelativeCompoundInequality : Compound { }
///

public func >= <P: RelativeEquality>(lhs: P, rhs: LayoutSupport) -> NSLayoutConstraint {
return lhs.context.addConstraint(lhs, to: rhs, relation: NSLayoutRelation.GreaterThanOrEqual)
return lhs.context.addConstraint(lhs, to: rhs, relation: NSLayoutRelation.greaterThanOrEqual)
}

/// Declares a property less than or equal to a layout support.
Expand All @@ -146,7 +146,7 @@ public protocol RelativeCompoundInequality : Compound { }
///

public func <= <P: RelativeEquality>(lhs: P, rhs: LayoutSupport) -> NSLayoutConstraint {
return lhs.context.addConstraint(lhs, to: rhs, relation: NSLayoutRelation.LessThanOrEqual)
return lhs.context.addConstraint(lhs, to: rhs, relation: NSLayoutRelation.lessThanOrEqual)
}

/// Declares a property greater than or equal to the result of a layout support expression.
Expand All @@ -159,7 +159,7 @@ public protocol RelativeCompoundInequality : Compound { }
///

public func >= <P: RelativeEquality>(lhs: P, rhs: Expression<LayoutSupport>) -> NSLayoutConstraint {
return lhs.context.addConstraint(lhs, to: rhs.value, coefficients: rhs.coefficients[0], relation: NSLayoutRelation.GreaterThanOrEqual)
return lhs.context.addConstraint(lhs, to: rhs.value, coefficients: rhs.coefficients[0], relation: NSLayoutRelation.greaterThanOrEqual)
}

/// Declares a property less than or equal to the result of a layout support expression.
Expand All @@ -172,7 +172,7 @@ public protocol RelativeCompoundInequality : Compound { }
///

public func <= <P: RelativeEquality>(lhs: P, rhs: Expression<LayoutSupport>) -> NSLayoutConstraint {
return lhs.context.addConstraint(lhs, to: rhs.value, coefficients: rhs.coefficients[0], relation: NSLayoutRelation.LessThanOrEqual)
return lhs.context.addConstraint(lhs, to: rhs.value, coefficients: rhs.coefficients[0], relation: NSLayoutRelation.lessThanOrEqual)
}

#endif
12 changes: 6 additions & 6 deletions Cartography/Constrain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Foundation
/// replaced.
/// - parameter block: A block that declares the layout for `view`.
///
@discardableResult public func constrain(_ view: View, replace group: ConstraintGroup = ConstraintGroup(), block: @noescape (LayoutProxy) -> ()) -> ConstraintGroup {
@discardableResult public func constrain(_ view: View, replace group: ConstraintGroup = ConstraintGroup(), block: (LayoutProxy) -> ()) -> ConstraintGroup {
let context = Context()
block(LayoutProxy(context, view))
group.replaceConstraints(context.constraints)
Expand All @@ -31,7 +31,7 @@ import Foundation
/// replaced.
/// - parameter block: A block that declares the layout for the views.
///
@discardableResult public func constrain(_ view1: View, _ view2: View, replace group: ConstraintGroup = ConstraintGroup(), block: @noescape (LayoutProxy, LayoutProxy) -> ()) -> ConstraintGroup {
@discardableResult public func constrain(_ view1: View, _ view2: View, replace group: ConstraintGroup = ConstraintGroup(), block: (LayoutProxy, LayoutProxy) -> ()) -> ConstraintGroup {
let context = Context()
block(LayoutProxy(context, view1), LayoutProxy(context, view2))
group.replaceConstraints(context.constraints)
Expand All @@ -48,7 +48,7 @@ import Foundation
/// replaced.
/// - parameter block: A block that declares the layout for the views.
///
@discardableResult public func constrain(_ view1: View, _ view2: View, _ view3: View, replace group: ConstraintGroup = ConstraintGroup(), block: @noescape (LayoutProxy, LayoutProxy, LayoutProxy) -> ()) -> ConstraintGroup {
@discardableResult public func constrain(_ view1: View, _ view2: View, _ view3: View, replace group: ConstraintGroup = ConstraintGroup(), block: (LayoutProxy, LayoutProxy, LayoutProxy) -> ()) -> ConstraintGroup {
let context = Context()
block(LayoutProxy(context, view1), LayoutProxy(context, view2), LayoutProxy(context, view3))
group.replaceConstraints(context.constraints)
Expand All @@ -66,7 +66,7 @@ import Foundation
/// replaced.
/// - parameter block: A block that declares the layout for the views.
///
@discardableResult public func constrain(_ view1: View, _ view2: View, _ view3: View, _ view4: View, replace group: ConstraintGroup = ConstraintGroup(), block: @noescape (LayoutProxy, LayoutProxy, LayoutProxy, LayoutProxy) -> ()) -> ConstraintGroup {
@discardableResult public func constrain(_ view1: View, _ view2: View, _ view3: View, _ view4: View, replace group: ConstraintGroup = ConstraintGroup(), block: (LayoutProxy, LayoutProxy, LayoutProxy, LayoutProxy) -> ()) -> ConstraintGroup {
let context = Context()
block(LayoutProxy(context, view1), LayoutProxy(context, view2), LayoutProxy(context, view3), LayoutProxy(context, view4))
group.replaceConstraints(context.constraints)
Expand All @@ -85,7 +85,7 @@ import Foundation
/// replaced.
/// - parameter block: A block that declares the layout for the views.
///
@discardableResult public func constrain(_ view1: View, _ view2: View, _ view3: View, _ view4: View, _ view5: View, replace group: ConstraintGroup = ConstraintGroup(), block: @noescape (LayoutProxy, LayoutProxy, LayoutProxy, LayoutProxy, LayoutProxy) -> ()) -> ConstraintGroup {
@discardableResult public func constrain(_ view1: View, _ view2: View, _ view3: View, _ view4: View, _ view5: View, replace group: ConstraintGroup = ConstraintGroup(), block: (LayoutProxy, LayoutProxy, LayoutProxy, LayoutProxy, LayoutProxy) -> ()) -> ConstraintGroup {
let context = Context()
block(LayoutProxy(context, view1), LayoutProxy(context, view2), LayoutProxy(context, view3), LayoutProxy(context, view4), LayoutProxy(context, view5))
group.replaceConstraints(context.constraints)
Expand All @@ -100,7 +100,7 @@ import Foundation
/// replaced.
/// - parameter block: A block that declares the layout for `views`.
///
@discardableResult public func constrain(_ views: [View], replace group: ConstraintGroup = ConstraintGroup(), block: @noescape ([LayoutProxy]) -> ()) -> ConstraintGroup {
@discardableResult public func constrain(_ views: [View], replace group: ConstraintGroup = ConstraintGroup(), block: ([LayoutProxy]) -> ()) -> ConstraintGroup {
let context = Context()
block(views.map({ LayoutProxy(context, $0) }))
group.replaceConstraints(context.constraints)
Expand Down
4 changes: 2 additions & 2 deletions Cartography/LayoutSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import Foundation

public var topLayoutGuideCartography : LayoutSupport {
get {
return LayoutSupport(layoutGuide: self.topLayoutGuide, attribute: .Bottom)
return LayoutSupport(layoutGuide: self.topLayoutGuide, attribute: .bottom)
}
}

public var bottomLayoutGuideCartography : LayoutSupport {
get {
return LayoutSupport(layoutGuide: self.bottomLayoutGuide, attribute: .Top)
return LayoutSupport(layoutGuide: self.bottomLayoutGuide, attribute: .top)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Cartography/Priority.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import AppKit
public typealias LayoutPriority = NSLayoutPriority
#endif

infix operator ~ { }
infix operator ~

/// Sets the priority for a constraint.
///
Expand Down

0 comments on commit bceb091

Please sign in to comment.