center-vfl
center-vfl copied to clipboard
Not work on Mac
only get an empty window after applying the constraints. :(
Hi @cool8jay, thanks for reporting. I have managed to center a text field on OS X. First, I created the text field programmatically using the function below and then applied the same auto layout method as I did for iOS.
private func createLabel() -> NSTextField {
let label = NSTextField()
label.translatesAutoresizingMaskIntoConstraints = false
label.stringValue = "I am centered!"
label.backgroundColor = NSColor.yellowColor()
label.bezeled = false
label.editable = false
return label
}
Here is a demo OS X app.