Last active
March 13, 2017 16:44
-
-
Save hborders/f1c231a89de11157adf46ee85880733a to your computer and use it in GitHub Desktop.
An Objective-C pattern for making sum types - ExampleBar.h
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 "Example.h" // https://gist.github.com/hborders/2af9b39e27b62ef9e68c65085126fe4a | |
@interface ExampleBar : Example | |
@property (nonatomic, readonly) NSInteger b; | |
@property (nonatomic, readonly) NSInteger c; | |
+ (instancetype _Nonnull)new NS_UNAVAILABLE; | |
- (instancetype _Nonnull)init NS_UNAVAILABLE; | |
- (instancetype _Nonnull)initWithB:(NSInteger)b | |
c:(NSInteger)c NS_DESIGNATED_INITIALIZER; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment