Created
October 11, 2015 19:56
-
-
Save tomekc/f211fca2f4d4425b7aa4 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
//: Playground - noun: a place where people can play | |
// 1. Create new iOS playground | |
// 2. Paste this code | |
// 3. Enable timeline slider (on Utilities panel, alt+cmd+0 to show) | |
// 4. After letting the animation play, move the slider :) | |
import UIKit | |
import XCPlayground | |
var str = "Hello, playground" | |
let containerView = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 400, height: 200.0)) | |
XCPShowView("Container View", view: containerView) | |
containerView.backgroundColor = UIColor.whiteColor() | |
let klocek = UIView(frame: CGRect(x:0, y:0, width:40, height:40)) | |
klocek.backgroundColor = UIColor.redColor() | |
containerView.addSubview(klocek) | |
UIView.animateWithDuration(10) { () -> Void in | |
klocek.transform = CGAffineTransformMakeTranslation(100, 100) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment