Skip to content

Instantly share code, notes, and snippets.

@grgcombs
Last active July 11, 2016 17:13
Show Gist options
  • Save grgcombs/6bf00d095ab199edd9d0341fbe4d9412 to your computer and use it in GitHub Desktop.
Save grgcombs/6bf00d095ab199edd9d0341fbe4d9412 to your computer and use it in GitHub Desktop.
Obj-C Generics Example
// I borrowed pieces of this from the generics implementations in FaceBook's Bolts Framework and the Parse SDK
@import Foundation;
@class GRGCollectionItemTypeClass<__covariant CodableCollectionItem:NSObject<NSCopying,NSSecureCoding> *>;
@interface GRGCollectionClass<__covariant CodableCollectionItem:NSObject<NSCopying,NSSecureCoding> *> : NSObject<NSFastEnumeration>
typedef BOOL(^GRGNextCollectionItemBlock)(GRGCollectionItemTypeClass<CodableCollectionItem> *nextItem);
@property (nullable,nonatomic,copy) GRGNextCollectionItemBlock onRunNextItem;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment