Explicitly disabling UIView animation in iOS4+

3 Solutions Collect From Internet About “Explicitly disabling UIView animation in iOS4+”

[UIView setAnimationsEnabled:NO];
//animate here
[UIView setAnimationsEnabled:YES];

For iOS 7 and above this can now be accomplished with:

[UIView performWithoutAnimation:^{
    // Changes we don't want animated here
    view.alpha = 0.0;
}];

For MonoTouch (C#) users, here is a helper class:

public class UIViewAnimations : IDisposable
{
    public UIViewAnimations(bool enabled)
    {
        _wasEnabled = UIView.AnimationsEnabled;
        UIView.AnimationsEnabled = enabled;
    }

    public void Dispose()
    {
        UIView.AnimationsEnabled = _wasEnabled;
    }

    bool _wasEnabled;
}

Example:

using (new UIViewAnimations(false))
    imageView.Frame = GetImageFrame();