Questions tagged [uisnapbehavior]

UISnapBehavior is an Objective-C class introduced in iOS 7, to define an animation of an item that moves towards a specific point. It works in conjunction with a UIDynamicAnimator.

8 questions
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
3
votes
1 answer

Xamarin.Forms - Snap behavior

Some years ago I made a class in Xamarin.iOS which was simply a UIView that snaps to the edges of the screen. public class MovableUIButton : UIView { private UIPanGestureRecognizer PanGesture; private UIButton btnShoppingCart; private…
DirtyNative
  • 2,553
  • 2
  • 33
  • 58
3
votes
0 answers

Does UIDynamicBehavior only move entire views, or can it affect contentOffset instead?

I'm having a difficult time understanding UIDynamicBehaviors. I'm trying to add a UISnapBehavior to a UIScrollView, and as you all know the way UIScrollViews behave is by changing its contentOffset when the user interacts with it, but when I add…
eobet
  • 273
  • 1
  • 3
  • 11
2
votes
2 answers

UIAnimator's UISnapBehavior possible with UIScrollview?

I am trying to figure out if I can use a UISnapBehavior from UIAnimator inside a UIScrollview to make scroll view's content snap to a point. So far my findings have been lead to that this is impossible. What I am Trying to Achieve UIScrollView to…
Gizmodo
  • 3,151
  • 7
  • 45
  • 92
2
votes
1 answer

How do i add dynamic behaviour in NSObject class : Swift

I'm trying to create a custom alertview with dynamic behaviour using UIDynamicAnimator in NSObject class using swift,While adding UISnapBehaviour to a view in NSObject class init method snap behaviour is not working,For instance look at the below…
Gokul G
  • 2,046
  • 15
  • 22
2
votes
2 answers

UISnapBehaviour in x-axis only

Is there anyway to get UISnapBevahiour to only work along a linear x-axis? I want the exact behaviour of a UISnapBehaviour but don't want it to 'shake' into position on both x & y axis, just the x axis. This is for a UIView inside my contentView of…
JMWhittaker
  • 3,633
  • 3
  • 23
  • 30
1
vote
0 answers

UISnapBehavior Animation Glitch

When using UISnapBehavior to reset a view to the center of the screen I get the expected bounce effect. But after scrolling a UIScrollView that is a subview of the view being snapped the UISnapBehavior dampening seems to have a different base…
wasabi
  • 1,110
  • 10
  • 23
0
votes
1 answer

Something other than snapToPoint is controlling layout in UISnapBehavior

I am new to animation and struggling to understand why UIAnimation and UISnapBehavior appear to shift UIButtons off-centre. Clearly there is something controlling layout besides what is in my code. Maybe someone can tell me what I'm…
Greg
  • 1,750
  • 2
  • 29
  • 56