File tree 1 file changed +21
-0
lines changed 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * System Versioning Preprocessor Macros
3
+ */
4
+ #define SYSTEM_VERSION_EQUAL_TO (v ) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
5
+ #define SYSTEM_VERSION_GREATER_THAN (v ) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
6
+ #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO (v ) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
7
+ #define SYSTEM_VERSION_LESS_THAN (v ) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
8
+ #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO (v ) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
9
+
10
+ /*
11
+ * Usage sample:
12
+
13
+ if (SYSTEM_VERSION_LESS_THAN(@"4.0")) {
14
+ ...
15
+ }
16
+
17
+ if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"3.1.1")) {
18
+ ...
19
+ }
20
+
21
+ */
You can’t perform that action at this time.
0 commit comments