Skip to content

Commit c2fa0e3

Browse files
committed
利用CocoaPods创建私有库
利用CocoaPods创建私有库
1 parent 85b444a commit c2fa0e3

File tree

8 files changed

+135
-0
lines changed

8 files changed

+135
-0
lines changed

ChinaDailyForiPad.xcodeproj/project.pbxproj

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
310D1C092074674700FF3CBE /* ChinaDailyForiPadTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 310D1C082074674700FF3CBE /* ChinaDailyForiPadTests.m */; };
1616
310D1C142074674700FF3CBE /* ChinaDailyForiPadUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 310D1C132074674700FF3CBE /* ChinaDailyForiPadUITests.m */; };
1717
31F697FA22462138001C9B1E /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 31F697F322462138001C9B1E /* ViewController.m */; };
18+
31F6981E224631AB001C9B1E /* backbutton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 31F69818224631AB001C9B1E /* backbutton@2x.png */; };
19+
31F6981F224631AB001C9B1E /* backbutton@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 31F69819224631AB001C9B1E /* backbutton@3x.png */; };
20+
31F69820224631AB001C9B1E /* girl.png in Resources */ = {isa = PBXBuildFile; fileRef = 31F6981A224631AB001C9B1E /* girl.png */; };
21+
31F69821224631AB001C9B1E /* JStoOC.html in Resources */ = {isa = PBXBuildFile; fileRef = 31F6981B224631AB001C9B1E /* JStoOC.html */; };
22+
31F69822224631AB001C9B1E /* webRefreshButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 31F6981C224631AB001C9B1E /* webRefreshButton@2x.png */; };
23+
31F69823224631AB001C9B1E /* webRefreshButton@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 31F6981D224631AB001C9B1E /* webRefreshButton@3x.png */; };
1824
/* End PBXBuildFile section */
1925

2026
/* Begin PBXContainerItemProxy section */
@@ -52,6 +58,12 @@
5258
31F697F122462138001C9B1E /* PrefixHeader.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = "<group>"; };
5359
31F697F222462138001C9B1E /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
5460
31F697F322462138001C9B1E /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
61+
31F69818224631AB001C9B1E /* backbutton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "backbutton@2x.png"; sourceTree = "<group>"; };
62+
31F69819224631AB001C9B1E /* backbutton@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "backbutton@3x.png"; sourceTree = "<group>"; };
63+
31F6981A224631AB001C9B1E /* girl.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = girl.png; sourceTree = "<group>"; };
64+
31F6981B224631AB001C9B1E /* JStoOC.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = JStoOC.html; sourceTree = "<group>"; };
65+
31F6981C224631AB001C9B1E /* webRefreshButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "webRefreshButton@2x.png"; sourceTree = "<group>"; };
66+
31F6981D224631AB001C9B1E /* webRefreshButton@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "webRefreshButton@3x.png"; sourceTree = "<group>"; };
5567
/* End PBXFileReference section */
5668

5769
/* Begin PBXFrameworksBuildPhase section */
@@ -102,6 +114,7 @@
102114
310D1BEE2074674600FF3CBE /* ChinaDailyForiPad */ = {
103115
isa = PBXGroup;
104116
children = (
117+
31F69817224631AB001C9B1E /* Resource */,
105118
31F697EC22462138001C9B1E /* WebView */,
106119
310D1BEF2074674600FF3CBE /* AppDelegate.h */,
107120
310D1BF02074674600FF3CBE /* AppDelegate.m */,
@@ -142,6 +155,19 @@
142155
path = WebView;
143156
sourceTree = SOURCE_ROOT;
144157
};
158+
31F69817224631AB001C9B1E /* Resource */ = {
159+
isa = PBXGroup;
160+
children = (
161+
31F69818224631AB001C9B1E /* backbutton@2x.png */,
162+
31F69819224631AB001C9B1E /* backbutton@3x.png */,
163+
31F6981A224631AB001C9B1E /* girl.png */,
164+
31F6981B224631AB001C9B1E /* JStoOC.html */,
165+
31F6981C224631AB001C9B1E /* webRefreshButton@2x.png */,
166+
31F6981D224631AB001C9B1E /* webRefreshButton@3x.png */,
167+
);
168+
path = Resource;
169+
sourceTree = SOURCE_ROOT;
170+
};
145171
/* End PBXGroup section */
146172

147173
/* Begin PBXNativeTarget section */
@@ -249,8 +275,14 @@
249275
buildActionMask = 2147483647;
250276
files = (
251277
310D1BFC2074674600FF3CBE /* LaunchScreen.storyboard in Resources */,
278+
31F69823224631AB001C9B1E /* webRefreshButton@3x.png in Resources */,
279+
31F6981F224631AB001C9B1E /* backbutton@3x.png in Resources */,
280+
31F69821224631AB001C9B1E /* JStoOC.html in Resources */,
252281
310D1BF92074674600FF3CBE /* Assets.xcassets in Resources */,
253282
310D1BF72074674600FF3CBE /* Main.storyboard in Resources */,
283+
31F69822224631AB001C9B1E /* webRefreshButton@2x.png in Resources */,
284+
31F6981E224631AB001C9B1E /* backbutton@2x.png in Resources */,
285+
31F69820224631AB001C9B1E /* girl.png in Resources */,
254286
);
255287
runOnlyForDeploymentPostprocessing = 0;
256288
};

