-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClassProperty.h
42 lines (29 loc) · 1.02 KB
/
ClassProperty.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
//
// ClassProperty.h
//
// Created by Nick Randall on 9/5/20.
// Copyright © 2020 Nick Randall. All rights reserved.
//
@import Foundation;
@import ObjectiveC.runtime;
@class TypeEncoding;
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(char, SetterType) {
Assign, Strong, Weak, Copy
};
@interface ClassProperty : NSObject
@property (nonatomic, readonly) NSString *name;
@property (nonatomic, readonly) TypeEncoding *type;
@property (nonatomic, readonly) BOOL isReadOnly;
@property (nonatomic, readonly) BOOL isNonAtomic;
@property (nonatomic, readonly) BOOL isDynamic;
@property (nonatomic, readonly) SetterType setterType;
/// Custom getter or the default getter
@property (nonatomic, readonly) SEL getter;
/// Custom or default setter, NULL if the property is readonly
@property (nonatomic, readonly, nullable) SEL setter;
/// Will be nil if the property is computed or dynamic
@property (nonatomic, readonly, nullable) NSString *ivarName;
- (instancetype)initWithProperty:(objc_property_t)property;
@end
NS_ASSUME_NONNULL_END