Last active
March 13, 2017 16:26
-
-
Save hborders/c58b26ee0acb30c9a8bc74a5fd591284 to your computer and use it in GitHub Desktop.
An Objective-C pattern for making sum types - Example.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ExamplePrivate.h" // https://gist.github.com/hborders/12fcbe34cf4de68c2317bad92a8e223d | |
@implementation Example | |
- (instancetype _Nonnull)initPrivate { | |
return [super init]; | |
} | |
- (void)switchFoo:(void (^ _Nonnull)(ExampleFoo * _Nonnull foo_))fooBlock | |
bar:(void (^ _Nonnull)(ExampleBar * _Nonnull bar_))barBlock { | |
// Subclasses must implement and call | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment