Got rid of UIntMax.

This commit is contained in:
Pietro Gagliardi 2015-08-07 16:27:03 -04:00
parent ad895a7f7e
commit 10914816ff
2 changed files with 7 additions and 10 deletions

View File

@ -78,9 +78,9 @@ class tBox : tControl {
func actualLayoutWork() -> Bool {
var orientation: NSLayoutConstraintOrientation
// TODO don't use UIntMax
var i, n: UIntMax
var nStretchy: UIntMax
// TODO don't use Int
var i, n: Int
var nStretchy: Int
self.v.removeConstraints(self.v.constraints)
@ -128,9 +128,7 @@ class tBox : tControl {
constraint += "-"
}
constraint += "[" + tAutoLayoutKey(i)
// TODO swift currently can't do self.children[i].stretchy
var child = self.children[Int(i)]
if child.stretchy {
if self.children[i].stretchy {
if firstStretchy {
firstStretchy = false
nStretchy = i
@ -138,7 +136,7 @@ class tBox : tControl {
constraint += "(==" + tAutoLayoutKey(nStretchy) + ")"
}
} else {
constraint += predicates[Int(i)]
constraint += predicates[i]
}
constraint += "]"
}

View File

@ -19,12 +19,11 @@ protocol tControl : class {
func tRelayout()
}
func tAutoLayoutKey(n: UIntMax) -> String {
return NSString(format: "view%d", n) as String
func tAutoLayoutKey(n: Int) -> String {
return "view\(n)"
}
func mkconstraints(constraint: String, views: [String: NSView]) -> [AnyObject] {
println("making constraint \(constraint)")
return NSLayoutConstraint.constraintsWithVisualFormat(
constraint,
options: NSLayoutFormatOptions(0),