Skip to content

Instantly share code, notes, and snippets.

@chrene
Created August 10, 2014 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chrene/83f5b1fd0e25db4871fd to your computer and use it in GitHub Desktop.
Save chrene/83f5b1fd0e25db4871fd to your computer and use it in GitHub Desktop.
//
// UINavigationController+CompletionHandler.h
// Entire
//
// Created by ChristianEnevoldsen on 10/08/14.
// Copyright (c) 2014 Reversebox. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UINavigationController (CompletionHandler)
- (void)pushViewController:(UIViewController *)viewController
animated:(BOOL)animated
completion:(void (^)(void))completion;
@end
//
// UINavigationController+CompletionHandler.m
// Entire
//
// Created by ChristianEnevoldsen on 10/08/14.
// Copyright (c) 2014 Reversebox. All rights reserved.
//
#import "UINavigationController+CompletionHandler.h"
#import <QuartzCore/QuartzCore.h>
@implementation UINavigationController (CompletionHandler)
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated completion:(void (^)(void))completion {
[CATransaction begin];
[CATransaction setCompletionBlock:completion];
[self pushViewController:viewController animated:animated];
[CATransaction commit];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment