Created
April 26, 2016 08:36
-
-
Save yvettecook/6bace2a0b325646bb523b989abc965e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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