Questions tagged [uikit-dynamics]

UIKit Dynamics is a feature introduced in iOS 7 that enables dynamic behaviors, which offers a way to enhance the user experience by incorporating real-world behaviors and characteristics, such as gravity, into your animations.

UIKit Dynamics is "a composable, reusable, declarative, real-world inspired animation, and interaction system" (as described in WWDC 2013 video, Getting Started with UIKit Dynamics).

Any object that conforms to the UIDynamicItem protocol, such as UIView objects, can be associated with "behaviors" that can be added to a dynamic animator, a UIDynamicAnimator. These behaviors include forces, elasticity, gravity, collisions, etc.

The types of behavior objects which can be added to the UIDynamicAnimator object include UIAttachmentBehavior, UICollisionBehavior, UIDynamicItemBehavior, UIGravityBehavior, UIPushBehavior, and UISnapBehavior. You can also combine these behaviors together or create your own custom dynamic behaviors.

UIKit Dynamics is not designed to replace Core Animation or UIView animations, but is designed to offer another mechanism to easily create more interactive and dynamic animations with less code. Likewise, UIKit Dynamics is not intended to replace SpriteKit, which might be better suited for many games.

Resources:

Related tags:

203 questions
29
votes
3 answers

Implement UIKitDynamics for dragging view off screen

I'm trying to figure out implement UIKit Dynamics that are similar to those in Jelly's app (specifically swiping down to drag view off-screen). See the animation: http://vimeo.com/83478484 (@1:17) I understand how UIKit Dynamics work, but don't have…
Matt
  • 1,359
  • 18
  • 22
28
votes
2 answers

UIKit Dynamics on a UITableView

Can you add the springy cells effect when scrolling (like in the Messages app on iOS7) to an UITableView? I've seen examples of it working on an UICollectionView, but absolutely nothing for table views. Is it just not possible and I should change…
drix
  • 283
  • 3
  • 7
19
votes
6 answers

Limiting vertical movement of UIAttachmentBehavior inside a UICollectionView

I have a horizontal UICollectionView with a custom UICollectionViewFlowLayout that has a UIAttachmentBehavior set on each cell to give it a bouncy feel when scrolling left and right. The behavior has the following…
Hesham
  • 5,294
  • 3
  • 34
  • 48
18
votes
1 answer

UICollisionBehavior - views pass through boundaries

As part of implementing a UICollisionBehaviour I set up boundaries for the screen edge. I then added some views and finally attached a UIPanGestureRecognizer to one of them. Now I can push around the smaller views with my draggable…
RickiG
  • 11,380
  • 13
  • 81
  • 120
15
votes
3 answers

How to replicate Messages bouncing bubbles in iOS 7

When you are in a conversation within the Messages app in iOS 7, if you scroll up or down you will notice that the bubbles and more so the text saying when the messages were sent, will bounce into place. I am trying to replicate this in my own table…
kdbdallas
  • 4,513
  • 10
  • 38
  • 53
14
votes
2 answers

UICollectionView self-sizing-cell on iOS 8 will crash with UIDynamic flowLayout and repeating call to _updateVisibleCellsNow

I am trying to use the so called "self sizing cell" which means: set estimatedItemSize on flowLayout overide preferredLayoutAttributesFittingAttributes in cell class Such as this: UICollectionView Self Sizing Cells with Auto Layout And I need…
13
votes
0 answers

Replicating iOS7 Messages App UIKitDynamics with CollectionView

I know there are lots and lots of tutorials and discussions out there on how to implement a bouncy collectionViewLayout using UIKitDynamics. There is even a WWDC 13 Session video addressing the exact topic of replicating the "message bubbles" in the…
11
votes
3 answers

Apple Music genre selection screen

Does anybody have an idea how the genre selection bubbles in Apple music were made? The movement seems to be done with UiKit Dynamics. I definitely see collision behaviors but can't seem to reproduce the fluidity of the drag movement and the gravity…
Dănuț Mihai Florian
  • 3,075
  • 3
  • 26
  • 44
11
votes
3 answers

How can I tell when a UIDynamicAnimator is at rest?

I'm playing with UIKitDynamics, and it's really neat. Currently I have this code: CGPoint center = [newSelectedLabel center]; [self.animator removeBehavior:self.snapBehavior]; self.snapBehavior = [[UISnapBehavior alloc]…
Undo
  • 25,519
  • 37
  • 106
  • 129
11
votes
1 answer

Autolayout, UIDynamics and animations

I'm pretty new to auto layout and I'm confused about how to animate views. I read a lot, and I know you must hold to the constraints, edit it, and wrap the layoutIfNeeded in an UIView animation block. But when it comes to do it, I'm a little lost.…
DCMaxxx
  • 2,534
  • 2
  • 25
  • 46
11
votes
1 answer

Using [UICollectionView performBatchUpdates:] with a UICollectionViewFlowLayout that has UIDynamics

Okay so basic overview. I have a UICollectionView that I needs to support adding and removing item through the performBatchUpdates: method. If I use a standard UICollectionViewFlowLayout, it works fine. However, when I try to use a…
10
votes
1 answer

UIKit dynamic behavior pan with attachment not continuing collision behavior?

How do I have collision detection occur on the pan of a UIDynamicItem? Background: I'm generating 20 labels randomly from a set of colors/strings (this part is not essential to the question), and then adding them to the main view with a random…
BHendricks
  • 4,423
  • 6
  • 32
  • 59
9
votes
3 answers

UIKit Dynamics UICollisionBehavior collision without bounce

I have a view whose boundaries are set up for collisions (setTranslatesReferenceBoundsIntoBoundaryWithInsets) and a subview setup with gravity so that it can collide against the superview bounds. I'm trying to make the collision 0% bouncy, but I…
9
votes
3 answers

UIDynamicAnimator refuses to reach equilibrium when a UIGravityBehavior is active

I'm working on code for an expandable tray view that uses UIDynamicAnimator to achieve a nice expand/contract animation. To achieve a realistic acceleration I use UIGravityBehavior to make my tray fall, until the "tab" of the tray hits the bottom of…
Nailer
  • 2,446
  • 1
  • 24
  • 34
9
votes
2 answers

Slow down UISnapBehavior

I am using a UISnapBehavior but it is snapping too quickly for my liking. Is there a way to slow it down? Or in other words: is there a way to adjust the elasticity of the object with the point where it should snap to?
drewag
  • 93,393
  • 28
  • 139
  • 128
1
2 3
13 14