April 2015
Intermediate to advanced
556 pages
17h 47m
English
Start a new Cocoa Application project and call it AutoLabelOut. Leave Document Based Application unchecked.
Open AppDelegate.swift and add the following code to applicationDidFinishLaunching(_:):
func applicationDidFinishLaunching(aNotification: NSNotification) {
// Insert code here to initialize your application
// Create the controls for the window:
// Create a label:
let label = NSTextField(frame: NSRect.zeroRect)
label.translatesAutoresizingMaskIntoConstraints = false
label.stringValue = "Label"
//Give this NSTextField the styling of a label:
label.backgroundColor = NSColor.clearColor()
label.editable = false
label.selectable = false
label.bezeled = false
// Create a text field:
let textField = NSTextField(frame: ...Read now
Unlock full access