Skip to content

Commit 33bd35d

Browse files
committed
Removed __kindof, since support in Cocoapods doesn't seem to work properly. Also added proper macros for nullability and generics to guard against older versions.
1 parent 97b6b1a commit 33bd35d

File tree

8 files changed

+92
-29
lines changed

8 files changed

+92
-29
lines changed

FirebaseUI.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
D8B6ACF91B583D3E005CDDB2 /* FirebaseDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = D8B6ACED1B583C33005CDDB2 /* FirebaseDataSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
3535
D8B6ACFB1B583D48005CDDB2 /* FirebaseArray.h in Headers */ = {isa = PBXBuildFile; fileRef = D8B6ACEC1B583C33005CDDB2 /* FirebaseArray.h */; settings = {ATTRIBUTES = (Public, ); }; };
3636
D8DA10F11B7AC50400D00954 /* FirebaseCollectionViewDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = D8DA10F01B7AC50400D00954 /* FirebaseCollectionViewDataSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
37+
D8DB81A81B7EA357001429C6 /* XCodeMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = D8DB81A71B7EA357001429C6 /* XCodeMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
3738
D8DF55621B742DB40030E996 /* FirebaseCollectionViewDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = D8DF55611B742DB40030E996 /* FirebaseCollectionViewDataSource.m */; };
3839
/* End PBXBuildFile section */
3940

@@ -73,6 +74,7 @@
7374
D8C579A61B57349000899F86 /* libFirebaseUI.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFirebaseUI.a; sourceTree = BUILT_PRODUCTS_DIR; };
7475
D8C579BB1B5837DF00899F86 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
7576
D8DA10F01B7AC50400D00954 /* FirebaseCollectionViewDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FirebaseCollectionViewDataSource.h; path = API/FirebaseCollectionViewDataSource.h; sourceTree = "<group>"; };
77+
D8DB81A71B7EA357001429C6 /* XCodeMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCodeMacros.h; sourceTree = "<group>"; };
7678
D8DF55611B742DB40030E996 /* FirebaseCollectionViewDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FirebaseCollectionViewDataSource.m; path = Implementation/FirebaseCollectionViewDataSource.m; sourceTree = "<group>"; };
7779
/* End PBXFileReference section */
7880

@@ -109,6 +111,7 @@
109111
D8B6ACED1B583C33005CDDB2 /* FirebaseDataSource.h */,
110112
D8B6ACEE1B583C33005CDDB2 /* FirebaseTableViewDataSource.h */,
111113
D8DA10F01B7AC50400D00954 /* FirebaseCollectionViewDataSource.h */,
114+
D8DB81A71B7EA357001429C6 /* XCodeMacros.h */,
112115
);
113116
name = API;
114117
sourceTree = "<group>";
@@ -160,6 +163,7 @@
160163
D87E4ABA1B7D832D00A53633 /* FirebaseUI.h in Headers */,
161164
D8B6ACF91B583D3E005CDDB2 /* FirebaseDataSource.h in Headers */,
162165
D8784C401B719F280025587E /* FirebaseArrayDelegate.h in Headers */,
166+
D8DB81A81B7EA357001429C6 /* XCodeMacros.h in Headers */,
163167
D8124F431B72B347003441AD /* FirebaseTableViewDataSource.h in Headers */,
164168
D8DA10F11B7AC50400D00954 /* FirebaseCollectionViewDataSource.h in Headers */,
165169
D8B6ACFB1B583D48005CDDB2 /* FirebaseArray.h in Headers */,

FirebaseUI/API/FirebaseArray.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
*/
2828

2929
#import <Foundation/Foundation.h>
30+
#import <FirebaseUI/XCodeMacros.h>
3031

3132
#import "FirebaseArrayDelegate.h"
3233

