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
0
votes
1 answer

Qt/C++ physics engine similar to iOS UIKit Dynamics

I was wondering if there are any tools for simulating physical movement for animations in Qt. I remember I once saw on iOS that one could drag a panel down faster and the panel would bounce on the bottom of the screen with an intensity…
Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
0
votes
0 answers

UIKit Dynamics + snap behavior + pan gesture = trembling of view

I try to build tinder like ui with swipeable cards. To make ui better I add snap behaviour to view, so it to return animated after swipe gesture. Problem is that during the gesture sometimes view trembls and blinks Captured the video, it can be seen…
Alexey K
  • 6,537
  • 18
  • 60
  • 118
0
votes
1 answer

UIKit Dynamic - snap view to center of parent view

I try to build tinder like interface and I want View to snap with bounces to center of parent view, when finger is released. I try to implement it with snap behavios and pan gesture recognizer, but insted I see animation of falling view down. My…
Alexey K
  • 6,537
  • 18
  • 60
  • 118
0
votes
2 answers

Generating interpolated values using an animation

I would like to (ab-)use Core Animation or even UIDynamics to generate animated values (floats) that I could use to control other parameters. E.g. Having an animation with an ease in, I would like to control a color with an 'eased' value.
brainray
  • 12,512
  • 11
  • 67
  • 116
0
votes
1 answer

App crashes when adding a subview to a dynamic item in Interface Builder

So I am using UI Kit Dynamics to create a slider which can be swiped out of the way to reveal what is behind it. I am using two UIFieldBehaviour's, an attachment behaviour attached to a UIPanGestureRecognizer, and UICollisionBehaviour to achieve…
0
votes
2 answers

Collision when bounds of a view are changing

I am working with UIDynamicAnimator, UICollisionBehavior and several moving UIImageView. It looks like this when everything is working fine. Pictures are moving on the screen without superposition. But after I changed the bounds of some views, the…
Tulleb
  • 8,919
  • 8
  • 27
  • 55
0
votes
1 answer

Objects stop moving - UIDynamics and Swift iOS

I am trying to add gravity to a group of buttons so they move around the screen when the device is tilted. The objects move and so long as the device is always in motion they keep moving, but once the device is still for at least 1 second, they stop…
0
votes
0 answers

pan gesture with UIAttachmentBehavior doesnt work well with subviews

I have a view with the following hierarchy: self.view (with animator) |-> self.view (centered) |-> (view with gravity+push+dynamic+collision+(attachment disabled) behaviors) |-> (view with gravity+push+dynamic+collision+(attachment…
RicardoDuarte
  • 728
  • 7
  • 23
0
votes
1 answer

Trying to get UIView to bounce using UIKit Dynamics

I am trying to get a UIView that is in the shape of a circle to "bounce" using UIKit Dynamics. It is supposed to bounce when it reaches the bottom of the screen. The circle is a standard UIView that I create in the viewDidLoad method as follows: -…
syedfa
  • 2,801
  • 1
  • 41
  • 74
0
votes
0 answers

UIscrollView, Autolayout and UIDynamicAnimator - Views flash

I have a scrollView with two views in it. I want them to have gravity attached to them animator = UIDynamicAnimator(referenceView: scrollView) createViews() var gravity : UIGravityBehavior = UIGravityBehavior(items: [view]) …
BooRanger
  • 1,516
  • 1
  • 14
  • 18
0
votes
1 answer

adding UIKit Dynamics to a custom UICollectionViewFlowLayout. dynamicAnimator seems to use default layout

I am trying to add UIDynamics to a custom UICollectionViewFlowLayout I want the dynamicAnimator to animate every cell when scrolling. They should behave in a more realistic manner and just like the iMessage bubbles do. They seem to react to the…
0
votes
1 answer

UIKit dynamics slowing gravity

I'm using UIKit dynamics to create a falling object and i was wondering if i could actually slow the gravity to make the ball fall slower on command. For example, the object will be falling, I press a button, then the ball falls slower. How would i…
0
votes
1 answer

Core Animation + UIDynamics + arc4random()

I have a single UFO that is an UIImage and I simply want it to float around and come in and off at random locations like the asteroids in the game Asteroids. I put some rotation and grow in there temporarily. It would be nice if all of the…
user4557742
0
votes
1 answer

make animations effects just like skype iOS application's menu

I was trying to create animation like skype bottom menu in iPhone. I tried many ways to solve it but wasn't able to configure the accurate solution. I have tried, (1)CGPathAddLineToPoint (2)CGPathAddArc (3)CGPathAddArcToPoint (4)[UIView…
Hxb
  • 79
  • 9
0
votes
1 answer

UIDynamicsAnimator causes error after coming back from main menu

I have two view controllers-- one is a main menu, the other is the game. The game has a box that drops, and if the user doesn't catch it, it falls off screen and resets at its original position at the top. The app loads onto the main menu, and the…