Well, everyone knows that in ObjC we have
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion
Notice that completion
block has a BOOL argument.
Now let's look at Monotouch:
public static void Animate (double duration, double delay, UIViewAnimationOptions options, NSAction animation, NSAction completion)
NSAction is:
public delegate void NSAction ();
Just the delegate without any arguments. Moreover, in Monotouch "internals" we can see:
public static void Animate (double duration, double delay, UIViewAnimationOptions options,
NSAction animation, NSAction completion)
{
UIView.AnimateNotify (duration, delay, options, animation, delegate (bool x)
{
if (completion != null)
{
completion ();
}
});
}
Notice delegate (bool x)
, It calls the function just like I need. Now, how can I pass Action<bool>
as completion to UIView.Animate
?