@@ -52,7 +53,7 @@
5253
/**
5354
* The delegate object that array changes are surfaced to.
5455
*/
55-
@property (strong, nonatomic) NSMutableArray<FDataSnapshot *> *snapshots;
56+
@property (strong, nonatomic) __GENERIC(NSMutableArray, FDataSnapshot *) *snapshots;
5657

5758
#pragma mark -
5859
#pragma mark Initializer methods

FirebaseUI/API/FirebaseCollectionViewDataSource.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
*/
2828

2929
#import <UIKit/UIKit.h>
30+
#import <FirebaseUI/XCodeMacros.h>
3031

3132
#import "FirebaseDataSource.h"
3233

@@ -40,22 +41,22 @@
4041
/**
4142
* The model class to coerce FDataSnapshots to (if desired). For instance, if the modelClass is set to [Message class] in Obj-C or Message.self in Swift, then objects of type Message will be returned instead of type FDataSnapshot.
4243
*/
43-
@property (strong, nonatomic, nonnull) Class modelClass;
44+
@property (strong, nonatomic, __NON_NULL) Class modelClass;
4445

4546
/**
4647
* The reuse identifier for cells in the UICollectionView.
4748
*/
48-
@property (strong, nonatomic, nonnull) NSString *reuseIdentifier;
49+
@property (strong, nonatomic, __NON_NULL) NSString *reuseIdentifier;
4950

5051
/**
5152
* The UICollectionView instance that operations (inserts, removals, moves, etc.) are performed against.
5253
*/
53-
@property (strong, nonatomic, nonnull) UICollectionView *collectionView;
54+
@property (strong, nonatomic, __NON_NULL) UICollectionView *collectionView;
5455

5556
/**
5657
* The callback to populate a subclass of UICollectionViewCell with an object provided by the datasource.
5758
*/
58-
@property (strong, nonatomic, nonnull) void(^populateCell)(__kindof UICollectionViewCell * _Nonnull cell, __kindof NSObject * _Nonnull object);
59+
@property (strong, nonatomic, __NON_NULL) void(^populateCell)(UICollectionViewCell * __NON_NULL_PTR cell, NSObject * __NON_NULL_PTR object);
5960

6061
/**
6162
* Initialize an instance of FirebaseCollectionViewDataSource that populates UICollectionViewCells with FDataSnapshots.
@@ -64,7 +65,7 @@
6465
* @param collectionView An instance of a UICollectionView to bind to
6566
* @return An instance of FirebaseCollectionViewDataSource that populates UICollectionViewCells with FDataSnapshots
6667
*/
67-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
68+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UICollectionView *)collectionView;
6869

6970
/**
7071
* Initialize an instance of FirebaseCollectionViewDataSource that populates a custom subclass of UICollectionViewCell with FDataSnapshots.
@@ -74,7 +75,7 @@
7475
* @param collectionView An instance of a UICollectionView to bind to
7576
* @return An instance of FirebaseCollectionViewDataSource that populates a custom subclass of UICollectionViewCell with FDataSnapshots
7677
*/
77-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref cellClass:(nullable Class)cell reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
78+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref cellClass:(__NULLABLE Class)cell reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UICollectionView *)collectionView;
7879

7980
/**
8081
* Initialize an instance of FirebaseCollectionViewDataSource that populates a custom xib with FDataSnapshots.
@@ -84,7 +85,7 @@
8485
* @param collectionView An instance of a UICollectionView to bind to
8586
* @return An instance of FirebaseCollectionViewDataSource that populates a custom xib with FDataSnapshots
8687
*/
87-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref nibNamed:(nonnull NSString *)nibName reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
88+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref nibNamed:(__NON_NULL NSString *)nibName reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UICollectionView *)collectionView;
8889

8990
/**
9091
* Initialize an instance of FirebaseCollectionViewDataSource that populates UICollectionViewCells with a custom model class.
@@ -94,7 +95,7 @@
9495
* @param collectionView An instance of a UICollectionView to bind to
9596
* @return An instance of FirebaseCollectionViewDataSource that populates UICollectionViewCells with a custom model class
9697
*/
97-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref modelClass:(nullable Class)model reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
98+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref modelClass:(__NULLABLE Class)model reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UICollectionView *)collectionView;
9899

