LoginSignup
8
7

More than 5 years have passed since last update.

UIViewアニメーションをPlaygroundで検証する

Posted at

import UIKit
import XCPlayground

let view = UIView(frame: CGRect(x: 0, y: 0, width: 320, height: 580))
view.backgroundColor = UIColor.whiteColor()
XCPShowView("preview", view: view)

let v = UIView(frame: CGRect(x: 0,y: 0,width: 44,height: 44))
v.backgroundColor = UIColor.redColor()
view.addSubview(v)

UIView.animateWithDuration(0.5) { () -> Void in
  v.center = view.center
}

XCPlaygroundをインポートするとXCPShowViewで指定したUIViewのアニメーションを検証出来る

スクリーンショット 2016-03-11 12.39.44.png

8
7
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7