Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//: 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
You can’t perform that action at this time.