99100
/**
100101
* Initialize an instance of FirebaseCollectionViewDataSource that populates a custom subclass of UICollectionViewCell with a custom model class.
@@ -105,7 +106,7 @@
105106
* @param collectionView An instance of a UICollectionView to bind to
106107
* @return An instance of FirebaseCollectionViewDataSource that populates a custom subclass of UICollectionViewCell with a custom model class
107108
*/
108-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref modelClass:(nullable Class)model cellClass:(nullable Class)cell reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
109+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref modelClass:(__NULLABLE Class)model cellClass:(__NULLABLE Class)cell reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UICollectionView *)collectionView;
109110

110111
/**
111112
* Initialize an instance of FirebaseCollectionViewDataSource that populates a custom xib with a custom model class.
@@ -116,12 +117,12 @@
116117
* @param collectionView An instance of a UICollectionView to bind to
117118
* @return An instance of FirebaseCollectionViewDataSource that populates a custom xib with a custom model class
118119
*/
119-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref modelClass:(nullable Class)model nibNamed:(nonnull NSString *)nibName reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UICollectionView *)collectionView;
120+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref modelClass:(__NULLABLE Class)model nibNamed:(__NON_NULL NSString *)nibName reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UICollectionView *)collectionView;
120121

121122
/**
122123
* This method populates the fields of a UICollectionViewCell or subclass given an FDataSnapshot (or custom model object).
123124
* @param callback A block which returns an initialized UICollectionViewCell (or subclass) and the corresponding object to populate the cell with.
124125
*/
125-
- (void)populateCellWithBlock:(nonnull void(^)( __kindof UICollectionViewCell * _Nonnull cell, __kindof NSObject * _Nonnull object))callback;
126+
- (void)populateCellWithBlock:(__NON_NULL void(^)(UICollectionViewCell * __NON_NULL_PTR cell, NSObject * __NON_NULL_PTR object))callback;
126127

127128
@end

FirebaseUI/API/FirebaseTableViewDataSource.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
*/
2828

2929
#import <UIKit/UIKit.h>
30+
#import <FirebaseUI/XCodeMacros.h>
3031

3132
#import "FirebaseDataSource.h"
3233

@@ -40,22 +41,22 @@
4041
/**
4142
* The model class to coerce FDataSnapshots to (if desired). For instance, if the modelClass is set to [Message class] in Obj-C or Message.self in Swift, then objects of type Message will be returned instead of type FDataSnapshot.
4243
*/
43-
@property (strong, nonatomic, nonnull) Class modelClass;
44+
@property (strong, nonatomic, __NON_NULL) Class modelClass;
4445

4546
/**
4647
* The reuse identifier for cells in the UITableView.
4748
*/
48-
@property (strong, nonatomic, nonnull) NSString *reuseIdentifier;
49+
@property (strong, nonatomic, __NON_NULL) NSString *reuseIdentifier;
4950

5051
/**
5152
* The UITableView instance that operations (inserts, removals, moves, etc.) are performed against.
5253
*/
53-
@property (strong, nonatomic, nonnull) UITableView *tableView;
54+
@property (strong, nonatomic, __NON_NULL) UITableView *tableView;
5455

5556
/**
5657
* The callback to populate a subclass of UITableViewCell with an object provided by the datasource.
5758
*/
58-
@property (strong, nonatomic, nonnull) void(^populateCell)(__kindof UITableViewCell * _Nonnull cell, __kindof NSObject * _Nonnull object);
59+
@property (strong, nonatomic, __NON_NULL) void(^populateCell)(UITableViewCell * __NON_NULL_PTR cell, NSObject * __NON_NULL_PTR object);
5960

