-
Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathswift_name_objc.h
69 lines (55 loc) · 2.4 KB
/
swift_name_objc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@import Foundation;
#define SWIFT_NAME(X) __attribute__((swift_name(#X)))
// Renaming classes
SWIFT_NAME(SomeClass)
@interface SNSomeClass : NSObject
- (instancetype)initWithFloat:(float)f;
- (instancetype)initWithDefault;
- (void)instanceMethodWithX:(float)x Y:(float)y Z:(float)z;
+ (instancetype)someClassWithDouble:(double)d;
+ (instancetype)someClassWithTry:(BOOL)shouldTry;
+ (NSObject *)buildWithObject:(NSObject *)object SWIFT_NAME(init(object:));
+ (instancetype)buildWithUnsignedChar:(unsigned char)uint8 SWIFT_NAME(init(uint8:));
@property (readonly,nonatomic) float floatProperty;
@property (readwrite,nonatomic) double doubleProperty;
@end
SWIFT_NAME(SomeProtocol)
@protocol SNSomeProtocol
- (void)protoInstanceMethodWithX:(float)x y:(float)y;
@end
@interface SNSomeClass ()
- (void)extensionMethodWithX:(float)x y:(float)y;
@end
@interface SNSomeClass (Category1) <SNSomeProtocol>
- (void)categoryMethodWithX:(float)x y:(float)y;
- (void)categoryMethodWithX:(float)x y:(float)y z:(float)z;
- (id)objectAtIndexedSubscript:(NSInteger)index;
@end
@interface SNCollision
@end
@protocol SNCollision
@property (readonly,nonnull) id reqSetter;
- (void)setReqSetter:(nonnull id)bar;
@property (readonly,nonnull) id optSetter;
@optional
- (void)setOptSetter:(nonnull id)bar;
@end
@protocol NSAccessibility
@property (nonatomic) float accessibilityFloat;
@end
@interface UIActionSheet : NSObject
-(instancetype)initWithTitle:(const char *)title delegate:(id)delegate cancelButtonTitle:(const char *)cancelButtonTitle destructiveButtonTitle:(const char *)destructiveButtonTitle otherButtonTitles:(const char *)otherButtonTitles, ...;
@end
@interface NSErrorImports : NSObject
- (nullable NSObject *)methodAndReturnError:(NSError **)error;
- (BOOL)methodWithFloat:(float)value error:(NSError **)error;
- (nullable void *)pointerMethodAndReturnError:(NSError **)error;
- (nullable SEL)selectorMethodAndReturnError:(NSError **)error;
- (nullable void (*)(void))functionPointerMethodAndReturnError:(NSError **)error;
- (nullable void (^)(void))blockMethodAndReturnError:(NSError **)error;
- (nullable instancetype)initAndReturnError:(NSError **)error;
- (nullable instancetype)initWithFloat:(float)value error:(NSError **)error;
- (nonnull void *)badPointerMethodAndReturnError:(NSError **)error;
@end
typedef const void *CFTypeRef __attribute__((objc_bridge(id)));
typedef const struct __attribute__((objc_bridge(id))) __CCItem *CCItemRef;