• [^] # Re: J'aimerais

    Posté par . En réponse au journal Votre langage idéal ?. Évalué à 1.

    Ok, je la refais alors, en version complete:

    AnimationBlock animationBlock = ^{
     view.alpha = 0;
    }
    CompletionBlock completionBlock = ^(BOOL finished){
     if(!finished)
     {
     return;
     }
     view.alpha = 1;
    }
    [UIView animateWithDuration: SHORT_ANIMATION
     delay: 1.0f 
     options: UIViewAnimationOptionAllowUserInteraction 
     animation: animationBlock
     completion: completionBlock];
    
    

    AnimationBlock et CompletionBlock sont des typedefs de base, SHORT_ANIMATION un #define.
    C'est en tout cas vachement plus lisible que:

    View.animate(SHORT_ANIMATION, 1.0f, UIViewAnimationOptionAllowUserInteraction, animationBlock, completionBlock);
    
    

    Et surtout, quand tu l'écris tu demandes pas si le premier parametre est le délai ou la durée.

    If you can find a host for me that has a friendly parrot, I will be very very glad. If you can find someone who has a friendly parrot I can visit with, that will be nice too.