6061
/**
6162
* Initialize an instance of FirebaseTableViewDataSource that populates UITableViewCells with FDataSnapshots.
@@ -64,7 +65,7 @@
6465
* @param tableView An instance of a UITableView to bind to
6566
* @return An instance of FirebaseTableViewDataSource that populates UITableViewCells with FDataSnapshots
6667
*/
67-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UITableView *)tableView;
68+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UITableView *)tableView;
6869

6970
/**
7071
* Initialize an instance of FirebaseTableViewDataSource that populates a custom subclass of UITableViewCell with FDataSnapshots.
@@ -74,7 +75,7 @@
7475
* @param tableView An instance of a UITableView to bind to
7576
* @return An instance of FirebaseTableViewDataSource that populates a custom subclass of UITableViewCell with FDataSnapshots
7677
*/
77-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref cellClass:(nullable Class)cell reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UITableView *)tableView;
78+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref cellClass:(__NULLABLE Class)cell reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UITableView *)tableView;
7879

7980
/**
8081
* Initialize an instance of FirebaseTableViewDataSource that populates a custom xib with FDataSnapshots.
@@ -84,7 +85,7 @@
8485
* @param tableView An instance of a UITableView to bind to
8586
* @return An instance of FirebaseTableViewDataSource that populates a custom xib with FDataSnapshots
8687
*/
87-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref nibNamed:(nonnull NSString *)nibName reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UITableView *)tableView;
88+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref nibNamed:(__NON_NULL NSString *)nibName reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UITableView *)tableView;
8889

8990
/**
9091
* Initialize an instance of FirebaseTableViewDataSource that populates UITableViewCells with a custom model class.
@@ -94,7 +95,7 @@
9495
* @param tableView An instance of a UITableView to bind to
9596
* @return An instance of FirebaseTableViewDataSource that populates UITableViewCells with a custom model class
9697
*/
97-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref modelClass:(nullable Class)model reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UITableView *)tableView;
98+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref modelClass:(__NULLABLE Class)model reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UITableView *)tableView;
9899

99100
/**
100101
* Initialize an instance of FirebaseTableViewDataSource that populates a custom subclass of UITableViewCell with a custom model class.
@@ -105,7 +106,7 @@
105106
* @param tableView An instance of a UITableView to bind to
106107
* @return An instance of FirebaseTableViewDataSource that populates a custom subclass of UITableViewCell with a custom model class
107108
*/
108-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref modelClass:(nullable Class)model cellClass:(nullable Class)cell reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UITableView *)tableView;
109+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref modelClass:(__NULLABLE Class)model cellClass:(__NULLABLE Class)cell reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UITableView *)tableView;
109110

110111
/**
111112
* Initialize an instance of FirebaseTableViewDataSource that populates a custom xib with a custom model class.
@@ -116,13 +117,13 @@
116117
* @param tableView An instance of a UITableView to bind to
117118
* @return An instance of FirebaseTableViewDataSource that populates a custom xib with a custom model class
118119
*/
119-
- (nonnull instancetype)initWithRef:(nonnull Firebase *)ref modelClass:(nullable Class)model nibNamed:(nonnull NSString *)nibName reuseIdentifier:(nonnull NSString *)identifier view:(nonnull UITableView *)tableView;
120+
- (__NON_NULL instancetype)initWithRef:(__NON_NULL Firebase *)ref modelClass:(__NULLABLE Class)model nibNamed:(__NON_NULL NSString *)nibName reuseIdentifier:(__NON_NULL NSString *)identifier view:(__NON_NULL UITableView *)tableView;
120121

121122
/**
122123
* This method populates the fields of a UITableViewCell or subclass given a model object (or FDataSnapshot).
123124
* @param callback A block which returns an initialized UITableViewCell (or subclass) and the corresponding object to populate the cell with.
124125
*/
125-
- (void)populateCellWithBlock:(nonnull void(^)(__kindof UITableViewCell * _Nonnull cell, __kindof NSObject * _Nonnull object))callback;
126+
- (void)populateCellWithBlock:(__NON_NULL void(^)(UITableViewCell * __NON_NULL_PTR cell, NSObject * __NON_NULL_PTR object))callback;
126127

