UIView-EasingFunctions icon indicating copy to clipboard operation
UIView-EasingFunctions copied to clipboard

Animation doesn't work in iPhone 5S (iPhone 64bits)

Open FuriouZz opened this issue 11 years ago • 18 comments

In the Simulator, animation has a strange behavior. In the device, no animation works.

FuriouZz avatar Dec 10 '13 10:12 FuriouZz

So, umm, does it?

zrxq avatar Dec 12 '13 08:12 zrxq

The problem comes from AHEasing. I needed to define AH_EASING_USE_DBL_PRECIS in my Pods-environment.h file. In 64bits, the app don't use float but double. When you use CGFloat the change works fine but AHEasing use its proper float named AHFloat.

FuriouZz avatar Dec 12 '13 13:12 FuriouZz

I'll reopen the issue just so I remember to do something about it.

zrxq avatar Dec 12 '13 15:12 zrxq

I suggest a pull request to AHEasing author.

https://github.com/warrenm/AHEasing/pull/8

Just define AH_EASING_USE_DBL_PRECIS if it's __LP64__

FuriouZz avatar Dec 12 '13 18:12 FuriouZz

Switching on AH_EASING_USE_DBL_PRECIS didn't work when I attempted... all that seemed to do was stop easing altogether.

However, switching the typedef in this library from

typedef CGFloat (*ViewEasingFunctionPointerType)(CGFloat);

to

typedef float (*ViewEasingFunctionPointerType)(float);

Seems to solve it, at least for me. Thoughts?

jkosoy avatar Feb 23 '14 23:02 jkosoy

Hard to tell without looking at the code/project.

zrxq avatar Feb 24 '14 03:02 zrxq

@jkosoy's suggestion solved it for me too, thanks!

hery avatar Mar 05 '14 18:03 hery

@jkosoy's suggestion worked for me too.

refactornator avatar Mar 16 '14 16:03 refactornator

@jkosoy's suggestion worked. Would love to get this committed.

cerupcat avatar Mar 17 '14 21:03 cerupcat

For what it's worth I don't believe that my solution was appropriate for the library - it was just a hotfix for the problem. I haven't had time to build a correct solution myself -- should I find the time I'll submit a pull request.

jkosoy avatar Mar 17 '14 21:03 jkosoy

Yeah , one day it worked , the next day it isn't .

ghost avatar Mar 19 '14 18:03 ghost

So - the problem I am facing is that suddenly changing

typedef CGFloat (_ViewEasingFunctionPointerType)(CGFloat); to typedef float (_ViewEasingFunctionPointerType)(float);

works for some days , then it doesn't after some 10 - 20 compiles , then you change it back to

typedef CGFloat (*ViewEasingFunctionPointerType)(CGFloat);

and it miraculously will start working once again for the next 10 - 20 compiles. Right now i changed CGFloat to AHFloat thinking at this might just work every time.

ghost avatar Mar 30 '14 05:03 ghost

Haven't faced any problem since i changed as per the comment above.

ghost avatar Apr 01 '14 21:04 ghost

Specifically created a new repo which changes the implementation inside but works almost in the same way, couldn't add bouncy & elastic animations but if you are using other easings you should try it. https://github.com/thegreatloser/UIView-Easing

tapthaker avatar Sep 28 '14 20:09 tapthaker

I'm facing a strange problem with iPhone 5S, when animating a frame, changing only it's origin.y value, on a iPhone 4S everything works fine, but on iPhone 5S the origin values (x and y) gets changed to a value lower than it should be, then when the animation ends, it gets back to desired value.

DenninDalke avatar Dec 12 '14 12:12 DenninDalke

it seems to be related to iOS8, I tested on iPhone4S with iOS8 and the same problem happened.

DenninDalke avatar Dec 12 '14 13:12 DenninDalke

@DenninDalke - try the repo above

tapthaker avatar Dec 12 '14 14:12 tapthaker

I tried and it worked, but I'd like to have elastic easing working too.

DenninDalke avatar Dec 12 '14 14:12 DenninDalke