Last active
December 23, 2016 08:59
-
-
Save andresbrun/2accf5751eccb1b4cdcde0d3275ec2dc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class BallView: UIImageView { | |
init(size: CGFloat) { | |
super.init(frame: CGRect(origin: .zero, size: CGSize(width: size, height: size))) | |
image = UIImage(named: "basketball-png-0") | |
contentMode = .scaleToFill | |
layer.cornerRadius = size * 0.5 | |
} | |
required init?(coder aDecoder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
override var collisionBoundsType: UIDynamicItemCollisionBoundsType { | |
return .ellipse | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment