Created
September 14, 2018 10:00
-
-
Save loromits/ad67d886cd9a0b9b24cd9fb4172820e8 to your computer and use it in GitHub Desktop.
Simple stupid Pair in Objective-C
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
@interface Pair<FirstType, SecondType>: NSObject | |
@property FirstType first; | |
@property SecondType second; | |
+ (instancetype)pairWithFirst:(FirstType)first second:(SecondType)second; | |
@end | |
@implementation Pair | |
+ (instancetype)pairWithFirst:(id)first second:(id)second { | |
__auto_type pair = [Pair new]; | |
pair.first = first; | |
pair.second = second; | |
return pair; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment