Skip to content

Commit adaf9c2

Browse files
committed
iOS组件化开发 - 私有库
iOS组件化开发 - 私有库
1 parent 07ab2cc commit adaf9c2

File tree

6 files changed

+540
-2
lines changed

6 files changed

+540
-2
lines changed

ChinaDailyForiPad.xcodeproj/project.pbxproj

+16
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
310D1BFF2074674600FF3CBE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 310D1BFE2074674600FF3CBE /* main.m */; };
1515
310D1C092074674700FF3CBE /* ChinaDailyForiPadTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 310D1C082074674700FF3CBE /* ChinaDailyForiPadTests.m */; };
1616
310D1C142074674700FF3CBE /* ChinaDailyForiPadUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 310D1C132074674700FF3CBE /* ChinaDailyForiPadUITests.m */; };
17+
312411E122476A120078543D /* SLWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 312411E022476A120078543D /* SLWebViewController.m */; };
1718
31F6981E224631AB001C9B1E /* backbutton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 31F69818224631AB001C9B1E /* backbutton@2x.png */; };
1819
31F6981F224631AB001C9B1E /* backbutton@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 31F69819224631AB001C9B1E /* backbutton@3x.png */; };
1920
31F69820224631AB001C9B1E /* girl.png in Resources */ = {isa = PBXBuildFile; fileRef = 31F6981A224631AB001C9B1E /* girl.png */; };
@@ -54,6 +55,9 @@
5455
310D1C0F2074674700FF3CBE /* ChinaDailyForiPadUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ChinaDailyForiPadUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5556
310D1C132074674700FF3CBE /* ChinaDailyForiPadUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ChinaDailyForiPadUITests.m; sourceTree = "<group>"; };
5657
310D1C152074674700FF3CBE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
58+
312411DE22476A120078543D /* SLPrefixHeader.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SLPrefixHeader.pch; sourceTree = "<group>"; };
59+
312411DF22476A120078543D /* SLWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SLWebViewController.h; sourceTree = "<group>"; };
60+
312411E022476A120078543D /* SLWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SLWebViewController.m; sourceTree = "<group>"; };
5761
31F69818224631AB001C9B1E /* backbutton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "backbutton@2x.png"; sourceTree = "<group>"; };
5862
31F69819224631AB001C9B1E /* backbutton@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "backbutton@3x.png"; sourceTree = "<group>"; };
5963
31F6981A224631AB001C9B1E /* girl.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = girl.png; sourceTree = "<group>"; };
@@ -110,6 +114,7 @@
110114
310D1BEE2074674600FF3CBE /* ChinaDailyForiPad */ = {
111115
isa = PBXGroup;
112116
children = (
117+
312411DD22476A120078543D /* WebView */,
113118
31F69817224631AB001C9B1E /* Resource */,
114119
310D1BEF2074674600FF3CBE /* AppDelegate.h */,
115120
310D1BF02074674600FF3CBE /* AppDelegate.m */,
@@ -140,6 +145,16 @@
140145
path = ChinaDailyForiPadUITests;
141146
sourceTree = "<group>";
142147
};
148+
312411DD22476A120078543D /* WebView */ = {
149+
isa = PBXGroup;
150+
children = (
151+
312411DE22476A120078543D /* SLPrefixHeader.pch */,
152+
312411DF22476A120078543D /* SLWebViewController.h */,
153+
312411E022476A120078543D /* SLWebViewController.m */,
154+
);
155+
path = WebView;
156+
sourceTree = "<group>";
157+
};
143158
31F69817224631AB001C9B1E /* Resource */ = {
144159
isa = PBXGroup;
145160
children = (
@@ -292,6 +307,7 @@
292307
isa = PBXSourcesBuildPhase;
293308
buildActionMask = 2147483647;
294309
files = (
310+
312411E122476A120078543D /* SLWebViewController.m in Sources */,
295311
310D1BFF2074674600FF3CBE /* main.m in Sources */,
296312
310D1BF12074674600FF3CBE /* AppDelegate.m in Sources */,
297313
);

ChinaDailyForiPad/AppDelegate.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import "AppDelegate.h"
10-
#import "ViewController.h"
10+
#import "SLWebViewController.h"
1111

1212
@interface AppDelegate ()
1313

@@ -20,7 +20,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
2020

2121
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
2222

23-
ViewController * vc = [[ViewController alloc] init];
23+
SLWebViewController * vc = [[SLWebViewController alloc] init];
2424
UINavigationController * na = [[UINavigationController alloc] initWithRootViewController:vc];
2525
self.window.rootViewController = na;
2626
[self.window makeKeyAndVisible];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// PrefixHeader.pch
3+
//
4+
// Created by 王双龙 on 2018/3/30.
5+
// Copyright © 2018年 https://www.jianshu.com/u/e15d1f644bea All rights reserved.
6+
//
7+
8+
#ifndef PrefixHeader_pch
9+
#define PrefixHeader_pch
10+
11+
12+
//竖屏幕宽高
13+
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
14+
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
15+
16+
//设备型号
17+
#define iPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
18+
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
19+
#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)
20+
#define iPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)
21+
#define iPhone6PlusScale ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2001), [[UIScreen mainScreen] currentMode].size) : NO)
22+
#define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
23+
24+
//导航栏
25+
#define StatusBarHeight (iPhoneX ? 44.f : 20.f)
26+
#define StatusBarAndNavigationBarHeight (iPhoneX ? 88.f : 64.f)
27+
#define TabbarHeight (iPhoneX ? (49.f + 34.f) : (49.f))
28+
#define BottomSafeAreaHeight (iPhoneX ? (34.f) : (0.f))
29+
30+
31+
32+
33+
34+
35+
#endif /* PrefixHeader_pch */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// ViewController.h
3+
// ChinaDailyForiPad
4+
//
5+
// Created by 王双龙 on 2018/4/4.
6+
// Copyright © 2018年 https://www.jianshu.com/u/e15d1f644bea All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface SLWebViewController: UIViewController
12+
13+
14+
@end
15+

0 commit comments

Comments
 (0)