Skip to content

Instantly share code, notes, and snippets.

@simonwhitaker
Last active December 12, 2015 08:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonwhitaker/4745057 to your computer and use it in GitHub Desktop.
Save simonwhitaker/4745057 to your computer and use it in GitHub Desktop.
A simple protocol for view controllers that want to communicate that they should be dismissed without knowing about how they were presented.
// GSDismissableViewControllerDelegate.h
//
// Created by Simon Whitaker at Goo Software Ltd.
// https://gist.github.com/simonwhitaker/4745057
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@protocol GSDismissableViewControllerDelegate <NSObject>
- (void)dismissViewController:(UIViewController*)viewController wasCancelled:(BOOL)wasCancelled;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment