55 lines
954 B
Objective-C
55 lines
954 B
Objective-C
#import <objc/NSObject.h>
|
|
|
|
@class Foo;
|
|
|
|
@protocol Printer;
|
|
@protocol Printer;
|
|
|
|
@protocol Empty
|
|
@end;
|
|
|
|
@protocol Forward;
|
|
@class Forward;
|
|
|
|
void useForward1(Forward * p) {}
|
|
void useForward2(id<Forward> p) {}
|
|
|
|
typedef NSString NSStringTypedef;
|
|
|
|
@interface Foo : NSObject <Empty>
|
|
@property NSStringTypedef* name;
|
|
-(void)helloWithPrinter:(id <Printer>)printer;
|
|
@end;
|
|
|
|
@interface Foo (FooExtensions)
|
|
-(void)hello;
|
|
@end;
|
|
|
|
@protocol Printer
|
|
@required
|
|
-(void)print:(const char*)string;
|
|
@end;
|
|
|
|
@protocol MutablePair
|
|
@required
|
|
@property (readonly) int first;
|
|
@property (readonly) int second;
|
|
|
|
-(void)update:(int)index add:(int)delta;
|
|
-(void)update:(int)index sub:(int)delta;
|
|
|
|
@end;
|
|
|
|
void replacePairElements(id <MutablePair> pair, int first, int second);
|
|
|
|
int invoke1(int arg, int (^block)(int)) {
|
|
return block(arg);
|
|
}
|
|
|
|
void invoke2(void (^block)(void)) {
|
|
block();
|
|
}
|
|
|
|
int (^getSupplier(int x))(void);
|
|
Class (^ _Nonnull getClassGetter(NSObject* obj))(void);
|