Resource/JStoOC.html

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
2+
<!DOCTYPE html>
3+
4+
<head>
5+
<title>JS交互OC</title>
6+
<meta charset="utf-8">
7+
</head>
8+
9+
<!-- CSS语法-->
10+
<style type='text/css'>
11+
img{
12+
cursor:pointer;
13+
}
14+
</style>
15+
16+
<body>
17+
18+
<h2 style="text-align:center">Welcome To You</h2>
19+
20+
<!-- 图片-->
21+
<p style="text-align:center"> <img src="https://upload.jianshu.io/users/upload_avatars/1708447/fe2c67e7-25f7-4e2e-a321-a5d517c124aa.jpeg?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240" id= "pictureId" width="128" height="128" align="middle" onclick="clickImage();" /> </p>
22+
23+
<p style="text-align: center ;background-color: #e6b500"> 且行且珍惜_iOS </p>
24+
25+
<p style="text-align:center"> <a href="https://www.jianshu.com/u/e15d1f644bea">简书主页</a> </p>
26+
27+
<p style="text-align:center"> <a href="github://callName_?https://github.com/wsl2ls">Github主页</a> :通过截获URL调用OC</p>
28+
29+
<p style="text-align:center"> <a href="http://www.chinadaily.com.cn">中国日报网 </a> </p>
30+
31+
<p style="text-align:center"> <button id="btn1" type = "button" onclick = "jsToOcFunction1()" > JS调用OC:不带参数 </button> </p>
32+
33+
<p style="text-align:center"> <button id="btn2" type = "button" onclick = "jsToOcFunction2()"> JS调用OC:带参数 </button> </p>
34+
35+
<p style="text-align:center"> <button id="btn3" type = "button" onclick = "showAlert()" > oc捕获到html的弹出框 </button> </p>
36+
37+
<!-- 音频-->
38+
<p style="text-align:center"> <audio controls="controls" height="100" width="100">
39+
<source src="http://up.mcyt.net/?down/47548.mp3" type="audio/mp3" />
40+
<source src="http://up.mcyt.net/?down/47548.ogg" type="audio/ogg" />
41+
<embed height="100" width="100" src="http://up.mcyt.net/?down/47548.mp3" />
42+
</audio> </p>
43+
44+
<!-- 视频-->
45+
<p style="text-align:center"> <video width="320" height="240" controls="controls" preload="auto" poster="http://a.hiphotos.baidu.com/zhidao/pic/item/0d338744ebf81a4cd90f1d3ad72a6059252da600.jpg">
46+
<source src="http://baobab.kaiyanapp.com/api/v1/playUrl?vid=39183&editionType=normal&source=qcloud" type="video/mp4" />
47+
<source src="http://baobab.kaiyanapp.com/api/v1/playUrl?vid=39183&editionType=normal&source=qcloud" type="video/ogg" />
48+
<source src="http://baobab.wdjcdn.com/1455782903700jy" type="video/webm" />
49+
<object data="http://baobab.kaiyanapp.com/api/v1/playUrl?vid=39183&editionType=normal&source=qcloud" width="320" height="240">
50+
<embed src="http://baobab.kaiyanapp.com/api/v1/playUrl?vid=39183&editionType=normal&source=qcloud" width="320" height="240" />
51+
</object>
52+
</video> </p>
53+
54+
<!-- JS语法-->
55+
<script type = "text/javascript">
56+
57+
function jsToOcFunction1()
58+
{
59+
window.webkit.messageHandlers.jsToOcNoPrams.postMessage({});
60+
}
61+
62+
function jsToOcFunction2()
63+
{
64+
window.webkit.messageHandlers.jsToOcWithPrams.postMessage({"params":"我是参数"});
65+
}
66+
67+
function showAlert()
68+
{
69+
alert("被OC截获到了");
70+
}
71+
72+
//图片点击事件
73+
function clickImage()
74+
{
75+
alert("欢迎你关注我!点击了图片");
76+
}
77+
78+
//OC调用JS改变背景色
79+
function changeColor()
80+
{
81+
document.body.style.backgroundColor = randomColor();
82+
}
83+
84+
//随机生成颜色
85+
function randomColor()
86+
{
87+
var r=Math.floor(Math.random()*256);
88+
var g=Math.floor(Math.random()*256);
89+
var b=Math.floor(Math.random()*256);
90+
return "rgb("+r+','+g+','+b+")";//所有方法的拼接都可以用ES6新特性`其他字符串{$变量名}`替换
91+
}
92+
93+
// 切换图片
94+
function changePicture(id, path) {
95+
var image = document.getElementById(id);
96+
image.src = path;
97+
}
98+
99+
</script>
100+
101+
</body>
102+
103+
</html>

Resource/backbutton@2x.png

3.24 KB
Loading

Resource/backbutton@3x.png

3.54 KB
Loading

Resource/girl.png

194 KB
Loading

Resource/webRefreshButton@2x.png

3.46 KB
Loading

Resource/webRefreshButton@3x.png

3.85 KB
Loading

0 commit comments

Comments
 (0)