Skip to content

Instantly share code, notes, and snippets.

@secwang
Created July 24, 2016 08:15
Show Gist options
  • Select an option

  • Save secwang/cd0ddab759ac5cf9c5e69c7955ad84dd to your computer and use it in GitHub Desktop.

Select an option

Save secwang/cd0ddab759ac5cf9c5e69c7955ad84dd to your computer and use it in GitHub Desktop.
test in PlayGround
//: Playground - noun: a place where people can play
import Cocoa
import XCPlayground
var str = "Hello, playground"
var scrollView = NSScrollView(frame: CGRectMake(0,0,80,100))
scrollView.backgroundColor = NSColor.controlColor()
var v = NSView(frame: CGRectMake(0,0,100,100))
var t1 = NSTextField(frame: CGRectMake(0,0,50,50))
t1.textColor = NSColor.blackColor()
t1.stringValue = "test"
v.addSubview(t1)
scrollView.addSubview(v)
XCPlaygroundPage.currentPage.liveView = scrollView;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment