diff --git a/redo/osxaltest/box.swift b/redo/osxaltest/box.swift index 0d1ae063..89425df2 100644 --- a/redo/osxaltest/box.swift +++ b/redo/osxaltest/box.swift @@ -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 += "]" } diff --git a/redo/osxaltest/control.swift b/redo/osxaltest/control.swift index bb9bd370..accbff82 100644 --- a/redo/osxaltest/control.swift +++ b/redo/osxaltest/control.swift @@ -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),