Skip to content

Instantly share code, notes, and snippets.

Created October 21, 2015 06:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Adding UICollisionBehavior
lazy var collider:UICollisionBehavior = {
let lazyCollider = UICollisionBehavior()
// This line, makes the boundries of our reference view a boundary
// for the added items to collide with.
lazyCollider.translatesReferenceBoundsIntoBoundary = true
return lazyCollider
// This is how our animate function will look like
func animateSquare(){
// Add the collider also to the animator
// Add the squareView to both behaviors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment