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
0 answers

SKPhysicsBody with custom view?

With UIDynamics it is simple to have the physics objects, called dynamic items, control custom views (or indeed anything you want) using the protocol UIDynamitItem with the three properties center, transform and bounds. I would like to do something…
Gusutafu
  • 745
  • 6
  • 17
0
votes
2 answers

Collision Behavior with moving image

I am having issue with collision behavior.I have 2 types of objects falling from up to bottom of the screen and collisioning with image in the bottom of the screen. Collision are working great, but soon as I move the image, it gets rescaled and…
Jozef Vrana
  • 309
  • 1
  • 5
  • 14
0
votes
1 answer

Replicating the bounce on tapping the camera button in iOS 7

I've been digging through some UIDynamics examples and I've checked out some of the WWDC videos, but I'm still a bit lost on how I'd replicate that bounce on the lock screen. I'd like to "bounce" the contentView of a UIView on tap. There's a swipe…
STANGMMX
  • 973
  • 7
  • 18
  • 31
-1
votes
1 answer

Why terminating with uncaught exception of type NSException in .addObserver

I will use UIAttachmentBehavior to connect anchorPoint to a specific UIView and then use CAShapeLayer to draw a line. I used addObserver for bring UIView's coordinates every minute. However, an unknown error occurs. I don't think I'm familiar with…
bakuiseok
  • 41
  • 1
  • 10
-1
votes
1 answer

How to make images fall in iOS

One of the things I need to do is make a fireball fall down. I can make it work with a square but how can I make it work with my image? The website that I used to get the square to fall down is here :…
Nags
  • 15
  • 9
-1
votes
1 answer

Use UIDynamics with Storyboard

I added an UIDynamicAnimator onto my UIView which I created programmatically. Now I'd like to create the UIView in the Storyboard because I'd like to use autolayout. Does someone knows what I have to change for using the UIView from Storyboard? My…
paro
  • 217
  • 3
  • 10
-1
votes
1 answer

Translating @interface UIView from Objective-C to Swift

I'm following an Objective-C tutorial on how to animate a menu with UIKit Dynamics and I'm having some trouble translating the following code from Objective-C to Swift. animator.h @interface Animator : NSObject +…
Rui Gomes
  • 332
  • 1
  • 3
  • 16
-2
votes
1 answer

UIDynamics [__NSCFNumber center] code & crash log included

I am wantintg to experement on some sample code from an online tutorial which runs fine before I add my func to it. I am wanting to add UIDynamics and apply gravity to the series of points on a line in the chart/graph and just make it fall off…
Robert
  • 63
  • 7
1 2 3
13
14