Got rid of UIntMax.
This commit is contained in:
parent
ad895a7f7e
commit
10914816ff
|
@ -78,9 +78,9 @@ class tBox : tControl {
|
||||||
|
|
||||||
func actualLayoutWork() -> Bool {
|
func actualLayoutWork() -> Bool {
|
||||||
var orientation: NSLayoutConstraintOrientation
|
var orientation: NSLayoutConstraintOrientation
|
||||||
// TODO don't use UIntMax
|
// TODO don't use Int
|
||||||
var i, n: UIntMax
|
var i, n: Int
|
||||||
var nStretchy: UIntMax
|
var nStretchy: Int
|
||||||
|
|
||||||
self.v.removeConstraints(self.v.constraints)
|
self.v.removeConstraints(self.v.constraints)
|
||||||
|
|
||||||
|
@ -128,9 +128,7 @@ class tBox : tControl {
|
||||||
constraint += "-"
|
constraint += "-"
|
||||||
}
|
}
|
||||||
constraint += "[" + tAutoLayoutKey(i)
|
constraint += "[" + tAutoLayoutKey(i)
|
||||||
// TODO swift currently can't do self.children[i].stretchy
|
if self.children[i].stretchy {
|
||||||
var child = self.children[Int(i)]
|
|
||||||
if child.stretchy {
|
|
||||||
if firstStretchy {
|
if firstStretchy {
|
||||||
firstStretchy = false
|
firstStretchy = false
|
||||||
nStretchy = i
|
nStretchy = i
|
||||||
|
@ -138,7 +136,7 @@ class tBox : tControl {
|
||||||
constraint += "(==" + tAutoLayoutKey(nStretchy) + ")"
|
constraint += "(==" + tAutoLayoutKey(nStretchy) + ")"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
constraint += predicates[Int(i)]
|
constraint += predicates[i]
|
||||||
}
|
}
|
||||||
constraint += "]"
|
constraint += "]"
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,12 +19,11 @@ protocol tControl : class {
|
||||||
func tRelayout()
|
func tRelayout()
|
||||||
}
|
}
|
||||||
|
|
||||||
func tAutoLayoutKey(n: UIntMax) -> String {
|
func tAutoLayoutKey(n: Int) -> String {
|
||||||
return NSString(format: "view%d", n) as String
|
return "view\(n)"
|
||||||
}
|
}
|
||||||
|
|
||||||
func mkconstraints(constraint: String, views: [String: NSView]) -> [AnyObject] {
|
func mkconstraints(constraint: String, views: [String: NSView]) -> [AnyObject] {
|
||||||
println("making constraint \(constraint)")
|
|
||||||
return NSLayoutConstraint.constraintsWithVisualFormat(
|
return NSLayoutConstraint.constraintsWithVisualFormat(
|
||||||
constraint,
|
constraint,
|
||||||
options: NSLayoutFormatOptions(0),
|
options: NSLayoutFormatOptions(0),
|
||||||
|
|
Loading…
Reference in New Issue