Skip to content
This repository was archived by the owner on Jan 24, 2019. It is now read-only.

Commit f6f0650

Browse files
committed
add system info
1 parent ae7b5e7 commit f6f0650

7 files changed

Lines changed: 180 additions & 187 deletions

File tree

Example/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ PODS:
33
- OrangeFramework (0.1.0):
44
- OrangeFramework/Dependency (= 0.1.0)
55
- OrangeFramework/Extensions (= 0.1.0)
6-
- OrangeFramework/Helper (= 0.1.0)
76
- OrangeFramework/Log (= 0.1.0)
87
- OrangeFramework/Segue (= 0.1.0)
8+
- OrangeFramework/SystemInfo (= 0.1.0)
99
- OrangeFramework/Dependency (0.1.0)
1010
- OrangeFramework/Extensions (0.1.0)
11-
- OrangeFramework/Helper (0.1.0)
1211
- OrangeFramework/Log (0.1.0)
1312
- OrangeFramework/Segue (0.1.0)
13+
- OrangeFramework/SystemInfo (0.1.0)
1414
- Quick (0.8.0)
1515

1616
DEPENDENCIES:
@@ -24,7 +24,7 @@ EXTERNAL SOURCES:
2424

2525
SPEC CHECKSUMS:
2626
Nimble: 4c353d43735b38b545cbb4cb91504588eb5de926
27-
OrangeFramework: 58c291a6a9b8e34470ecff64203b76df6ee034da
27+
OrangeFramework: eefc467b5f89a9ddf78c220ac219030e9b57d0e5
2828
Quick: 563d0f6ec5f72e394645adb377708639b7dd38ab
2929

3030
COCOAPODS: 0.39.0

OrangeFramework.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Pod::Spec.new do |s|
2020
s.license = 'MIT'
2121
s.author = { "Roman Kulesha" => "kulesha.r@gmail.com" }
2222
s.source = { :git => "https://github.com/kuler90/OrangeFramework.git", :tag => s.version.to_s }
23-
s.default_subspecs = 'Dependency', 'Log', 'Segue', 'Extensions', 'Helper'
23+
s.default_subspecs = 'Dependency', 'Log', 'SystemInfo', 'Extensions', 'Segue'
2424
s.platform = :ios, '8.0'
2525
s.requires_arc = true
2626
s.xcconfig = { 'SWIFT_INSTALL_OBJC_HEADER' => 'NO', 'EMBEDDED_CONTENT_CONTAINS_SWIFT' => 'NO' }
@@ -41,8 +41,8 @@ Pod::Spec.new do |s|
4141
ss.source_files = 'OrangeFramework/Extensions/**/*'
4242
end
4343

44-
s.subspec 'Helper' do |ss|
45-
ss.source_files = 'OrangeFramework/Helper/**/*'
44+
s.subspec 'SystemInfo' do |ss|
45+
ss.source_files = 'OrangeFramework/SystemInfo/**/*'
4646
end
4747

4848
end

OrangeFramework/Helper/OFHelper.h

Lines changed: 0 additions & 55 deletions
This file was deleted.

OrangeFramework/Helper/OFHelper.m

Lines changed: 0 additions & 126 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#import <UIKit/UIKit.h>
2+
3+
#define OFSystemInfo [_OFSystemInfo sharedInfo]
4+
5+
NS_ASSUME_NONNULL_BEGIN
6+
7+
@interface _OFSystemInfo : NSObject
8+
9+
+ (instancetype)sharedInfo;
10+
11+
#pragma mark - UI
12+
13+
@property (readonly) CGFloat screenScale;
14+
@property (readonly) CGFloat screenWidth;
15+
@property (readonly) CGFloat screenHeight;
16+
@property (readonly) CGFloat screenMaxLength;
17+
@property (readonly) CGFloat screenMinLength;
18+
@property (readonly) CGFloat screenPixelLength;
19+
20+
@property (readonly) CGFloat heightForStatusBar;;
21+
@property (readonly) CGFloat heightForNavBarPortrate;
22+
@property (readonly) CGFloat heightForNavBarLandscape;
23+
@property (readonly) CGFloat heightForTabBar;
24+
25+
#pragma mark - Device
26+
27+
@property (readonly) BOOL isIPhone;;
28+
@property (readonly) BOOL isIPhone_35Inch;
29+
@property (readonly) BOOL isIPhone_4Inch;
30+
@property (readonly) BOOL isIPhone_47Inch;
31+
@property (readonly) BOOL isIPhone_55Inch;
32+
33+
@property (readonly) BOOL isIPad;
34+
@property (readonly) BOOL isAppleTV;
35+
36+
#pragma mark - System
37+
38+
@property (readonly) NSString *pathToDocuments;
39+
@property (readonly) NSString *pathToCaches;
40+
41+
@property (readonly) BOOL isIOS7;
42+
@property (readonly) BOOL isIOS8;
43+
@property (readonly) BOOL isIOS9;
44+
45+
- (BOOL)systemVersionEqualTo:(NSString *)version;
46+
- (BOOL)systemVersionLessThan:(NSString *)version;
47+
- (BOOL)systemVersionGreaterThan:(NSString *)version;
48+
49+
@end
50+
51+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)