What value can I set in the context parameter for UIView + beginAnimations: context :?
3 answers
Use it to pass a pointer to the object you are animating. When you call setAnimationDidStopSelector
, you must give it a method call to call. This method signature should be of the form:
- (void)animationDidStop:(NSString *)animationID
finished:(NSNumber *)finished
context:(void *)context
The context value specified in beginAnimations
is not passed to this method. It's just (void *), which is shorthand for "a pointer to whatever you want it to be". Object, integer, struct. Whatever.
Instead of "context", think of it as "userData".
+7
a source to share