سؤال

I call a doPoof method using NSTimer as following:

[NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(doPoof:) userInfo:myCALayer repeats:FALSE];

How to replace the above using CADisplayLink instead of an NSTimer?

هل كانت مفيدة؟

المحلول

Why do you want to change away from NSTimer?

The point of using CADisplayLink is so that animations can be timed according to the video refresh interval.

For a simple, non-repeating, call, NSTimer is perfectly valid.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top