Skip to content

Instantly share code, notes, and snippets.

@tomekc
Created October 11, 2015 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomekc/f211fca2f4d4425b7aa4 to your computer and use it in GitHub Desktop.
Save tomekc/f211fca2f4d4425b7aa4 to your computer and use it in GitHub Desktop.
//: 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