NSScreencast Episode #141 Simulating Rope with UIKit Dynamics
Simulating Rope with UIKit Dynamics - NSScreencast
ロープにぶら下がった物体のアニメーション
⌘Boom - Creating a rope with UIDynamics
- bang
- links.first!.center
- What does an exclamation mark mean in the Swift language? - Stack Overflow
- link 〔つながっている物の〕一つ
- if index == 0
- else
- let previousLink = links[index-1]
- else
- UIAttachmentBehavior
- UIDynamicAnimator
- UIGravityBehavior
- UICollisionBehavior
- animator.addBehavior(gravity)
- UIBezierPath
- override func drawRect(rect: CGRect)
- var path = UIBezierPath()
- path.lineCapStyle = kCGLineCapRound
- path.lineJoinStyle = kCGLineJoinRound
- path.lineWidth = segmentWidth
- path.moveToPoint(start)
- path.addLineToPoint(link.center)
- UIColor.blueColor().setStroke()
- path.stroke()