/
index.html
452 lines (319 loc) · 19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>iOS移动开发周报-第40期 | 唐巧的博客</title>
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
<meta name="author" content="唐巧">
<meta name="description" content="版权说明本文为 InfoQ 中文站特供稿件,文章地址是这里。如需转载,请与 InfoQ 中文站联系。 前言欢迎国内的iOS同行或技术作者向我提交周报线索,线索可以是新闻、教程、开发工具或开源项目,将相关文章的简介和链接在微博上发布并 @唐巧_boy 即可。 【摘要】:本期 iOS 移动开发周报带来如下内容:iOS 开发者收入调查报告、如何自己动手实现 KVO、QQ 中未读气泡拖拽消失的实现分析、I">
<meta property="og:type" content="article">
<meta property="og:title" content="iOS移动开发周报-第40期">
<meta property="og:url" content="https://blog.devtang.com/2015/03/10/ios-weekly-40/index.html">
<meta property="og:site_name" content="唐巧的博客">
<meta property="og:description" content="版权说明本文为 InfoQ 中文站特供稿件,文章地址是这里。如需转载,请与 InfoQ 中文站联系。 前言欢迎国内的iOS同行或技术作者向我提交周报线索,线索可以是新闻、教程、开发工具或开源项目,将相关文章的简介和链接在微博上发布并 @唐巧_boy 即可。 【摘要】:本期 iOS 移动开发周报带来如下内容:iOS 开发者收入调查报告、如何自己动手实现 KVO、QQ 中未读气泡拖拽消失的实现分析、I">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2015-03-10T04:48:50.000Z">
<meta property="article:modified_time" content="2020-02-08T18:08:22.165Z">
<meta property="article:author" content="唐巧">
<meta property="article:tag" content="iOS">
<meta property="article:tag" content="唐巧">
<meta property="article:tag" content="猿辅导">
<meta property="article:tag" content="开发">
<meta name="twitter:card" content="summary">
<link rel="alternative" href="/atom.xml" title="唐巧的博客" type="application/atom+xml">
<link rel="icon" href="/img/favicon.png">
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/%02.css">
<link rel="stylesheet" href="/.css">
<meta name="generator" content="Hexo 4.2.0"></head>
<body>
<header>
<div>
<div id="textlogo">
<h1 class="site-name"><a href="/" title="唐巧的博客">唐巧的博客</a></h1>
<h2 class="blog-motto">记录下自己学习的点滴</h2>
</div>
<div class="navbar"><a class="navbutton navmobile" href="#" title="菜单">
</a></div>
<nav class="animated">
<ul>
<ul>
<li><a href="/">首页</a></li>
<li><a href="/archives">归档</a></li>
<li><a href="/about">关于</a></li>
<li>
<form class="search" action="//google.com/search" method="get" accept-charset="utf-8">
<label>Search</label>
<input type="search" id="search" name="q" autocomplete="off" maxlength="20" placeholder="搜索" />
<input type="hidden" name="q" value="site:blog.devtang.com">
</form>
</li>
</ul>
</nav>
</div>
</header>
<div id="container">
<div id="main" class="post" itemscope itemprop="blogPost">
<article itemprop="articleBody">
<header class="article-info clearfix">
<h1 itemprop="name">
<a href="/2015/03/10/ios-weekly-40/" title="iOS移动开发周报-第40期" itemprop="url">iOS移动开发周报-第40期</a>
</h1>
<p class="article-time">
<time datetime="2015-03-10T04:48:50.000Z" itemprop="datePublished"> 发表于 2015-03-10 04:48</time>
</p>
</header>
<div class="article-content">
<div id="toc" class="toc-article">
<strong class="toc-title">文章目录</strong>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#版权说明"><span class="toc-number">1.</span> <span class="toc-text">版权说明</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#前言"><span class="toc-number">1.1.</span> <span class="toc-text">前言</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#新闻"><span class="toc-number">2.</span> <span class="toc-text">新闻</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#教程"><span class="toc-number">3.</span> <span class="toc-text">教程</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#工具"><span class="toc-number">4.</span> <span class="toc-text">工具</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#开源项目"><span class="toc-number">5.</span> <span class="toc-text">开源项目</span></a></li></ol>
</div>
<h2 id="版权说明"><a href="#版权说明" class="headerlink" title="版权说明"></a>版权说明</h2><p>本文为 InfoQ 中文站特供稿件,文章地址是<a href="http://www.infoq.com/cn/news/2015/03/implementation-of-kvo" target="_blank" rel="noopener">这里</a>。如需转载,请与 InfoQ 中文站联系。</p>
<h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>欢迎国内的iOS同行或技术作者向我提交周报线索,线索可以是新闻、教程、开发工具或开源项目,将相关文章的简介和链接在微博上发布并 <a href="http://weibo.com/tangqiaoboy" target="_blank" rel="noopener">@唐巧_boy</a> 即可。</p>
<p>【摘要】:本期 iOS 移动开发周报带来如下内容:iOS 开发者收入调查报告、如何自己动手实现 KVO、QQ 中未读气泡拖拽消失的实现分析、InfoQ 上移动端话题汇总、UIResponder 等。</p>
<h2 id="新闻"><a href="#新闻" class="headerlink" title="新闻"></a>新闻</h2><ol>
<li><p><a href="http://www.cocoachina.com/apple/20150306/11250.html" target="_blank" rel="noopener">《iPhone 6 再立功:中国区 iOS 份额历史新高》</a>:据来自 Kantar Worldpanel ComTech 的最新数据,截止至 2015 年一月的前三个月内,苹果 iOS 系统份额在中国区创历史新高,卖出的每四台智能手机就有一个是 iPhone。</p>
</li>
<li><p><a href="http://www.cocoachina.com/programmer/20150304/11205.html" target="_blank" rel="noopener">《iOS 开发者收入调查报告(一):个人开发者篇》</a>:2014 年 12 月,CocoaChina 以网上调查问卷形式发起了 “2014 iOS 开发者收入调查报告” 活动,得到了广大开发者的支持。在对问卷数据进行了整理分析后形成了本次调查报告,从而让我们对国内 iOS 开发者的收入和生存状态有一个大概的了解。本文是该调查的最终报告。</p>
</li>
</ol>
<h2 id="教程"><a href="#教程" class="headerlink" title="教程"></a>教程</h2><ol>
<li><p><a href="http://tech.glowing.com/cn/implement-kvo/" target="_blank" rel="noopener">《如何自己动手实现 KVO》</a>:KVO 是 Objective-C 对观察者模式(Observer Pattern)的实现。也是 Cocoa Binding 的基础。当被观察对象的某个属性发生更改时,观察者对象会获得通知。本文探究了 KVO (Key-Value Observing) 实现机制,并去实践一番:利用 Runtime 自己动手去实现 KVO 。</p>
</li>
<li><p><a href="http://kittenyang.com/drawablebubble/" target="_blank" rel="noopener">《QQ 中未读气泡拖拽消失的实现分析》</a>:QQ 中针对强迫症有个很棒的交互,对于那些暂时不想理会的未读信息气泡,可以直接手指拖拽去掉。本文介绍了其实现方法。</p>
</li>
<li><p><a href="http://t.cn/Rw3he5x" target="_blank" rel="noopener">《UITextView 编辑时插入自定义表情-简单的图文混编》</a>:在 iOS 开发中,经常需要用 UITextView 作为编辑文本的输入控件。但是如何在编辑时插入自定义表情呢?本文简单的用 NSTextAttachment、NSAttributedString 的特性,实现了在 UITextView 中编辑文字时插入自定义表情图片,同时可以返回带有表情 “替换符” 的纯文本字符串。</p>
</li>
<li><p><a href="http://tutuge.me/2015/02/19/%E6%8F%90%E5%8D%87UITableView%E6%80%A7%E8%83%BD-%E5%A4%8D%E6%9D%82%E9%A1%B5%E9%9D%A2%E7%9A%84%E4%BC%98%E5%8C%96/" target="_blank" rel="noopener">《提升 UITableView 性能-复杂页面的优化》</a>:随着 App 的用户界面的内容越来越丰富,再强的手机可能都无法同时渲染复杂的 UI 界面和保证流畅的体验。本文分享了一些提升 UITableView 性能的技巧。</p>
</li>
<li><p><a href="http://weibo.com/p/1001603816757822408978" target="_blank" rel="noopener">《InfoQ 上移动端话题汇总》</a>:<a href="http://weibo.com/ranwj" target="_blank" rel="noopener">@ 移动开发小冉</a> 整理了一下 InfoQ 上关于移动方面的分享内容,涉及移动端架构、测试、流程优化等多方面的内容。</p>
</li>
<li><p><a href="http://blog.csdn.net/zhengminwudi/article/details/43916791" target="_blank" rel="noopener">《 在非越狱的 iPhone 6 (iOS 8.1.3) 上进行钓鱼攻击 (盗取 App Store 密码)》</a>:iOS 逆向工程的一大应用场景是 iOS 安全。它既可以作为攻击的矛,也可以作为防御的盾。由蒸米带来的本文就是一则典型的以逆向工程为矛的案例,他对 CoreFoundation 里私有函数的运用画龙点睛,值得学习。</p>
</li>
<li><p><a href="http://southpeak.github.io/blog/2015/03/07/uiresponder/" target="_blank" rel="noopener">《UIResponder》</a>:在 UIKit 中,IApplication、UIView、UIViewController 这几个类都是直接继承自 UIResponder 类。另外 SpriteKit 中的 SKNode 也是继承自 UIResponder 类。因此 UIKit 中的视图、控件、视图控制器,以及我们自定义的视图及视图控制器都有响应事件的能力。本文详细介绍了一个 UIResponder 类提供的基本功能。</p>
</li>
<li><p><a href="http://blog.sunnyxx.com/2015/03/01/todo-macro/" target="_blank" rel="noopener">《实现一个 TODO 宏》</a>:文章介绍了如何实现一个能产生编译器警告的 TODO 宏,用于在代码里做备忘。</p>
</li>
</ol>
<p>##视频</p>
<ol>
<li><a href="http://jlongster.com/First-Impressions-using-React-Native" target="_blank" rel="noopener">《First Impressions using React Native》</a>:作者介绍了他使用 Facebook 即将开源的 React Native 的感受。</li>
</ol>
<h2 id="工具"><a href="#工具" class="headerlink" title="工具"></a>工具</h2><ol>
<li><p><a href="https://github.com/kstenerud/iOS-Universal-Framework" target="_blank" rel="noopener">iOS-Universal-Framework</a>:iOS-Universal-Framework 是一个方便你将第三方 SDK 编译成 Framework 的开源工具。</p>
</li>
<li><p><a href="http://facebook.github.io/origami/" target="_blank" rel="noopener">Origami</a>:Origami Live 支持在 iOS 设备上预览 Quartz Composer 项目,Origami 2.0 添加了导出 Objective-C、Java、JS 代码的功能,以后做原型效率更高了。由 <a href="http://weibo.com/lexrus" target="_blank" rel="noopener">@ 汤圣罡</a> 推荐。</p>
</li>
</ol>
<h2 id="开源项目"><a href="#开源项目" class="headerlink" title="开源项目"></a>开源项目</h2><ol>
<li><a href="link">NativeScript</a>:NativeScript 是一个类似 React Native 的开源框架,使用 JavaScript 调用原生 API,构建原生应用,支持 iOS、 Android 和 WP 等多平台。</li>
</ol>
</div>
<footer class="article-footer clearfix">
<div class="article-catetags">
<div class="article-categories">
<span></span>
<a class="article-category-link" href="/categories/iOS-weekly/">iOS weekly</a>
</div>
</div>
<div class="article-share" id="share">
<div data-url="https://blog.devtang.com/2015/03/10/ios-weekly-40/" data-title="iOS移动开发周报-第40期 | 唐巧的博客" data-tsina="" class="share clearfix">
</div>
</div>
</footer>
</article>
<nav class="article-nav clearfix">
<div class="prev" >
<a href="/2015/03/15/ios-dev-controversy-1/" title="iOS 开发中的争议(一)">
<strong>上一篇:</strong><br/>
<span>
iOS 开发中的争议(一)</span>
</a>
</div>
<div class="next">
<a href="/2015/02/28/tipping-point/" title="流行的方法论 - 读《引爆点》">
<strong>下一篇:</strong><br/>
<span>流行的方法论 - 读《引爆点》
</span>
</a>
</div>
</nav>
</div>
<div class="openaside"><a class="navbutton" href="#" title="显示侧边栏"></a></div>
<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="隐藏侧边栏"></a></div>
<aside class="clearfix">
<div class="sponsor">
</div>
<div class="categorieslist">
<p class="asidetitle">分类</p>
<ul>
<li><a href="/categories/books-summary/" title="books summary">books summary</a></li>
<li><a href="/categories/iOS/" title="iOS">iOS</a></li>
<li><a href="/categories/iOS-weekly/" title="iOS weekly">iOS weekly</a></li>
<li><a href="/categories/mac/" title="mac">mac</a></li>
<li><a href="/categories/shell/" title="shell">shell</a></li>
<li><a href="/categories/summary/" title="summary">summary</a></li>
</ul>
</div>
<div class="weixin">
<br />
<p class="asidetitle">微信公众号</p>
<p>关注我的微信公众号,和我一起成长:</p>
<img src="/images/weixin-qr.jpg" width="230px" />
</div>
<div class="rsspart">
<a href="/atom.xml" target="_blank" title="rss">RSS 订阅</a>
</div>
</aside>
</div>
</div>
<footer><div id="footer" >
<div class="social-font" class="clearfix">
</div>
<p class="copyright" style="margin-top: 10px;">
Powered by <a href="http://hexo.io" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/wuchong/jacman" target="_blank" title="Jacman">Jacman</a> © 2020
<a href="/about" target="_blank" title="唐巧">唐巧</a>
</p>
</div>
</footer>
<script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>
<script src="/js/jquery.qrcode-0.12.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.navbar').click(function(){
$('header nav').toggleClass('shownav');
});
var myWidth = 0;
function getSize(){
if( typeof( window.innerWidth ) == 'number' ) {
myWidth = window.innerWidth;
} else if( document.documentElement && document.documentElement.clientWidth) {
myWidth = document.documentElement.clientWidth;
};
};
var m = $('#main'),
a = $('#asidepart'),
c = $('.closeaside'),
o = $('.openaside');
c.click(function(){
a.addClass('fadeOut').css('display', 'none');
o.css('display', 'block').addClass('fadeIn');
m.addClass('moveMain');
});
o.click(function(){
o.css('display', 'none').removeClass('beforeFadeIn');
a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');
m.removeClass('moveMain');
});
$(window).scroll(function(){
o.css("top",Math.max(80,260-$(this).scrollTop()));
});
$(window).resize(function(){
getSize();
if (myWidth >= 1024) {
$('header nav').removeClass('shownav');
}else{
m.removeClass('moveMain');
a.css('display', 'block').removeClass('fadeOut');
o.css('display', 'none');
}
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
var ai = $('.article-content>iframe'),
ae = $('.article-content>embed'),
t = $('#toc'),
ta = $('#toc.toc-aside'),
o = $('.openaside'),
c = $('.closeaside');
if(ai.length>0){
ai.wrap('<div class="video-container" />');
};
if(ae.length>0){
ae.wrap('<div class="video-container" />');
};
c.click(function(){
ta.css('display', 'block').addClass('fadeIn');
});
o.click(function(){
ta.css('display', 'none');
});
$(window).scroll(function(){
ta.css("top",Math.max(140,320-$(this).scrollTop()));
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
var $this = $('.share'),
url = $this.attr('data-url'),
encodedUrl = encodeURIComponent(url),
title = $this.attr('data-title'),
tsina = $this.attr('data-tsina'),
description = $this.attr('description');
var html = [
'<div class="hoverqrcode clearfix"></div>',
'<a class="overlay" id="qrcode"></a>',
'<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
'<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
'<a href="#qrcode" class="article-share-qrcode" title="微信"></a>',
'<a href="http://widget.renren.com/dialog/share?resourceUrl=' + encodedUrl + '&srcUrl=' + encodedUrl + '&title=' + title +'" class="article-share-renren" target="_blank" title="人人"></a>',
'<a href="http://service.weibo.com/share/share.php?title='+title+'&url='+encodedUrl +'&ralateUid='+ tsina +'&searchPic=true&style=number' +'" class="article-share-weibo" target="_blank" title="微博"></a>',
'<span title="Share to"></span>'
].join('');
$this.append(html);
$('.hoverqrcode').hide();
var myWidth = 0;
function updatehoverqrcode(){
if( typeof( window.innerWidth ) == 'number' ) {
myWidth = window.innerWidth;
} else if( document.documentElement && document.documentElement.clientWidth) {
myWidth = document.documentElement.clientWidth;
};
var qrsize = myWidth > 1024 ? 200:100;
var options = {render: 'image', size: qrsize, fill: '#2ca6cb', text: url, radius: 0.5, quiet: 1};
var p = $('.article-share-qrcode').position();
$('.hoverqrcode').empty().css('width', qrsize).css('height', qrsize)
.css('left', p.left-qrsize/2+20).css('top', p.top-qrsize-10)
.qrcode(options);
};
$(window).resize(function(){
$('.hoverqrcode').hide();
});
$('.article-share-qrcode').click(function(){
updatehoverqrcode();
$('.hoverqrcode').toggle();
});
$('.article-share-qrcode').hover(function(){}, function(){
$('.hoverqrcode').hide();
});
});
</script>
<!-- Analytics Begin -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-28029597-1', '');
ga('send', 'pageview');
</script>
<!-- Analytics End -->
<!-- Totop Begin -->
<div id="totop">
<a title="返回顶部"><img src="/img/scrollup.png"/></a>
</div>
<script src="/js/totop.js"></script>
<!-- Totop End -->
<!-- MathJax Begin -->
<!-- mathjax config similar to math.stackexchange -->
<!-- MathJax End -->
<!-- Tiny_search Begin -->
<!-- Tiny_search End -->
</body>
</html>