127128
@end
128129

FirebaseUI/API/FirebaseUI.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828

2929
#import <Foundation/Foundation.h>
3030

31-
#import "FirebaseArray.h"
32-
#import "FirebaseDataSource.h"
33-
#import "FirebaseTableViewDataSource.h"
34-
#import "FirebaseCollectionViewDataSource.h"
31+
#import <FirebaseUI/FirebaseArray.h>
32+
#import <FirebaseUI/FirebaseDataSource.h>
33+
#import <FirebaseUI/FirebaseTableViewDataSource.h>
34+
#import <FirebaseUI/FirebaseCollectionViewDataSource.h>
3535

3636
@interface FirebaseUI : NSObject
3737

FirebaseUI/Implementation/FirebaseCollectionViewDataSource.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ -(NSInteger)collectionView:(nonnull UICollectionView *)collectionView numberOfIt
154154
return [self.array count];
155155
}
156156

157-
- (void)populateCellWithBlock:(nonnull void(^)( __kindof UICollectionViewCell * _Nonnull cell, __kindof NSObject * _Nonnull object))callback;
157+
- (void)populateCellWithBlock:(__NON_NULL void(^)(UICollectionViewCell * __NON_NULL_PTR cell, NSObject * __NON_NULL_PTR object))callback;
158158
{
159159
self.populateCell = callback;
160160
}

FirebaseUI/Implementation/FirebaseTableViewDataSource.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
160160
return [self.array count];
161161
}
162162

163-
- (void)populateCellWithBlock:(nonnull void(^)( __kindof UITableViewCell * _Nonnull cell, __kindof NSObject * _Nonnull object))callback;
163+
- (void)populateCellWithBlock:(__NON_NULL void(^)(UITableViewCell * __NON_NULL_PTR cell, NSObject * __NON_NULL_PTR object))callback;
164164
{
165165
self.populateCell = callback;
166166
}

FirebaseUI/XCodeMacros.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Firebase UI Bindings iOS Library
3+
*
4+
* Copyright © 2015 Firebase - All Rights Reserved
5+
* https://www.firebase.com
6+
*
7+
* Redistribution and use in source and binary forms, with or without
8+
* modification, are permitted provided that the following conditions are met:
9+
*
10+
* 1. Redistributions of source code must retain the above copyright notice, this
11+
* list of conditions and the following disclaimer.
12+
*
13+
* 2. Redistributions in binaryform must reproduce the above copyright notice,
14+
* this list of conditions and the following disclaimer in the documentation
15+
* and/or other materials provided with the distribution.
16+
*
17+
* THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR
18+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
20+
* EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT,
21+
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22+
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25+
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26+
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
*/
28+
29+
#ifndef XCodeMacros_h
30+
#define XCodeMacros_h
31+
32+
#if __has_feature(nullability)
33+
# define __ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
34+
# define __ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
35+
# define __NULLABLE nullable
36+
# define __NULLABLE_PTR __nullable
37+
# define __NON_NULL nonnull
38+
# define __NON_NULL_PTR __nonnull
39+
#else
40+
# define __ASSUME_NONNULL_BEGIN
41+
# define __ASSUME_NONNULL_END
42+
# define __NULLABLE
43+
# define __NULLABLE_PTR
44+
# define __NON_NULL
45+
# define __NON_NULL_PTR
46+
#endif
47+
48+
#if __has_feature(objc_generics)
49+
# define __GENERIC(class, ...) class<__VA_ARGS__>
50+
# define __GENERIC_TYPE(type) type
51+
#else
52+
# define __GENERIC(class, ...) class
53+
# define __GENERIC_TYPE(type) id
54+
#endif
55+
56+
#endif /* XCodeMacros_h */

0 commit comments

Comments
 (0)