Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import UIKit
import XCPlayground
let containerView = UIView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
containerView.backgroundColor = UIColor.whiteColor()
let square = UIView(frame: CGRect(x: 50, y: 50, width: 100, height: 100))
square.backgroundColor = UIColor.blueColor()
containerView.addSubview(square)
UIView.animateWithDuration(2.0) {
square.backgroundColor = UIColor.redColor()
square.frame = CGRect(x: 200, y: 200, width: 50, height: 50)
}
XCPlaygroundPage.currentPage.liveView = containerView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment