-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatom.xml
1439 lines (1202 loc) · 201 KB
/
atom.xml
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
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Jey</title>
<subtitle>Keep Calm and Carry On</subtitle>
<link href="/atom.xml" rel="self"/>
<link href="http://www.jeyblogs.com/"/>
<updated>2017-03-22T01:52:18.000Z</updated>
<id>http://www.jeyblogs.com/</id>
<author>
<name>Jey.yuan</name>
</author>
<generator uri="http://hexo.io/">Hexo</generator>
<entry>
<title>地图坐标转换</title>
<link href="http://www.jeyblogs.com/2017/03/22/%E5%9C%B0%E5%9B%BE%E5%9D%90%E6%A0%87%E8%BD%AC%E6%8D%A2/"/>
<id>http://www.jeyblogs.com/2017/03/22/地图坐标转换/</id>
<published>2017-03-22T01:48:47.000Z</published>
<updated>2017-03-22T01:52:18.000Z</updated>
<content type="html"><![CDATA[<pre><code>//
// CLLocation+YCLocation.h
// Topevery.GPS 转换
//
// Created by wangshuai on 15-5-10.
// Copyright (c) 2015年 wangshuai. All rights reserved.
// 火星坐标系转换扩展
/*
从 CLLocationManager 取出来的经纬度放到 mapView 上显示,是错误的!
从 CLLocationManager 取出来的经纬度去 Google Maps API 做逆地址解析,当然是错的!
从 MKMapView 取出来的经纬度去 Google Maps API 做逆地址解析终于对了。去百度地图API做逆地址解析,依旧是错的!
从上面两处取的经纬度放到百度地图上显示都是错的!错的!的!
分为 地球坐标,火星坐标(iOS mapView 高德 , 国内google ,搜搜、阿里云 都是火星坐标),百度坐标(百度地图数据主要都是四维图新提供的)
火星坐标: MKMapView
地球坐标: CLLocationManager
当用到CLLocationManager 得到的数据转化为火星坐标, MKMapView不用处理
API 坐标系
百度地图API 百度坐标
腾讯搜搜地图API 火星坐标
搜狐搜狗地图API 搜狗坐标
阿里云地图API 火星坐标
图吧MapBar地图API 图吧坐标
高德MapABC地图API 火星坐标
灵图51ditu地图API 火星坐标
*/
import <CoreLocation/CoreLocation.h>
@interface CLLocation (YCLocation)
//从地图坐标转化到火星坐标
(CLLocation*)locationMarsFromEarth;
//从火星坐标转化到百度坐标
(CLLocation*)locationBaiduFromMars;
//从百度坐标到火星坐标
(CLLocation*)locationMarsFromBaidu;
//从火星坐标到地图坐标
(CLLocation*)locationEarthFromMars;
//从百度坐标到地图坐标
(CLLocation*)locationEarthFromBaidu;
@end
import "CLLocation+YCLocation.h"
void transform_earth_from_mars(double lat, double lng, double* tarLat, double* tarLng);
void transform_mars_from_baidu(double lat, double lng, double* tarLat, double* tarLng);
void transform_baidu_from_mars(double lat, double lng, double* tarLat, double* tarLng);
@implementation CLLocation (YCLocation)
(CLLocation*)locationMarsFromEarth
{
double lat = 0.0;
double lng = 0.0;
transform_earth_from_mars(self.coordinate.latitude, self.coordinate.longitude, &lat, &lng);
return [[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake(lat+self.coordinate.latitude, lng+self.coordinate.longitude)
altitude:self.altitude
horizontalAccuracy:self.horizontalAccuracy
verticalAccuracy:self.verticalAccuracy
course:self.course
speed:self.speed
timestamp:self.timestamp];
}
(CLLocation*)locationEarthFromMars
{
double lat = 0.0;
double lng = 0.0;
transform_earth_from_mars(self.coordinate.latitude, self.coordinate.longitude, &lat, &lng);
return [[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake(self.coordinate.latitude-lat, self.coordinate.longitude-lng)
altitude:self.altitude
horizontalAccuracy:self.horizontalAccuracy
verticalAccuracy:self.verticalAccuracy
course:self.course
speed:self.speed
timestamp:self.timestamp];
return nil;
}
(CLLocation*)locationBaiduFromMars
{
double lat = 0.0;
double lng = 0.0;
transform_mars_from_baidu(self.coordinate.latitude, self.coordinate.longitude, &lat, &lng);
return [[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake(lat, lng)
altitude:self.altitude
horizontalAccuracy:self.horizontalAccuracy
verticalAccuracy:self.verticalAccuracy
course:self.course
speed:self.speed
timestamp:self.timestamp];
}
(CLLocation*)locationMarsFromBaidu
{
double lat = 0.0;
double lng = 0.0;
transform_baidu_from_mars(self.coordinate.latitude, self.coordinate.longitude, &lat, &lng);
return [[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake(lat, lng)
altitude:self.altitude
horizontalAccuracy:self.horizontalAccuracy
verticalAccuracy:self.verticalAccuracy
course:self.course
speed:self.speed
timestamp:self.timestamp];
}
-(CLLocation*)locationEarthFromBaidu
{
double lat = 0.0;
double lng = 0.0;
CLLocation *Mars = [self locationMarsFromBaidu];
transform_earth_from_mars(Mars.coordinate.latitude, Mars.coordinate.longitude, &lat, &lng);
return [[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake(Mars.coordinate.latitude-lat, Mars.coordinate.longitude-lng)
altitude:self.altitude
horizontalAccuracy:self.horizontalAccuracy
verticalAccuracy:self.verticalAccuracy
course:self.course
speed:self.speed
timestamp:self.timestamp];
return nil;
}
@end
// --- transform_earth_from_mars ---
// 参考来源:https://on4wp7.codeplex.com/SourceControl/changeset/view/21483#353936
// Krasovsky 1940
//
// a = 6378245.0, 1/f = 298.3
// b = a * (1 - f)
// ee = (a^2 - b^2) / a^2;
const double a = 6378245.0;
const double ee = 0.00669342162296594323;
bool transform_sino_out_china(double lat, double lon)
{
if (lon < 72.004 || lon > 137.8347)
return true;
if (lat < 0.8293 || lat > 55.8271)
return true;
return false;
}
double transform_earth_from_mars_lat(double x, double y)
{
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * sqrt(abs(x));
ret += (20.0 * sin(6.0 * x * M_PI) + 20.0 * sin(2.0 * x * M_PI)) * 2.0 / 3.0;
ret += (20.0 * sin(y * M_PI) + 40.0 * sin(y / 3.0 * M_PI)) * 2.0 / 3.0;
ret += (160.0 * sin(y / 12.0 * M_PI) + 320 * sin(y * M_PI / 30.0)) * 2.0 / 3.0;
return ret;
}
double transform_earth_from_mars_lng(double x, double y)
{
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * sqrt(abs(x));
ret += (20.0 * sin(6.0 * x * M_PI) + 20.0 * sin(2.0 * x * M_PI)) * 2.0 / 3.0;
ret += (20.0 * sin(x * M_PI) + 40.0 * sin(x / 3.0 * M_PI)) * 2.0 / 3.0;
ret += (150.0 * sin(x / 12.0 * M_PI) + 300.0 * sin(x / 30.0 * M_PI)) * 2.0 / 3.0;
return ret;
}
void transform_earth_from_mars(double lat, double lng, double* tarLat, double* tarLng)
{
if (transform_sino_out_china(lat, lng))
{
*tarLat = lat;
*tarLng = lng;
return;
}
double dLat = transform_earth_from_mars_lat(lng - 105.0, lat - 35.0);
double dLon = transform_earth_from_mars_lng(lng - 105.0, lat - 35.0);
double radLat = lat / 180.0 * M_PI;
double magic = sin(radLat);
magic = 1 - ee * magic * magic;
double sqrtMagic = sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * M_PI);
dLon = (dLon * 180.0) / (a / sqrtMagic * cos(radLat) * M_PI);
*tarLat = dLat;
*tarLng = dLon;
}
// --- transform_earth_from_mars end ---
// --- transform_mars_vs_bear_paw ---
// 参考来源:http://blog.woodbunny.com/post-68.html
const double x_pi = M_PI * 3000.0 / 180.0;
void transform_mars_from_baidu(double gg_lat, double gg_lon, double *bd_lat, double *bd_lon)
{
double x = gg_lon, y = gg_lat;
double z = sqrt(x * x + y * y) + 0.00002 * sin(y * x_pi);
double theta = atan2(y, x) + 0.000003 * cos(x * x_pi);
*bd_lon = z * cos(theta) + 0.0065;
*bd_lat = z * sin(theta) + 0.006;
}
void transform_baidu_from_mars(double bd_lat, double bd_lon, double *gg_lat, double *gg_lon)
{
double x = bd_lon - 0.0065, y = bd_lat - 0.006;
double z = sqrt(x * x + y * y) - 0.00002 * sin(y * x_pi);
double theta = atan2(y, x) - 0.000003 * cos(x * x_pi);
*gg_lon = z * cos(theta);
*gg_lat = z * sin(theta);
}
</code></pre>]]></content>
<summary type="html">
<pre><code>//
// CLLocation+YCLocation.h
// Topevery.GPS 转换
//
// Created by wangshuai on 15-5-10.
// Copyright (c) 2015年 wangshuai. All
</summary>
<category term="iOSDeveloper" scheme="http://www.jeyblogs.com/categories/iOSDeveloper/"/>
<category term="地图" scheme="http://www.jeyblogs.com/tags/%E5%9C%B0%E5%9B%BE/"/>
</entry>
<entry>
<title>iOS面试题答案</title>
<link href="http://www.jeyblogs.com/2016/10/28/%E9%9D%A2%E8%AF%95%E9%A2%98%E7%AD%94%E6%A1%88/"/>
<id>http://www.jeyblogs.com/2016/10/28/面试题答案/</id>
<published>2016-10-28T15:20:38.000Z</published>
<updated>2017-03-01T02:46:09.000Z</updated>
<content type="html"><![CDATA[<p>基础:<br>1.<br>2.ios中实现callback可以通过两种方法,委托和NSNotification<br>委托的话是一对一的关系,例如一个UIViewController里有一个tableView, 将该viewController设置为tableView的委托,tableView执行的时候调用委托的函数,同时可能需要得到反馈,比如tableView通过调用delegate中rowsOfSections函数来得到该tableView的行数,调用委托函数的时候也可能不需要反馈,例如UIApplication的在AppDelegate中的生命周期函数,还有UIScrollView的didScroll之类委托函数。委托的意思是有些方法不在类本身实现,而是在另一个类中实现。<br>NSNotification的话是一对多的关系,notification发出去以后发送方就不管了,接不接收以及接收后做什么发送方就不管了。</p>
<p>委托的实现:<br>一般来说通过delegate来实现,但是apple引入block后通过block也可以实现委托。二者区别是,如果有一堆接口的话可以用delegate,例如UITableView的delegate,因为它需要通过委托知tableView有多少个section,每个section有多少row,每个row的cell是什么;但是如果是调用方和block的执行结果有直接因果关系,用block就比较合适,例如UIView animation方法中的complete block,动画结束后直接执行block中的逻辑,当然complete block也可以通过delegate实现,实现方法是给UIView设定一个delegate,动画结束后UIView调用delegate中的方法。<br>ps:delegate实现的过程中需要指定的类来实现特定的protocol。<br>block, 本质是封装了一段代码,可以被当做对象使用(可以定义成Property)。<br>3.<br>static Singleton* _instance = nil;</p>
<p>+(instancetype) shareInstance<br>{<br> static dispatch_once_t onceToken ;<br> dispatch_once(&onceToken, ^{<br> _instance = [[super allocWithZone:NULL]() init] ;<br> }) ;</p>
<pre><code>return _instance ;
</code></pre><p>}</p>
<p>+(id) allocWithZone:(struct _NSZone *)zone<br>{<br> return <a href="">Singleton shareInstance</a> ;<br>}</p>
<p>-(id) copyWithZone:(struct _NSZone *)zone<br>{<br> return <a href="">Singleton shareInstance</a> ;<br>}<br>4.<br>assign:用于对基本数据类型进行赋值操作,不更改引用计数。也可以用来修饰对象,但是,被assign修饰的对象在释放后,指针的地址还是存在的,也就是说指针并没有被置为nil,成为野指针。如果后续在分配对象到堆上的某块内存时,正好分到这块地址,程序就会crash。之所以可以修饰基本数据类型,因为基本数据类型一般分配在栈上,栈的内存会由系统自动处理,不会造成野指针。<br>weak:修饰Object类型,修饰的对象在释放后,指针地址会被置为nil,是一种弱引用。在ARC环境下,为避免循环引用,往往会把delegate属性用weak修饰;在MRC下使用assign修饰。weak和strong不同的是:当一个对象不再有strong类型的指针指向它的时候,它就会被释放,即使还有weak型指针指向它,那么这些weak型指针也将被清除。<br>ARC下的strong等同于MRC下的retain都会把对象引用计数加1。<br>copy:会在内存里拷贝一份对象,两个指针指向不同的内存地址。一般用来修饰NSString等有对应可变类型的对象,因为他们有可能和对应的可变类型(NSMutableString)之间进行赋值操作,为确保对象中的字符串不被修改 ,应该在设置属性是拷贝一份。而若用strong修饰,如果对象在外部被修改了,会影响到属性。</p>
<p>block属性为什么需要用copy来修饰?<br>因为在MRC下,block在创建的时候,它的内存是分配在栈(stack)上的,而不是在堆(heap)上,可能被随时回收。他本身的作于域是属于创建时候的作用域,一旦在创建时候的作用域外面调用block将导致程序崩溃。通过copy可以把block拷贝(copy)到堆,保证block的声明域外使用。在ARC下写不写都行,编译器会自动对block进行copy操作。<br><strong>block与</strong>weak的区别<br>• <strong>block:在ARC和MRC下都可用,可修饰对象,也可以修饰基本数据类型。<br>• </strong>block对象可以在block被重新赋值,<strong>weak不可以。<br>• </strong>weak:只在ARC中使用,只能修饰对象,不能修饰基本数据类型(int、bool)。<br>• 同时,在ARC下,要避免block出现循环引用,经常会:<strong>weak typedof(self) weakSelf = self;</strong><br>5.<br> 6.<br>用[[UITableViewCell alloc]() initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]创建10次cell,<br>并给cell指定同样的重用标识(当然,可以为不同显示类型的cell指定不同的标识)。<br>并且10个cell全部都加入到visiableCells数组,reusableTableCells为空。<br>向下拖动tableView,当cell1完全移出屏幕,并且cell11(它也是alloc出来的,原因同上)完全显示出来的时候。cell11加入到visiableCells,cell1移出visiableCells,cell1加入到reusableTableCells。<br> 接着向下拖动tableView,因为reusableTableCells中已经有值,所以,当需要显示新的cell,cellForRowAtIndexPath再次被调用的时候,tableView dequeueReusableCellWithIdentifier:CellIdentifier,返回cell1。cell1加入到visiableCells,cell1移出reusableTableCells;cell2移出visiableCells,cell2加入到reusableTableCells。之后再需要显示的Cell就可以正常重用了。</p>
<p>7.cocoa 中所有的类都是NSObject 的子类,多继承在这里是用protocol 委托代理来实现的。你不用去考虑繁琐的多继承,虚基类的概念。多态特性在 obj-c 中通过委托来实现。 </p>
<p>8.Protocol只是声明一套接口,并不能提供具体实现,变相的也算是一种抽象基类的实现方式(OC本身语法并不支持抽象基类)。<br>Category可以为已有的类提供额外的接口和具体的实现。<br>Protocol只能提供一套公用的接口声明,并不能提供具体实现,它的行为是,我只负责声明,而不管谁去实现,去如何实现。这样的话,我定义一套接口,可以使任意的类都用不同的方式去实现接口中的方法,就是为遵守了protocol的类提供了一些额外访问这个类的一些接口,像delegate和dataSource用protocol实现是最好的。<br>Category是对一个功能完备的类的一种补充、扩展,就像一个东西基本功能都完成了,可以用category为这个类添加不同的组件,使得这个类能够适应不同情况的需求(但是这些不同需求最核心的需求要一致)。当然,当某个类非常大的时候,使用category可以按照不同的功能将类的实现分在不同的模块中。还有,虽然category可以访问已有类的实例变量,但不能创建新的实例变量,如果要创建新的实例变量,请使用继承。<br>继承,它基于Protocol和Category之间,既可以像protocol一样只提供纯粹的接口,也可以像Category一样提供接口的完整实现,可以自由定义类的实例变量(这一点,Protocol倒是可以声明实例变量,但是也仅仅是声明而已),而且继承还可以对类以后的方法进行改写,所以继承的力量是最强大的。<br>在iOS开发中,继承是完全可以完成protocol和category的功能的,那么在开发过程中多多使用继承体系可好?<br>需要注意的是使用继承还有很大的代价问题。使用继承来进行扩展是一种耦合度很高的行为,对父类可以说是完全依赖,如果继承体系太过复杂,会造成难以维护的问题。如果仅仅只是对类进行扩展,并不建议使用继承,毕竟使用protocol和category是很简单、轻松的。除此之外,在开发过程中,我们应该尽量将界面、功能相似的类的代码提取到基类里面,然后各个子类继承自这个基类,实现各自的其他特殊部分。这样可以大大的优化代码,如果需要修改的话,只需要这倒对应子类修改即可。<br>category是可以被继承的。在某个父类中定义了category,那么他所有的子类都具有该category;<br>在需要为某个类创建私有成员方法时,也用category的方式来实现。<br>Category不能完全代替子类,有以下几个最大的缺点:<br>1.当在Category中覆盖一个继承的方法,在Category中的方法可以通过向super类发送一个消息来调用被继承的方法。但是,如果Category中覆盖的那个方法已经在这个类的其它Category定义过了,则之前定义的方法将没有机会被程序调用<br>2.在Category中无法确定其能够可靠的覆盖某个方法,而这个方法已经在其它的Category中定义过。这个问题在使用Cocoa框架时尤其 突出。当你想覆盖某个框架已经定义好的方法时,该方法已经在其它Category中实现,这样就无法确定哪个定义和实现会被最先使用,带来很大的不确定性。</p>
<p>9.define宏定义和const常变量区别:<br>1.define是宏定义,程序在预处理阶段将用define定义的内容进行了替换。因此程序运行时,常量表中并没有用define定义的常量,系统不为它分配内存。<br>const定义的常量,在程序运行时在常量表中,系统为它分配内存。<br>2.define定义的常量,预处理时只是直接进行了替换。所以编译时不能进行数据类型检验。<br>const定义的常量,在编译时进行严格的类型检验,可以避免出错。<br>3.define定义表达式时要注意“边缘效应”,例如如下定义:</p>
<pre><code>#define N 2+3 //我们预想的N值是5,我们这样使用N
int a = N/2; //我们预想的a的值是2.5,可实际上a的值是3.5
</code></pre><p>原因在于在预处理阶段,编译器将 a = N/2处理成了 a = 2+3/2;这就是宏定义的字符串替换的“边缘效应”因此要如下定义:</p>
<pre><code>#define N (2+3)
</code></pre><p>const定义表达式没有上述问题。<br>const定义的常量叫做常变量原因有二:<br>const定义常量像变量一样检查类型<br>const可以在任何地方定义常量,编译器对它的处理过程与变量相似,只是分配内存的地方不同</p>
<p>10.<br>1、TCP面向连接(如打电话要先拨号建立连接);UDP是无连接的,即发送数据之前不需要建立连接<br>2、TCP提供可靠的服务。也就是说,通过TCP连接传送的数据,无差错,不丢失,不重复,且按序到达;UDP尽最大努力交付,即不保证可靠交付<br>3、TCP面向字节流,实际上是TCP把数据看成一连串无结构的字节流;UDP是面向报文的<br>UDP没有拥塞控制,因此网络出现拥塞不会使源主机的发送速率降低(对实时应用很有用,如IP电话,实时视频会议等)<br>4、每一条TCP连接只能是点到点的;UDP支持一对一,一对多,多对一和多对多的交互通信<br>5、TCP首部开销20字节;UDP的首部开销小,只有8个字节<br>6、TCP的逻辑通信信道是全双工的可靠信道,UDP则是不可靠信道</p>
<p>11.md5 用户密码存储 文件校验<br>base64 公开的代码加密 url加密</p>
<p>12.采用二叉树链表作为存储结构,每个左节点均小于父节点,每个右节点均大于父节点<br>时间复杂度:O(log2(n))<br>详细参考:<a href="http://www.cnblogs.com/yangecnu/p/Introduce-Binary-Search-Tree.html" target="_blank" rel="external">http://www.cnblogs.com/yangecnu/p/Introduce-Binary-Search-Tree.html</a></p>
<p>13.<a href="http://blog.csdn.net/sakulafly/article/details/46368173" target="_blank" rel="external">http://blog.csdn.net/sakulafly/article/details/46368173</a></p>
<ol>
<li>• Xcode6支持制作静态库/动态库 framework<br>• 无论是动态库还是静态库都是区分真机和模拟器的,需要lipo命令进行合并<br>• 静态库编译静态库文件装入程序空间,动态库是文件动态装入内存<br>• 动态库执行到相关函数才会被调用,节省空间</li>
</ol>
<p>15.查看运行时是release版本还是debug版本;</p>
<h1 id="ifndef-OPTIMIZE"><a href="#ifndef-OPTIMIZE" class="headerlink" title="ifndef OPTIMIZE"></a>ifndef <strong>OPTIMIZE</strong></h1><pre><code>NSLog(@"DEBUG");
</code></pre><h1 id="else"><a href="#else" class="headerlink" title="else"></a>else</h1><pre><code>NSLog(@"RELEASE");
</code></pre><h1 id="endif"><a href="#endif" class="headerlink" title="endif"></a>endif</h1><p>当然我们也可以直接在xcode上去查看左上的工程,左键点击选择Edit Scheme,调出一个界面:<br>在选择左侧的Run 项目名.app,在右侧的Build Configuration项选择Debug 或者Release;即可;</p>
<p>现在来说一下这两个模式下的区别:Debug版本只要是写代码的时候调试运行的,可以设置断点,可以一步步调试查看;Release版本下断点是被忽略的。<br> 其次,Release版本主要是用来发布的,他生产的包会比Debug版本小很多,有30%的样子。</p>
<p>所以在开发项目的时候,一定要注意,项目调试时用,debug,要发布时,一定别忘了release版本下是否能正常运行!</p>
<p>16.从源码可以看出来,pushViewController是作用于navigationController 的。也就是说,如果想要使用pushViewController来进行界面的跳转,就必须保证当前页面有导航栏(navigationController )。至于presentViewController,就没有这个限制条件了,在当前页面没有导航栏的时候,也可以使用。<br>还有,pushViewController是把一个视图压入栈,然后显示出来,这样可以方便查找之前的视图,能够直接退回到之前的任意一个视图。而presentViewController是直接显示一个视图,这样每次就只能退回到前面的那一个视图。<br>而且,在一直使用pushViewController的导航之间,一旦使用了presentViewController,当前界面的导航栏(navigationController )就会变成空的,那么pushViewController也就没办法使用了。这时,如果想要再次使用pushViewController,就必须重新设置导航栏(navigationController )。不过,这样的话,当前视图就会变成根视图(rootViewController),而之前导航链里面的视图也找不到了。</p>
<p>19.概括来说,new和alloc/init在功能上几乎是一致的,分配内存并完成初始化。<br>差别在于,采用new的方式只能采用默认的init方法完成初始化,<br>采用alloc的方式可以用其他定制的初始化方法。</p>
<p>20.这两个方式都是建立一个空的Array<br><a href="">NSArray array</a>不需要release,使用autoreleasepool机制。<br>[[NSArray alloc]() init]需要自己手动release</p>
]]></content>
<summary type="html">
<p>基础:<br>1.<br>2.ios中实现callback可以通过两种方法,委托和NSNotification<br>委托的话是一对一的关系,例如一个UIViewController里有一个tableView, 将该viewController设置为tableView的委托
</summary>
<category term="IOS题库" scheme="http://www.jeyblogs.com/categories/IOS%E9%A2%98%E5%BA%93/"/>
<category term="面试" scheme="http://www.jeyblogs.com/tags/%E9%9D%A2%E8%AF%95/"/>
</entry>
<entry>
<title>iOS面试题</title>
<link href="http://www.jeyblogs.com/2016/10/23/iOS%E9%9D%A2%E8%AF%95%E9%A2%98/"/>
<id>http://www.jeyblogs.com/2016/10/23/iOS面试题/</id>
<published>2016-10-23T13:36:19.000Z</published>
<updated>2017-03-01T02:46:13.000Z</updated>
<content type="html"><![CDATA[<ol>
<li>button 有个addTarget 事件,你能大概讲一下他内部大概是怎么实现的吗?<br>答:内部的一个消息监听,通过指针、响应函数地址实现方法调用</li>
<li>常见的object-c的数据类型有那些, 和C的基本数据类型有什么区别?如:NSInteger和int<br>答:object-c的数据类型有NSString,NSNumber,NSArray,NSMutableArray,NSData等等,这些都是class,创建后便是对象,而C语言的基本数据类型int,只是一定字节的内存空间,用于存放数值;NSInteger是基本数据类型,并不是NSNumber的子类,当然也不是NSObject的子类。NSInteger是基本数据类型Int或者Long的别名(NSInteger的定义typedef long NSInteger),它的区别在于,NSInteger会根据系统是32位还是64位来决定是本身是int还是Long。</li>
<li>id 声明的对象有什么特性?<br>答:Id 声明的对象具有运行时的特性,即可以指向任意类型的objcetive-c的对象;</li>
<li>代理的作用?<br>答:代理的目的是改变或传递控制链。允许一个类在某些特定时刻通知到其他类,而不需要获取到那些类的指针。可以减少框架复杂度。<br>另外一点,代理可以理解为java中的回调监听机制的一种类似。</li>
<li><p>我们说的oc是动态运行时语言是什么意思?<br>答:多态。 主要是将数据类型的确定由编译时,推迟到了运行时。<br>这个问题其实浅涉及到两个概念,运行时和多态。<br>简单来说,运行时机制使我们直到运行时才去决定一个对象的类别,以及调用该类别对象指定方法。<br>多态:不同对象以自己的方式响应相同的消息的能力叫做多态。意思就是假设生物类(life)都用有一个相同的方法-eat;<br>那人类属于生物,猪也属于生物,都继承了life后,实现各自的eat,但是调用是我们只需调用各自的eat方法。<br>也就是不同的对象以自己的方式响应了相同的消息(响应了eat这个选择器)。<br>因此也可以说,运行时机制是多态的基础?</p>
</li>
<li><p>对于单例的理解<br>答:在objective-c中要实现一个单例类,至少需要做以下四个步骤:<br>1).为单例对象实现一个静态实例,并初始化,然后设置成nil,<br>2).实现一个实例构造方法检查上面声明的静态实例是否为nil,如果是则新建并返回一个本类的实例,<br>3).重写allocWithZone方法,用来保证其他人直接使用alloc和init试图获得一个新实力的时候不产生一个新实例,<br>4).适当实现allocWitheZone,copyWithZone,release和autorelease。</p>
</li>
<li>方法和选择器有何不同?<br>答:selector是一个方法的名字,method是一个组合体,包含了名字和实现.</li>
</ol>
<p>初级题目<br>1.在oc中如何实现深度拷贝<br>2.请描述什么是delegate、block、NSNotification,他们有什么作用<br>3.请写出一个线程安全的单例模式<br>4.解释属性中strong、weak、assign、copy的区别<br>5.#import和#include的区别<br>6.描述tableView的重用机制<br>7.Object-C有多继承吗?没有的话用什么代替?<br>8.category与继承之间的区别<br>9.#define和const定义的变量,有什么区别<br>10.TCP和UDP的区别是什么?<br>11.MD5和Base64的区别是什么,各自场景是什么?<br>12.二叉搜索树的概念,时间复杂度多少?<br>13.如何添加一个自定义字体到工程中<br>14.如何制作一个静态库/动态库,他们的区别是什么?<br>15.Configuration中,debug和release的区别是什么?<br>16.push view controller 和 present view controller的区别<br>17.描述下tableview cell的重用机制<br>18.UIView的frame和bounds的区别是什么<br>19.new与alloc init的区别<br>20.NSArray实例化时,array与init的区别</p>
<p>中级题目<br>1.什么是arc?(arc是为了解决什么问题诞生的?)<br>2.请解释以下keywords的区别: assign vs weak, <strong>block vs </strong>weak<br>3.__block在arc和非arc下含义一样吗?<br>4.使用atomic一定是线程安全的吗? </p>
<ol>
<li>描述一个你遇到过的retain cycle例子。(别撒谎,你肯定遇到过) </li>
<li>+(void)load; +(void)initialize;有什么用处? </li>
<li>为什么其他语言里叫函数调用, objective c里则是给对象发消息(或者谈下对runtime的理解) </li>
<li>什么是method swizzling? </li>
<li>UIView和CALayer是啥关系? </li>
<li>如何高性能的给UIImageView加个圆角?(不准说layer.cornerRadius!) </li>
<li>使用drawRect有什么影响?(这个可深可浅,你至少得用过。。) </li>
<li>ASIHttpRequest或者SDWebImage里面给UIImageView加载图片的逻辑是什么样的?(把UIImageView放到UITableViewCell里面问更赞) </li>
<li>麻烦你设计个简单的图片内存缓存器(移除策略是一定要说的) </li>
<li>讲讲你用Instrument优化动画性能的经历吧(别问我什么是Instrument) </li>
<li>loadView是干嘛用的? </li>
<li>viewWillLayoutSubView你总是知道的。。 </li>
<li>GCD里面有哪几种Queue?你自己建立过串行queue吗?背后的线程模型是什么样的? </li>
<li>用过coredata或者sqlite吗?读写是分线程的吗?遇到过死锁没?咋解决的? </li>
<li>http的post和get啥区别?(区别挺多的,麻烦多说点) </li>
<li>我知道你大学毕业过后就没接触过算法数据结构了,但是请你一定告诉我什么是Binary search tree? search的时间复杂度是多少?我很想知道!<br>21.哪些类不适合使用单例模式?即使他们在周期中只会出现一次。<br>22.Notification的使用场景是什么?同步还是异步?<br>23.简单介绍一下KVC和KVO,他们都可以应用在哪些场景?<br>24.UIButton的父类是什么?UILabel呢?<br>25.发送10个网络请求,然后再接收到所有回应之后执行后续操作,如何实现?<br>26.实现一个第三方控件,可以在任何时候出现在APP界面最上层<br>27.不同版本的APP,数据库结构变化了,如何处理?<br>28.内存中的栈和堆的区别是什么?那些数据在栈上,哪些在堆上?<br>29.block中的weak self,是任何时候都需要加的么?<br>30.GCD的queue,main queue中执行的代码,一定是在main thread么?<br>31.NSOperationQueue有哪些使用方式<br>32.NSThread中的Runloop的作用,如何使用?<br>33..h文件中的变量,外部可以直接访问么?(注意是变量,不是property)<br>34.讲述一下runtime的概念,message send如果寻找不到相应的对象,会如何进行后续处理 ?<br>35.利用runtime实现一个对象的拷贝__</li>
</ol>
]]></content>
<summary type="html">
<ol>
<li>button 有个addTarget 事件,你能大概讲一下他内部大概是怎么实现的吗?<br>答:内部的一个消息监听,通过指针、响应函数地址实现方法调用</li>
<li>常见的object-c的数据类型有那些, 和C的基本数据类型有什么区别?如:NSIntege
</summary>
<category term="IOS题库" scheme="http://www.jeyblogs.com/categories/IOS%E9%A2%98%E5%BA%93/"/>
<category term="面试" scheme="http://www.jeyblogs.com/tags/%E9%9D%A2%E8%AF%95/"/>
</entry>
<entry>
<title>hexo——搭建Github Page博客(2)</title>
<link href="http://www.jeyblogs.com/2016/08/16/hexo%E2%80%94%E2%80%94%E6%90%AD%E5%BB%BAGithub-Page%E5%8D%9A%E5%AE%A2(2)/"/>
<id>http://www.jeyblogs.com/2016/08/16/hexo——搭建Github-Page博客(2)/</id>
<published>2016-08-16T02:18:28.000Z</published>
<updated>2017-03-01T02:45:40.000Z</updated>
<content type="html"><![CDATA[<p><em><strong>GitHub Pages是什么?</strong></em><br>GitHub Pages本用于介绍托管在GitHub的项目, 他的空间免费稳定,用来做搭建一个博客再好不过,还可以根据自己的风格定制主题。<br><strong>1.github上建立仓库</strong><br>登录后系统,在github首页,点击页面右下角「New Repository<br><em>project name:jeyblogs.github.io</em><br><em>description: Writing 1000 Words a Day Changed My Life</em><br>注:Github Pages的Repository名字跟Github账号是一致的,比如我的Github账号是jeyblogs,Github Pages Repository名字就是jeyblogs.github.io。<br><strong>2.在setting的Github Pages模块激活</strong><br><strong>3.把Github Page站点下载到本地</strong><br><code>git clone [https://github.com/jeyblogs/jeyblogs.github.io.git]</code><br><strong>4.生成hero</strong><br>cd /站点本地仓库文件夹<br>hexo init<br><strong>5.申请独立域名,Godaddy注册并购买域名,我的jeyblogs.com,指向Github pages</strong><br><strong>6.在Github Pages站点目录下新建文件CNAME,里面文本是你的域名,jeyblogs.com</strong><br><strong>7.在github仓库中创建一个分支gh-pages</strong></p>
<p><em>进阶篇:Hexo设置</em><br>网站搭建完成后,就可以根据自己爱好来对Hexo生成的网站进行设置了,对整站的设置,只要修改项目目录的_config.yml就可以了_ </p>
<pre><code>Extensions
Plugins: https://hexo.io/plugins/
Themes: https://hexo.io/themes/
theme: hexo-next
Deployment
Docs: https://hexo.io/docs/deployment.htm
deploy:
type: git
repository: git@github.com:jeyblogs/jeyblogs.github.io.git
branch: master
</code></pre><p><strong>用Hexo发表文章的Markdown语法</strong><br>使用jacman或pacman主题,建议按此标准语法写:</p>
<pre><code>title: postName #文章页面上的显示名称,可以任意修改,不会出现在URL中
date: 2013-12-02 15:30:16 #文章生成时间,一般不改,当然也可以任意修改
category: example #分类
tags: [tag1,tag2,tag3] #文章标签,可空,多标签请用格式,注意:后面有个空格
description: 附加一段文章摘要,字数最好在140字以内。
---
</code></pre><p><strong>Hexo命令</strong><br>常用命令:</p>
<pre><code>hexo new "postName" #新建文章
hexo new page "pageName" #新建页面
hexo generate #生成静态页面至public目录
hexo server #开启预览访问端口(默认端口4000,'ctrl + c'关闭server)
hexo deploy #将.deploy目录部署到GitHub
</code></pre><p>常用复合命令:</p>
<pre><code>hexo d -g #生成加部署
hexo s -g #预览加部署
</code></pre><p>简写:</p>
<pre><code>hexo n == hexo new
hexo g == hexo generate
hexo s == hexo server
hexo d == hexo deploy
</code></pre><p>安装插件<br>添加sitemap和feed插件</p>
<pre><code>$ npm install hexo-generator-sitemap
$ npm install hexo-generator-feed
</code></pre><p><em>注:</em><br>站点本地仓库文件夹目录下source是自己在本地的文件,新建的page和文章都在,hexo g命令后会自动生成public文件夹,生成的网页,文章里面的categories也是在source中,新建的page,categories是跟posts文件夹同级的,themes是主题目录</p>
]]></content>
<summary type="html">
<p><em><strong>GitHub Pages是什么?</strong></em><br>GitHub Pages本用于介绍托管在GitHub的项目, 他的空间免费稳定,用来做搭建一个博客再好不过,还可以根据自己的风格定制主题。<br><strong>1.github上建
</summary>
<category term="Tools" scheme="http://www.jeyblogs.com/categories/Tools/"/>
<category term="Hexo" scheme="http://www.jeyblogs.com/tags/Hexo/"/>
</entry>
<entry>
<title>hexo——搭建Github Page博客之配置篇(1)</title>
<link href="http://www.jeyblogs.com/2016/08/15/hexo%E2%80%94%E2%80%94%E6%90%AD%E5%BB%BAGithub%20Page%E5%8D%9A%E5%AE%A2(1)/"/>
<id>http://www.jeyblogs.com/2016/08/15/hexo——搭建Github Page博客(1)/</id>
<published>2016-08-15T02:29:49.000Z</published>
<updated>2017-03-01T03:03:06.000Z</updated>
<content type="html"><![CDATA[<p>hero是一款轻量级的博客系统,它能够定制属于自己的个性化主题博客。<br><strong>Hexo环境配置</strong><br>先屡一下思路<br>1.首先hexo是基于nodejs的,所以必须安装nodejs<br>2.安装nodejs方法很多,我选择homebrew安装方式,所以需要安装它<br>3.安装homebrew就很简单了,mac自带ruby脚本功能,一句话搞定<br>4.hexo提交部署github需要使用git工具,所以需要安装git,用homebrew的话也是一句话搞定(mac也有自带)<br>5.OK整理一下安装顺序:homebrew-nodejs-hexo-git</p>
<h5 id="安装brewhome,一句话搞定"><a href="#安装brewhome,一句话搞定" class="headerlink" title="安装brewhome,一句话搞定"></a>安装brewhome,一句话搞定</h5><pre><code>ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)”
</code></pre><h5 id="安装nodejs"><a href="#安装nodejs" class="headerlink" title="安装nodejs"></a>安装nodejs</h5><h6 id="第一种方式,brewhome安装,一句话搞定"><a href="#第一种方式,brewhome安装,一句话搞定" class="headerlink" title="第一种方式,brewhome安装,一句话搞定"></a>第一种方式,brewhome安装,一句话搞定</h6><pre><code>brew install node
</code></pre><h6 id="第二种方式,前提是已经安装好Xcode和git"><a href="#第二种方式,前提是已经安装好Xcode和git" class="headerlink" title="第二种方式,前提是已经安装好Xcode和git"></a>第二种方式,前提是已经安装好Xcode和git</h6><pre><code>git clone git://github.com/joyent/node.git
cd node
./configure
make
sudo make install
</code></pre><h5 id="安装hexo"><a href="#安装hexo" class="headerlink" title="安装hexo"></a>安装hexo</h5><h6 id="第一种方式,用nodejs自带npm安装"><a href="#第一种方式,用nodejs自带npm安装" class="headerlink" title="第一种方式,用nodejs自带npm安装"></a>第一种方式,用nodejs自带npm安装</h6><pre><code>npm install -g hexo
hexo init
npm install
</code></pre><h6 id="第二种方式,下载源码-http-www-nodejs-org-download-,编译执行"><a href="#第二种方式,下载源码-http-www-nodejs-org-download-,编译执行" class="headerlink" title="第二种方式,下载源码(http://www.nodejs.org/download/),编译执行"></a>第二种方式,下载源码(<a href="http://www.nodejs.org/download/),编译执行" target="_blank" rel="external">http://www.nodejs.org/download/),编译执行</a></h6><pre><code>./configure --prefix=~/nodejs && make && make install
cp ~/nodejs/bin/node /usr/sbin/node
~/nodejs/bin/npm install -g hexo
</code></pre><h5 id="安装git(mac一般自带)"><a href="#安装git(mac一般自带)" class="headerlink" title="安装git(mac一般自带)"></a>安装git(mac一般自带)</h5><pre><code>sudo brew install git
</code></pre><h5 id="SSH-key"><a href="#SSH-key" class="headerlink" title="SSH key"></a>SSH key</h5><h6 id="检查SSH-key"><a href="#检查SSH-key" class="headerlink" title="检查SSH key"></a>检查SSH key</h6><pre><code>cd ~/.ssh
</code></pre><h6 id="备份已有的key,(如果有的话)"><a href="#备份已有的key,(如果有的话)" class="headerlink" title="备份已有的key,(如果有的话)"></a>备份已有的key,(如果有的话)</h6><pre><code>mkdir key_backup
mv id_rsa* key_backup
</code></pre><h6 id="生成SSH-key"><a href="#生成SSH-key" class="headerlink" title="生成SSH key"></a>生成SSH key</h6><pre><code>ssh-keygen -t rsa -C "xxx@xxx.com”
</code></pre><h6 id="将SSH-key添加到Github"><a href="#将SSH-key添加到Github" class="headerlink" title="将SSH key添加到Github"></a>将SSH key添加到Github</h6><p>登录到GitHub页面,Account Settings->deploy Keys->Add another key将生成的key(id_rsa.pub文件)内容copy到输入框中,save。_</p>
<h6 id="测试连接"><a href="#测试连接" class="headerlink" title="测试连接"></a>测试连接</h6><pre><code>ssh git@github.com
</code></pre><h6 id="设置个人信息"><a href="#设置个人信息" class="headerlink" title="设置个人信息"></a>设置个人信息</h6><pre><code>git config --global user.name "xxx”
git config --global user.email xxx@xxx.com
</code></pre>]]></content>
<summary type="html">
<p>hero是一款轻量级的博客系统,它能够定制属于自己的个性化主题博客。<br><strong>Hexo环境配置</strong><br>先屡一下思路<br>1.首先hexo是基于nodejs的,所以必须安装nodejs<br>2.安装nodejs方法很多,我选择homebre
</summary>
<category term="Tools" scheme="http://www.jeyblogs.com/categories/Tools/"/>
<category term="Hexo" scheme="http://www.jeyblogs.com/tags/Hexo/"/>
</entry>
<entry>
<title>iOS运行证书报错问题整理</title>
<link href="http://www.jeyblogs.com/2016/03/27/iOS%E8%BF%90%E8%A1%8C%E8%AF%81%E4%B9%A6%E6%8A%A5%E9%94%99%E9%97%AE%E9%A2%98%E6%95%B4%E7%90%86/"/>
<id>http://www.jeyblogs.com/2016/03/27/iOS运行证书报错问题整理/</id>
<published>2016-03-27T02:36:28.000Z</published>
<updated>2016-09-27T03:16:11.000Z</updated>
<content type="html"><![CDATA[<p>作为一名iOS工程师,在开发中遇到各种证书报错的问题,在这里,我就把多年的实践经验分享出来,希望能够对大家有所帮助:</p>
<ol>
<li><p>iPhone上已经装了Bundle ID一样的 App,删掉再运行。</p>
<p> This application’s application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed.</p>
</li>
<li><p>还是描述文件的问题,把发布的描述文件或者是 hoc 的描述文件当成开发描述文件使用了。</p>
<p> process launch failed: timed out trying to launch app</p>
</li>
</ol>
]]></content>
<summary type="html">
<p>作为一名iOS工程师,在开发中遇到各种证书报错的问题,在这里,我就把多年的实践经验分享出来,希望能够对大家有所帮助:</p>
<ol>
<li><p>iPhone上已经装了Bundle ID一样的 App,删掉再运行。</p>
<p> This application’s
</summary>
<category term="Developer" scheme="http://www.jeyblogs.com/categories/Developer/"/>
<category term="Xcode" scheme="http://www.jeyblogs.com/tags/Xcode/"/>
</entry>
<entry>
<title>利用Xcode的代码块提高效率</title>
<link href="http://www.jeyblogs.com/2016/03/18/%E5%88%A9%E7%94%A8Xcode%E7%9A%84%E4%BB%A3%E7%A0%81%E5%9D%97%E6%8F%90%E9%AB%98%E6%95%88%E7%8E%87/"/>
<id>http://www.jeyblogs.com/2016/03/18/利用Xcode的代码块提高效率/</id>
<published>2016-03-18T11:16:56.000Z</published>
<updated>2017-02-23T11:20:29.000Z</updated>
<content type="html"><![CDATA[<p>在编写代码过程中,很多代码会重复使用很多次,比如设置背景颜色、定义一个新的属性等。通过Xcode中的代码块,我们可以只敲几个按键就能将一大串代码写入。<br>具体操作步骤<br>1.先将需要编辑的代码写好,比如我要创建一个设置背景颜色的代码块,就这样写<br>\<#name#>.backgroundColor = <a href="">UIColor \<#color#></a>; </p>
<p>2.选中写好的代码,用鼠标左键按住不放,将其拖入右下角{}模块内 </p>
<p>3.代码拖入之后,在代码块列表底部找到刚刚拖入的代码,点击会弹出小窗,点击小窗中的“Edit”,进入编辑页面。 </p>
<p>4.点击“Edit”后,会出现以下内容,<br>“Title”是这个代码块的标题,可以简单写几个字,比如“设置背景颜色”;<br>“Summary”是一个概括描述,可以不填;<br>“Platform”中设置此代码块的作用的平台(All/iOS/OS X/watchOS);<br>“Language”是对应的语言,有很多中可以选择;<br>“Completion Shortcut”是此段代码块的快捷代码,在编写代码时只要打出快捷代码就可以直接使用这个代码块,比如设置背景颜色的代码可以填写“bgcolor”;<br>“Completion Scopes”是该代码块的生效区域,可以默认。<br>填写完毕后点击“Done”即可。</p>
<p>5.编辑完代码块后,就是如何使用了。如果第4步中填写了“Completion Shortcut”,在编写代码时直接敲出相应的快捷代码就可以了,比如填写了“bgcolor”,直接敲出bgcolor,选中代码块就可以直接输入到屏幕上。<br>如果没有填写快捷代码,也可以用鼠标选中需要使用的代码块,将其拖到相应的位置即可。</p>
]]></content>
<summary type="html">
<p>在编写代码过程中,很多代码会重复使用很多次,比如设置背景颜色、定义一个新的属性等。通过Xcode中的代码块,我们可以只敲几个按键就能将一大串代码写入。<br>具体操作步骤<br>1.先将需要编辑的代码写好,比如我要创建一个设置背景颜色的代码块,就这样写<br>\&lt;#n
</summary>
<category term="Xcode" scheme="http://www.jeyblogs.com/categories/Xcode/"/>
<category term="工具" scheme="http://www.jeyblogs.com/tags/%E5%B7%A5%E5%85%B7/"/>
</entry>
<entry>
<title>KVO的实现原理</title>
<link href="http://www.jeyblogs.com/2016/03/01/KVO%E7%9A%84%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86/"/>
<id>http://www.jeyblogs.com/2016/03/01/KVO的实现原理/</id>
<published>2016-03-01T02:21:38.000Z</published>
<updated>2017-03-01T03:00:59.000Z</updated>
<content type="html"><![CDATA[<p>KVC运用了一个isa-swizzling技术。isa-swizzling就是类型混合指针机制。KVC主要通过isa-swizzling,来实现其内部查找定位的。isa指针,如其名称所指,(就是is a kind of的意思),指向维护分发表的对象的类。该分发表实际上包含了指向实现类中的方法的指针,和其它数据。</p>
<p><strong>addObserver:forKeyPath:options:context:各个参数的作用分别是什么, observer中需要实现哪个方法才能获得KVO回调?</strong></p>
<pre><code>/**
self.person:要监听的对象
参数说明:
@param addObserver 观察者,负责处理监听事件的对象
@param forKeyPath 要监听的属性
@param options 观察的选项(观察新、旧值,也可以都观察)
@param context 上下文,用于传递数据,可以利用上下文区分不同的监听
*/
[self.person addObserver:self forKeyPath:@"name" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:@"Person Name"];
/**
当监控的某个属性的值改变了就会调用
*
@param keyPath 监听的属性名
@param object 属性所属的对象
@param change 属性的修改情况(属性原来的值oldValue、属性最新的值newValue)
@param context 传递的上下文数据,与监听的时候传递的一致,可以利用上下文区分不同的监听
*/
(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
NSLog(@"%@对象的%@属性改变了:%@", object, keyPath, change);
}
</code></pre><p>一、KVO (Key-Value Observing)<br>KVO 是 Objective-C 对观察者模式(Observer Pattern)的实现。也是 Cocoa Binding 的基础。当被观察对象的某个属性发生更改时,观察者对象会获得通知。<br>有意思的是,你不需要给被观察的对象添加任何额外代码,就能使用 KVO 。这是怎么做到的?<br>二、 KVO内部实现原理<br>• KVO是基于runtime机制实现的<br>• 当某个类的属性对象第一次被观察时,系统就会在运行期动态地创建该类的一个派生类,在这个派生类中重写基类中任何被观察属性的setter 方法。派生类在被重写的setter方法内实现真正的通知机制<br>• 如果原类为Person,那么生成的派生类名为NSKVONotifying_Person<br>• 每个类对象中都有一个isa指针指向当前类,当一个类对象的第一次被观察,那么系统会偷偷将isa指针指向动态生成的派生类,从而在给被监控属性赋值时执行的是派生类的setter方法<br>• 键值观察通知依赖于NSObject 的两个方法: willChangeValueForKey: 和 didChangevlueForKey:;在一个被观察属性发生改变之前, willChangeValueForKey:一定会被调用,这就 会记录旧的值。而当改变发生后,didChangeValueForKey:会被调用,继而 observeValueForKey:ofObject:change:context: 也会被调用。<br>• 补充:KVO的这套实现机制中苹果还偷偷重写了class方法,让我们误认为还是使用的当前类,从而达到隐藏生成的派生类<br><img src="http://7xsdar.com1.z0.glb.clouddn.com/KVO%E5%86%85%E9%83%A8%E5%AE%9E" alt=""><br>三、如何手动触发一个value的KVO<br>• 自动触发的场景:在注册KVO之前设置一个初始值,注册之后,设置一个不一样的值,就可以触发了<br>• 想知道如何手动触发,必须知道自动触发 KVO 的原理,见上面的描述<br>• 手动触发演示</p>
<pre><code>@property (nonatomic, strong) NSDate *now;
(void)viewDidLoad
{
[super viewDidLoad];
// “手动触发self.now的KVO”,必写。
[self willChangeValueForKey:@"now"];
// “手动触发self.now的KVO”,必写。
[self didChangeValueForKey:@"now"];
}
</code></pre>]]></content>
<summary type="html">
<p>KVC运用了一个isa-swizzling技术。isa-swizzling就是类型混合指针机制。KVC主要通过isa-swizzling,来实现其内部查找定位的。isa指针,如其名称所指,(就是is a kind of的意思),指向维护分发表的对象的类。该分发表实际上包含了
</summary>
<category term="疑难杂症" scheme="http://www.jeyblogs.com/categories/%E7%96%91%E9%9A%BE%E6%9D%82%E7%97%87/"/>
</entry>
<entry>
<title>Xcode通过Jenkins自动打包ipa</title>
<link href="http://www.jeyblogs.com/2015/11/25/Xcode%E9%80%9A%E8%BF%87Jenkins%E8%87%AA%E5%8A%A8%E6%89%93%E5%8C%85ipa/"/>
<id>http://www.jeyblogs.com/2015/11/25/Xcode通过Jenkins自动打包ipa/</id>
<published>2015-11-25T08:40:19.000Z</published>
<updated>2017-03-01T02:46:51.000Z</updated>
<content type="html"><![CDATA[<h3 id="Jenkins自动打包ipa"><a href="#Jenkins自动打包ipa" class="headerlink" title="Jenkins自动打包ipa"></a>Jenkins自动打包ipa</h3><p>如果Mac 上没有安装brew。先安装:ruby -e “$(curl -fsSL <a href="https://raw.github.com/Homebrew/homebrew/go/install" target="_blank" rel="external">https://raw.github.com/Homebrew/homebrew/go/install</a>)”<br>首先安装jenkins #: brew install jenkins brew 官网:<a href="http://brew.sh" target="_blank" rel="external">http://brew.sh</a> 或直接从Jenkins下载:<a href="http://jenkins-ci.org" target="_blank" rel="external">http://jenkins-ci.org</a></p>
<p>安装完成后浏览器打开:<a href="http://localhost:8080" target="_blank" rel="external">http://localhost:8080</a> Jenkins 默认地址<br>首先请确认本地的xcode 工程是否能生成ipa 最好先试一次。如果xcode 能正常生成ipa 那么下面的才能实现</p>
<h4 id="坑:增加Xcode插件(失败了的话找找插件)"><a href="#坑:增加Xcode插件(失败了的话找找插件)" class="headerlink" title="坑:增加Xcode插件(失败了的话找找插件)"></a>坑:增加Xcode插件(失败了的话找找插件)</h4><p>在jenkins的系统管理中,找到管理插件,可选插件的tab下搜索xcode,勾选安装,安装插件/升级处等待?jenkins升级到最新版本了,xcode插件更好安装(如果失败请下载最新的jenkjins,或者多尝试几次)。<br>这样重启jenkins的话,就会在job的构建中下拉选择处看到xcode的支持选项。</p>
<p>1.新建一个自由风格的项目<br>2.第一步<img src="http://7xsdar.com1.z0.glb.clouddn.com/jenkins1.png" alt=""><br>3.从SVN地址拉取源码<img src="http://7xsdar.com1.z0.glb.clouddn.com/jenkins2.png" alt=""><br>4.设置自动打包时间<img src="http://7xsdar.com1.z0.glb.clouddn.com/jenkins3.png" alt=""><br>5.<img src="http://7xsdar.com1.z0.glb.clouddn.com/jenkins4.png" alt=""><br>1.cd jenkins拉取的项目在本地的路径 xcodebuild -archivePath “enkins拉取的项目在本地的路径/项目名称.xcarchive” -sdk iphoneos -scheme “Jueee” -configuration “Release” archive<br> 例:cd /Users/package/.jenkins/jobs/Ueee/workspace xcodebuild -archivePath “/Users/package/.jenkins/jobs/Ueee/workspace/Jueee.xcarchive” -sdk iphoneos -scheme “Jueee” -configuration “Release” archive</p>
<p>2.设置打包至桌面page<br> xcodebuild -exportArchive -exportFormat IPA -archivePath “/Users/package/.jenkins/jobs/Ueee/workspace/Jueee.xcarchive” -exportPath “/Users/package/Desktop/page/Jueee$(date +%Y%m%d%H%M).ipa”</p>
<p>3.上传至fir命令<br> fir publish /Users/package/Desktop/page/Jueee$(date +%Y%m%d%H%M).ipa -T e9032bee861fcf8ea623e8cb2090e40c</p>
<p><strong>或者:</strong><br>第五步的Execute shell下的command可以改为一个命令:<br> fir build_ipa /Users/package/.jenkins/jobs/Ueee/workspace/Jueee.xcodeproj -o /Users/package/Desktop/page/ -n Jueee$(date +%Y%m%d%H) -p -c “update” -Q -T e9032bee861fcf8ea623e8cb2090e40c</p>
]]></content>
<summary type="html">
<h3 id="Jenkins自动打包ipa"><a href="#Jenkins自动打包ipa" class="headerlink" title="Jenkins自动打包ipa"></a>Jenkins自动打包ipa</h3><p>如果Mac 上没有安装brew。先安装:ru
</summary>
<category term="Tools" scheme="http://www.jeyblogs.com/categories/Tools/"/>
<category term="Xcode" scheme="http://www.jeyblogs.com/tags/Xcode/"/>
</entry>
<entry>
<title>GCD Dispatch</title>
<link href="http://www.jeyblogs.com/2015/11/15/GCD%20Dispatch/"/>
<id>http://www.jeyblogs.com/2015/11/15/GCD Dispatch/</id>
<published>2015-11-15T02:29:49.000Z</published>
<updated>2017-03-01T02:48:15.000Z</updated>
<content type="html"><![CDATA[<h4 id="设计:"><a href="#设计:" class="headerlink" title="设计:"></a>设计:</h4><p>GCD的工作原理是:让程序平行排队的特定任务,根据可用的处理资源,安排他们在任何可用的处理器核心上执行任务。<br>一个任务可以是一个函数(function)或者是一个block。 GCD的底层依然是用线程实现,不过这样可以让程序员不用关注实现的细节。<br>GCD中的FIFO队列称为dispatch queue,它可以保证先进来的任务先得到执行<br>dispatch queue分为下面三种:</p>
<h4 id="Serial"><a href="#Serial" class="headerlink" title="Serial"></a>Serial</h4><p>又称为private dispatch queues,同时只执行一个任务。Serial queue通常用于同步访问特定的资源或数据。当你创建多个Serial queue时,虽然它们各自是同步执行的,但Serial queue与Serial queue之间是并发执行的。</p>
<h4 id="Concurrent"><a href="#Concurrent" class="headerlink" title="Concurrent"></a>Concurrent</h4><p>又称为global dispatch queue,可以并发地执行多个任务,但是执行完成的顺序是随机的。</p>
<h4 id="Main-dispatch-queue"><a href="#Main-dispatch-queue" class="headerlink" title="Main dispatch queue"></a>Main dispatch queue</h4><p>它是全局可用的serial queue,它是在应用程序主线程上执行任务的。</p>
<p>1、dispatch_group_async的使用<br>dispatch_group_async可以实现监听一组任务是否完成,完成后得到通知执行其他的操作。这个方法很有用,比如你执行三个下载任务,当三个任务都下载完成后你才通知界面说完成的了。下面是一段例子代码:</p>
<p>1 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);<br>2 dispatch_group_t group = dispatch_group_create();<br>3 dispatch_group_async(group, queue, ^<br>4 <a href="#">NSThread sleepForTimeInterval:1</a>;<br>5 NSLog(@”group1”);<br>6 });<br>7 dispatch_group_async(group, queue, ^<br>8 <a href="#">NSThread sleepForTimeInterval:2</a>;<br>9 NSLog(@”group2”);<br>10 });<br>11 dispatch_group_async(group, queue, ^<br>12 <a href="#">NSThread sleepForTimeInterval:3</a>;<br>13 NSLog(@”group3”);<br>14 });<br>15 dispatch_group_notify(group, dispatch_get_main_queue(), ^<br>16 NSLog(@”updateUi”);<br>17 });<br>18 dispatch_release(group);<br>dispatch_group_async是异步的方法,运行后可以看到打印结果:</p>
<p>2012-09-25 16:04:16.737 gcdTest<a href="#">43328:11303</a> group1<br>2012-09-25 16:04:17.738 gcdTest<a href="#">43328:12a1b</a> group2<br>2012-09-25 16:04:18.738 gcdTest<a href="#">43328:13003</a> group3<br>2012-09-25 16:04:18.739 gcdTest<a href="#">43328:f803</a> updateUi<br>每个一秒打印一个,当第三个任务执行后,upadteUi被打印。</p>
<p>2、dispatch_barrier_async的使用<br>dispatch_barrier_async是在前面的任务执行结束后它才执行,而且它后面的任务等它执行完成之后才会执行<br>例子代码如下:</p>
<p>1 dispatch_queue_t queue = dispatch_queue_create(“gcdtest.rongfzh.yc”, DISPATCH_QUEUE_CONCURRENT);<br>2 dispatch_async(queue, ^<br>3 <a href="#">NSThread sleepForTimeInterval:2</a>;<br>4 NSLog(@”dispatch_async1”);<br>5 });<br>6 dispatch_async(queue, ^<br>7 <a href="#">NSThread sleepForTimeInterval:4</a>;<br>8 NSLog(@”dispatch_async2”);<br>9 });<br>10 dispatch_barrier_async(queue, ^<br>11 NSLog(@”dispatch_barrier_async”);<br>12 <a href="#">NSThread sleepForTimeInterval:4</a>;<br>13<br>14 });<br>15 dispatch_async(queue, ^<br>16 <a href="#">NSThread sleepForTimeInterval:1</a>;<br>17 NSLog(@”dispatch_async3”);<br>18 }); </p>
<p>打印结果:</p>
<p>2012-09-25 16:20:33.967 gcdTest<a href="#">45547:11203</a> dispatch_async1<br>2012-09-25 16:20:35.967 gcdTest<a href="#">45547:11303</a> dispatch_async2<br>2012-09-25 16:20:35.967 gcdTest<a href="#">45547:11303</a> dispatch_barrier_async<br>2012-09-25 16:20:40.970 gcdTest<a href="#">45547:11303</a> dispatch_async3<br>请注意执行的时间,可以看到执行的顺序如上所述。<br>3、dispatch_apply<br>执行某个代码片段N次。<br>dispatch_apply(5, globalQ, ^(size_t index)<br> // 执行5次<br>});</p>
<h5 id="这段代码逐步演示了如何修正错误,其中用到的既是串行队列"><a href="#这段代码逐步演示了如何修正错误,其中用到的既是串行队列" class="headerlink" title="这段代码逐步演示了如何修正错误,其中用到的既是串行队列"></a>这段代码逐步演示了如何修正错误,其中用到的既是串行队列</h5><p>1。这个是原始代码<br>view plain</p>
<ul>
<li>(void)viewWillAppear:(BOOL)animated </li>
</ul>
<pre><code>NSData \*imageData = [FlickrFetcher imageDataForPhotoWithURLString:photo.URL][16];
UIImage \*image = [UIImage imageWithData:imageData][17];
self.imageView.image = image;
self.imageView.frame = CGRectMake(0, 0, image.size.width, image.size.height);
self.scrollView.contentSize = image.size;
</code></pre><p>} </p>
<p>2。这个是采用gcdd的代码,里面有错误3处<br>view plain</p>
<ul>
<li><p>(void)viewWillAppear:(BOOL)animated </p>
<p> dispatch_queue_t downloadQueue = dispatch_queue_create(“Flickr downloader”, NULL);<br> dispatch_async(downloadQueue, ^ </p>
<pre><code>NSData \*imageData = [FlickrFetcher imageDataForPhotoWithURLString:photo.URL][18];
UIImage \*image = [UIImage imageWithData:imageData][19];
self.imageView.image = image;
self.imageView.frame = CGRectMake(0, 0, image.size.width, image.size.height);
self.scrollView.contentSize = image.size;
</code></pre><p> });<br>} </p>
</li>
</ul>
<p>3。第一个错误,UI更新只能在主线程中 Problem! UIKit calls can only happen in the main thread!<br>改正后如下:<br>view plain</p>
<ul>
<li><p>(void)viewWillAppear:(BOOL)animated </p>
<p> dispatch_queue_t downloadQueue = dispatch_queue_create(“Flickr downloader”, NULL);<br> dispatch_async(downloadQueue, ^ </p>
<pre><code> NSData \*imageData = [FlickrFetcher imageDataForPhotoWithURLString:photo.URL][20];
dispatch\_async(dispatch\_get\_main\_queue(), ^
UIImage \*image = [UIImage imageWithData:imageData][21];
self.imageView.image = image;
self.imageView.frame = CGRectMake(0, 0, image.size.width, image.size.height);
self.scrollView.contentSize = image.size;
});
</code></pre><p>}); } </p>
</li>
</ul>
<p>4。第二个错误,NSManagedObjectContext并不是线程安全的,gcd中访问成员变量有危险<br>Problem! NSManagedObjectContext is not thread safe,<br>so we can’t call photo.URL in downloadQueue’s t<br>改正后如下:<br>view plain</p>
<ul>
<li><p>(void)viewWillAppear:(BOOL)animated </p>
<p>NSString *url = photo.URL;<br> dispatch_queue_t downloadQueue = dispatch_queue_create(“Flickr downloader”, NULL);<br> dispatch_async(downloadQueue, ^ </p>
<pre><code>NSData \*imageData = [FlickrFetcher imageDataForPhotoWithURLString:url][22];
dispatch\_async(dispatch\_get\_main\_queue(), ^
UIImage \*image = [UIImage imageWithData:imageData][23];
self.imageView.image = image;
self.imageView.frame = CGRectMake(0, 0, image.size.width, image.size.height);
self.scrollView.contentSize = image.size;
</code></pre><p>});<br>});<br>}<br>5。第三个错误,队列创建后没有释放,内存泄露<br>view plain</p>
</li>
<li><p>(void)viewWillAppear:(BOOL)animated </p>
<p> NSString *url = photo.URL;<br> dispatch_queue_t downloadQueue = dispatch_queue_create(“Flickr downloader”, NULL);<br> dispatch_async(downloadQueue, ^ </p>
<pre><code>NSData \*imageData = [FlickrFetcher imageDataForPhotoWithURLString:url][24];
dispatch\_async(dispatch\_get\_main\_queue(), ^
UIImage \*image = [UIImage imageWithData:imageData][25];
self.imageView.image = image;
self.imageView.frame = CGRectMake(0, 0, image.size.width, image.size.height);
self.scrollView.contentSize = image.size;
</code></pre><p>});<br>}); </p>
</li>
</ul>
<p>dispatch_release(downloadQueue);<br> //won’t actually go away until queue is empty</p>
<p>}</p>
<h4 id="补充:"><a href="#补充:" class="headerlink" title="补充:"></a>补充:</h4><p>dispatch队列的生成可以有这几种方式:</p>
<ol>
<li>dispatch_queue_t queue = dispatch_queue_create(“com.dispatch.serial”, DISPATCH_QUEUE_SERIAL); //生成一个串行队列,队列中的block按照先进先出(FIFO)的顺序去执行,实际上为单线程执行。第一个参数是队列的名称,在调试程序时会非常有用,所有尽量不要重名了。</li>
<li>dispatch_queue_t queue = dispatch_queue_create(“com.dispatch.concurrent”, DISPATCH_QUEUE_CONCURRENT); //生成一个并发执行队列,block被分发到多个线程去执行</li>
<li>dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); //获得程序进程缺省产生的并发队列,可设定优先级来选择高、中、低三个优先级队列。由于是系统默认生成的,所以无法调用dispatch_resume()和dispatch_suspend()来控制执行继续或中断。需要注意的是,三个队列不代表三个线程,可能会有更多的线程。并发队列可以根据实际情况来自动产生合理的线程数,也可理解为dispatch队列实现了一个线程池的管理,对于程序逻辑是透明的。<br>官网文档解释说共有三个并发队列,但实际还有一个更低优先级的队列,设置优先级为DISPATCH_QUEUE_PRIORITY_BACKGROUND。Xcode调试时可以观察到正在使用的各个dispatch队列。</li>
<li>dispatch_queue_t queue = dispatch_get_main_queue(); //获得主线程的dispatch队列,实际是一个串行队列。同样无法控制主线程dispatch队列的执行继续或中断。<br>接下来我们可以使用dispatch_async或dispatch_sync函数来加载需要运行的block。<br>dispatch_async(queue, ^<br> //block具体代码<br>}); //异步执行block,函数立即返回<br>dispatch_sync(queue, ^<br> //block具体代码<br>}); //同步执行block,函数不返回,一直等到block执行完毕。编译器会根据实际情况优化代码,所以有时候你会发现block其实还在当前线程上执行,并没用产生新线程。<br>实际编程经验告诉我们,尽可能避免使用dispatch_sync,嵌套使用时还容易引起程序死锁。<br>如果queue1是一个串行队列的话,这段代码立即产生死锁:<br>dispatch_sync(queue1, ^<br> dispatch_sync(queue1, ^<br> ……<br> });<br> ……<br> });<br>不妨思考下,为什么下面代码也肯定死锁:<br>dispatch_sync(dispatch_get_main_queue(), ^<br> ……<br>});<br>原因:1主线程通过dispatch_sync把block交给主队列后,会等待block里的任务结束再往下走自身的任务,<br> 2.而队列是先进先出的,block里的任务也在等待主队列当中排在它之前的任务都执行完了再走自己。<br> 这种循环等待就形成了死锁。所以在主线程当中使用dispatch_sync将任务加到主队列是不可取的。_<br>那实际运用中,一般可以用dispatch这样来写,常见的网络请求数据多线程执行模型:<br>dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^<br> //子线程中开始网络请求数据<br> //更新数据模型<br> dispatch_sync(dispatch_get_main_queue(), ^<br> //在主线程中更新UI代码<br> });<br>});<br>程序的后台运行和UI更新代码紧凑,代码逻辑一目了然。</li>
</ol>
<p>dispatch队列是线程安全的,可以利用串行队列实现锁的功能。比如多线程写同一数据库,需要保持写入的顺序和每次写入的完整性,简单地利用串行队列即可实现:<br>dispatch_queue_t queue1 = dispatch_queue_create(“com.dispatch.writedb”, DISPATCH_QUEUE_SERIAL);</p>
<ul>
<li>(void)writeDB:(NSData *)data</li>
</ul>
<p> dispatch_async(queue1, ^<br> //write database<br> });<br>}<br>下一次调用writeDB:必须等到上次调用完成后才能进行,保证writeDB:方法是线程安全的。 </p>
<p>dispatch队列还实现其它一些常用函数,包括:<br>void dispatch_apply(size_t iterations, dispatch_queue_t queue, void (^block)(size_t)); //重复执行block,需要注意的是这个方法是同步返回,也就是说等到所有block执行完毕才返回,如需异步返回则嵌套在dispatch_async中来使用。多个block的运行是否并发或串行执行也依赖queue的是否并发或串行。<br>void dispatch_barrier_async(dispatch_queue_t queue, dispatch_block_t block); //这个函数可以设置同步执行的block,它会等到在它加入队列之前的block执行完毕后,才开始执行。在它之后加入队列的block,则等到这个block执行完毕后才开始执行。<br>void dispatch_barrier_sync(dispatch_queue_t queue, dispatch_block_t block); //同上,除了它是同步返回函数<br>void dispatch_after(dispatch_time_t when, dispatch_queue_t queue, dispatch_block_t block); //延迟执行block<br>最后再来看看dispatch队列的一个很有特色的函数:<br>void dispatch_set_target_queue(dispatch_object_t object, dispatch_queue_t queue);<br>它会把需要执行的任务对象指定到不同的队列中去处理,这个任务对象可以是dispatch队列,也可以是dispatch源(以后博文会介绍)。而且这个过程可以是动态的,可以实现队列的动态调度管理等等。比如说有两个队列dispatchA和dispatchB,这时把dispatchA指派到dispatchB:<br>dispatch_set_target_queue(dispatchA, dispatchB);<br>那么dispatchA上还未运行的block会在dispatchB上运行。这时如果暂停dispatchA运行:<br>dispatch_suspend(dispatchA);<br>则只会暂停dispatchA上原来的block的执行,dispatchB的block则不受影响。而如果暂停dispatchB的运行,则会暂停dispatchA的运行。<br>这里只简单举个例子,说明dispatch队列运行的灵活性,在实际应用中你会逐步发掘出它的潜力。<br>dispatch队列不支持cancel(取消),没有实现dispatch_cancel()函数,不像NSOperationQueue,不得不说这是个小小的缺憾。</p>
]]></content>
<summary type="html">
<h4 id="设计:"><a href="#设计:" class="headerlink" title="设计:"></a>设计:</h4><p>GCD的工作原理是:让程序平行排队的特定任务,根据可用的处理资源,安排他们在任何可用的处理器核心上执行任务。<br>一个任务可以是一
</summary>
<category term="疑难杂症" scheme="http://www.jeyblogs.com/categories/%E7%96%91%E9%9A%BE%E6%9D%82%E7%97%87/"/>
<category term="GCD Dispatch" scheme="http://www.jeyblogs.com/tags/GCD-Dispatch/"/>
</entry>
<entry>
<title>CocoaPods安装和使用</title>
<link href="http://www.jeyblogs.com/2015/10/23/CocoaPods%E5%AE%89%E8%A3%85%E5%92%8C%E4%BD%BF%E7%94%A8/"/>
<id>http://www.jeyblogs.com/2015/10/23/CocoaPods安装和使用/</id>
<published>2015-10-23T06:57:35.000Z</published>
<updated>2017-03-01T02:48:04.000Z</updated>
<content type="html"><![CDATA[<p>CocoaPods是iOS最常用的第三方类库管理工具,绝大部分有名的开源类库都支持CocoaPods。</p>
<h5 id="CocoaPods安装"><a href="#CocoaPods安装" class="headerlink" title="CocoaPods安装"></a>CocoaPods安装</h5><p>步骤参考:<a href="http://www.cnblogs.com/wayne23/p/3912882.html" target="_blank" rel="external">http://www.cnblogs.com/wayne23/p/3912882.html</a></p>
<h5 id="CocoaPods使用"><a href="#CocoaPods使用" class="headerlink" title="CocoaPods使用"></a>CocoaPods使用</h5><ol>
<li>安装完成后cd 项目路径 </li>
<li>pod init生成podfile文件,在项目路径下</li>
<li>编辑pod init</li>
<li>寻找第三方类库的方法,pod search 类库名字,然后复制到podfile</li>
<li>最后在项目目录下pod update</li>
</ol>
<p>最近使用CocoaPods来添加第三方类库,无论是执行pod install还是pod update都卡在了Analyzing dependencies不动<br>原因在于当执行以上两个命令的时候会升级CocoaPods的spec仓库,加一个参数可以省略这一步,然后速度就会提升不少。加参数的命令如下:<br>pod install –verbose –no-repo-update<br>pod update –verbose –no-repo-update</p>
]]></content>
<summary type="html">
<p>CocoaPods是iOS最常用的第三方类库管理工具,绝大部分有名的开源类库都支持CocoaPods。</p>
<h5 id="CocoaPods安装"><a href="#CocoaPods安装" class="headerlink" title="CocoaPods安装
</summary>
<category term="Tools" scheme="http://www.jeyblogs.com/categories/Tools/"/>
<category term="CocoaPods" scheme="http://www.jeyblogs.com/tags/CocoaPods/"/>
</entry>
<entry>
<title>使用Alcatraz来管理Xcode插件</title>
<link href="http://www.jeyblogs.com/2015/10/12/%E4%BD%BF%E7%94%A8Alcatraz%E6%9D%A5%E7%AE%A1%E7%90%86Xcode%E6%8F%92%E4%BB%B6/"/>
<id>http://www.jeyblogs.com/2015/10/12/使用Alcatraz来管理Xcode插件/</id>
<published>2015-10-12T08:06:36.000Z</published>
<updated>2017-03-01T02:48:20.000Z</updated>
<content type="html"><![CDATA[<p><img src="http://7xsdar.com1.z0.glb.clouddn.com/Alcatraz.png" alt="" title="img"></p>
<h5 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h5><p>Alcatraz 是一个帮你管理 Xcode 插件、模版以及颜色配置的工具。它可以直接集成到 Xcode 的图形界面中,让你感觉就像在使用 Xcode 自带的功能一样。</p>
<h5 id="安装和删除"><a href="#安装和删除" class="headerlink" title="安装和删除"></a>安装和删除</h5><p>第一步:关闭 Xcode。<br>第二步:如果你之前安装过Alcatraz,卸载它。运行命令:</p>
<pre><code>rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin~
</code></pre><p>第三步:最关键的一步,运行命令:</p>
<pre><code>find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
sudo xcode-select --reset
</code></pre><p>第四步:安装 Alcatraz。</p>
<pre><code>curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh | sh
</code></pre><h5 id="使用"><a href="#使用" class="headerlink" title="使用"></a>使用</h5><p>安装成功后重启 Xcode,选择load bundle,就可以在 Xcode 的顶部菜单中找到 Alcatraz,如下所示:<img src="http://7xsdar.com1.z0.glb.clouddn.com/Alcatraz-1.png" alt=""><br><br>点击 “Package Manager”,即可启动插件列表页面,如下所示:<br><img src="http://7xsdar.com1.z0.glb.clouddn.com/Alcatraz-2.png" alt=""><br>之后你可以在右上角搜索插件,对于想安装的插件,点击其左边的图标,即可下载安装,如下所示,我正在安装KImageNamed插件:<br><img src="http://7xsdar.com1.z0.glb.clouddn.com/Alcatraz-3.png" alt=""><br>安装完成后,再次点击插件左边的图标,可以将该插件删除。</p>
<h5 id="插件路径"><a href="#插件路径" class="headerlink" title="插件路径"></a>插件路径</h5><p>Xcode 所有的插件都安装在目录/Library/Application Support/Developer/Shared/Xcode/Plug-ins/下,你也可以手工切换到这个目录来删除插件。</p>
<h5 id="推荐的插件"><a href="#推荐的插件" class="headerlink" title="推荐的插件"></a>推荐的插件</h5><p>几乎所有开发者都知道Alcatraz是一个开源的包管理工具,可以让我们更轻松地管理各种插件。接下来就介绍下我的最推荐的10个插件:<br>10.HOStringSense<br>在编辑字符串的时候,它会在代码上方生成一个字数统计的提示框。当你需要编辑多行文本时,可以在弹出的文本框中编辑字符串内容,插件会自动进行字符转义的工作,并实时在代码中更新。<br><br>10.Peckham<br>可以在任何位置快速的import,快捷键为control+command+P .这样写import语句就非常的方便。</p>
<p>9.OMColorSense<br>一个简洁的可视化颜色插件。在你编辑颜色的RGB值的时候,会在代码上方出现一个小的色块,显示对应的颜色。点击色块还会弹出一个颜色编辑器,在编辑器中得到的色值会自动填入colorWithRed:green:blue:alpha:方法中,贴心!<br><br>8.Derived Data Exterminator<br>当你在编译项目的时候,是否曾为Xcode爆出的某个奇怪的错误绞尽脑汁?我想答案是肯定的,并且我们都明白,其中的一种错误的解决办法就是—删除DerivedData!尽管我们有很多种方法解决这个问题,但Derived Data Exterminator无疑是最便捷的那种。在我们将它集成到Xcode后,就可以一键清理Derived Data。<br><br>7.QuickLocalization<br>你是否已经厌倦了反复写NSLocalizedString?如果是,那么QuickLocalization插件可以助你一臂之力。当你在编辑字符串的时候,只需要按下option+shift+d,就可以将@“Any String”转换成NSLocalizedString(@”Any String”, nil)。而且还可以通过修改配置来定义要出现在comment字段中的内容。我已经离不开它了!<br>6.KSImageNamed<br>过去,我不得不频繁查看资源文件夹以查找合适的图片的名称。使用KSImageNamed插件后,会自动弹出图片名称的列表以供选择,而且还有缩略图,十分便捷。<br>图片由Kent Sutherland提供<br>5.ShowInGithub<br>代码审查是Netguru大神们生活方式的一部分。尽管大部分bug会在此阶段被检查出来,但我们仍然会在使用他人代码的时候发现问题。这个时候,ShowInGithub大显身手的时候到了,只需要按下ctrl+C或ctrl+G,就可以立即打开commit或file页面,同时支持Github和BitBucket,非常棒!<br><br>4.SCXcodeSwitchExpander<br>Switch语句相当繁琐。虽然它清楚地列出了在每种情况下应该处理的方式,但一个个填入枚举值那真是浪费时间。SCXcodeSwitchExpander插件可以帮我们完成这个工作,它可以自动获得所有的枚举值填入相应的位置,而我们只需在每个枚举值下面填入对应的逻辑即可,方便极了!<br><br>3.VVDocumenter-Xcode<br>尽管给所有的文件都做上注释的感觉很棒,但是你是否想过这得花多少时间?事实上,感谢VVDocumenter-Xcode,真不需要多少时间。它可以自动解析方法的参数及返回值,并形成Javadoc风格的注释。我们写的所有开源代码都使用了这个插件。<br><br>2.FuzzyAutocomplete<br>这个插件可以在编码的时候自动补全代码。它的强大之处在于,使用了与”Open Quickly”功能相同的算法,如,当你想使用“tableView:cellForRowAtIndexPath:”方法,原来需要输入冗长的“- (void)tableView:(UITableView *)tableViewce”才能匹配出方法,而现在只需要”- cellFor”就行,省事多了。<br><br>1.XcodeBoost<br>这是我最喜欢的插件,我完全想象不了如果编码的时候没有它怎么办。通过配置,我们可以使用光标或者不精确的选择就可以剪切或者拷贝代码行,可以在粘贴代码的时候不触发代码格式化,还可以通过在.m文件中拷贝方法,粘贴进.h文件的时候就可以得到自动格式成的方法声明,还有好些功能都可以实现。XcodeBoost,值得你拥有!<br><br>推荐应用<br>大部分时候,我使用Xcode进行编码,但同时我也会频繁使用其他的一些应用。<br>7.Status Barred<br>根据iTunesConnect Guidelines的要求,屏幕截图不应当包含状态栏,这个工具可以帮助我们平滑地去除状态栏,同时支持iPhone和iPad的屏幕截图。这个小应用虽然只做一件事,但是做得很好。<br><br>6.MacDown<br>你是否已经厌倦了在没有预览的情况下写markdown文件?又或者你使用的编辑器需要按下按钮才能显示预览效果?MacDown是一款方便的的markdown编辑器,它可以在markdown代码右边实时显示预览效果。<br><br>5.SimPholders<br>SimPholders是一个简单便捷的小应用,它会在Mac的工具栏上设置一个快捷按钮,开发者通过它就可以快速打开模拟器或是最近使用的应用。特别是当你需要处理应用文件夹内容的时候,你再也不需要一次次地点进模拟器和应用的文件夹了,用SimPholders就够了。<br><br>4.NetworkLink Conditioner<br>这是一个来自苹果官方的工具,它可以模拟任何网络环境,如3G,Edge等等,也可以重新定义当前的网络环境,如网络延迟、带宽或丢包率。NetworkLink Conditioner也可以应用于真机,但是使用的时候需要小心,使用这个工具不仅仅对使用者起作用,还会影响整个网络。</p>
<p>3.RestConsole<br>Rest Console是一个基于Google Chrome的插件,它提供了一个简单易用的REST可视化界面,使得调试API的工作变得更加有趣。RestConsole可以将返回结果格式化,使之便于阅读。同时它也支持oAuth。</p>
<p>2.Chisel<br>使用LLDB可以显著减少开发者的调试时间。Facebook开发了一套用于LLDB的命令十分有效,特别是当出现了一些难以复现的问题的时候。虽然熟悉它需要一定的时间,但是绝对值得。</p>
<p>1.SQLiteManager<br>SQLiteManager是一个Firefox上的管理SQLite的小插件。在用到CoreData的时候配合使用很方便。我常常觉得Xcode应该集成这方面的功能。它很简洁,我很喜欢这一点。</p>
]]></content>
<summary type="html">
<p><img src="http://7xsdar.com1.z0.glb.clouddn.com/Alcatraz.png" alt="" title="img"></p>
<h5 id="简介"><a href="#简介" class="headerlink" titl
</summary>
<category term="Tools" scheme="http://www.jeyblogs.com/categories/Tools/"/>
<category term="插件" scheme="http://www.jeyblogs.com/tags/%E6%8F%92%E4%BB%B6/"/>
</entry>
<entry>
<title>Mac测试模拟慢网速</title>
<link href="http://www.jeyblogs.com/2015/09/21/Mac%E6%B5%8B%E8%AF%95%E6%A8%A1%E6%8B%9F%E6%85%A2%E7%BD%91%E9%80%9F/"/>
<id>http://www.jeyblogs.com/2015/09/21/Mac测试模拟慢网速/</id>
<published>2015-09-21T07:08:16.000Z</published>
<updated>2017-03-01T02:47:02.000Z</updated>
<content type="html"><![CDATA[<p>先普及一下Kb,KB,Kbps,Mb,Mbps等一些列概念 <br> 1Byte = 8bit<br> 1KB (Kilobyte 千字节)=1024Byte<br> 1MB (Megabyte,兆字节,简称“兆”)=1024KB <br> 1GB (Gigabyte,吉字节,又称“千兆”)=1024MB<br> 1TB (Terabyte,太字节,或百万兆字节)=1024GB<br> 1KB=1024B<br> 1MB=1024KB<br> 1GB=1024MB <br> 1TB=1024GB</p>
<p>1 Kb和KB的区别:计算机中的信息都是二进制的0和1来表示,其中每一个0或1被称作一个位,用小写b表示,即bit(位);大写B表示byte,即字节,一个字节=八个位,即1B=8b;前面的大写K表示千的意思,即千个位(Kb)或千个字节(KB)。表示文件的大小单位,一般都使用字节(KB)来表示文件的大小。<br>2 Kb和Kbps的区别:首先要了解的是,ps指的是/s,即每秒。Kbps指的是网络速度,也就是每秒钟传送多少个千位的信息(K表示千位,Kb表示的是多少千个位),为了在直观上显得网络的传输速度较快,一般公司都使用kb(千位)来表示,如果是KBps,则表示每秒传送多少千字节。1KBps=8Kbps。ADSL上网时的网速是512Kbps,如果转换成字节,就是512/8=64KBps(即64千字节每秒)。 1389.25 Kbps =173.65625KB/S .另外比如你家1M宽带,理论上下载速度最高能达到1M/8=1024k/8=128KB</p>
<p>3 Mbps,MB/s了解了面的2这个应该好理解了,直接举例,例如:560Mbps即560兆bit每秒,p就是“每”的意思,同”/“是一样的,但是如果你要用“MB”来计量的话,就要除以8(1Byte=8bit)了,也就是560Mbps/8=70MBps </p>
<p>Mac下模拟慢网速其实apple已经提供工具了Network Link Conditioner,这个包含在Hardware IO Tools for Xcode工具包中,Xcode——Open Developer Tool——More Developer Tools<br>搜索hardware,找到对应版本的Hardware IO Tools for Xcode下载下来(不到30M吧),Network Link<br>看到下面的选择Network Link Conditioner.prefPane双击,打开系统偏好设置</p>
]]></content>
<summary type="html">
<p>先普及一下Kb,KB,Kbps,Mb,Mbps等一些列概念 <br> 1Byte = 8bit<br> 1KB (Kilobyte 千字节)=1024Byte<br> 1MB (Megabyte,兆字节,简称“兆”)=1024KB <br> 1GB
</summary>
<category term="Tools" scheme="http://www.jeyblogs.com/categories/Tools/"/>
<category term="模拟网速" scheme="http://www.jeyblogs.com/tags/%E6%A8%A1%E6%8B%9F%E7%BD%91%E9%80%9F/"/>
</entry>
<entry>
<title>苹果联系邮箱大全</title>
<link href="http://www.jeyblogs.com/2015/05/30/%E8%8B%B9%E6%9E%9C%E8%81%94%E7%B3%BB%E9%82%AE%E7%AE%B1%E5%A4%A7%E5%85%A8/"/>
<id>http://www.jeyblogs.com/2015/05/30/苹果联系邮箱大全/</id>
<published>2015-05-30T01:41:41.000Z</published>
<updated>2016-08-30T09:52:08.000Z</updated>
<content type="html"><![CDATA[<p>苹果开发者热线: 4006701855<br>申请邓氏编码出问题了可以拨打客服热线: 4008202669<br>AppReview@apple.com<br>应用在提交后(处于“审核中”),应用和应用内购的状态<br>状态更新通知——与开发者遭拒和影响审核时间相关的信息<br>应用遭拒通知咨询-快速审核请求<br>iTSPayments@apple.com<br>支付状态查询<br>与苹果向开发者支付费用相关的问题<br>咨询财务报表<br>AppStoreNotices@apple.com<br>App Store内应用侵权问题,比如我们可以投诉“摩根书院”的关键字侵权<br>DevPrograms@apple.com<br>iDP或ADC查询;<br>程序信息、收益、账户信息;<br>修改邮箱地址、公司联系地址、团队代理人(代理人才有权生成发布证书)<br>ADC产品、硬件等退费<br>ADC网站查询:合作伙请求<br>iDP-DTS@apple.com<br>代码级别的提问<br>API使用-代码崩溃/如何使用和查看Crash logs<br>X-code使用问题, 证书问题<br>修改代码可能会引发iTC上传错误或应用遭拒的情况<br>注意区别于上边这个地址,99$的iDP每年有2次技术支持的机会,申请地址如下:<a href="https://developer.apple.com/membercenter/index.action#techSupport" target="_blank" rel="external">https://developer.apple.com/membercenter/index.action#techSupport</a><br>iTunesConnect@apple.com<br>iTC遇到的任何错误<br>应用/应用内购买设置和管理<br>应用在商店里/用户评论投诉等相关的事宜<br>推广码查询<br>编辑应用信息(名称、评分、关键词、定价、本地化等)<br>iTC 用户以及应用内购买测试用户设置<br>关键词/商店搜索查询<br>iTC登陆事宜<br>崩溃日志<br>对Contact Us的疑问等<br>iAD激活和获取iAd模板<br>iTSBanking@apple.com<br>更新银行账户信息<br>与银行账户信息相关的事宜<br>协助填写银行信息表格<br>所有的开发者可通过iTC Contact Us 模块来修改银行账户信息,将表格发至这个邮箱<br>iTSTax@apple.com<br>与收入和销售税有关的问题-协助填写报税表格<br>处理报税表格<br>iTunesAppReporting@apple.com<br>销售/销售趋势报告理解的问题<br>报告丢失问题<br>– 销售/销售趋势报告与财务报告之差异</p>
]]></content>
<summary type="html">
<p>苹果开发者热线: 4006701855<br>申请邓氏编码出问题了可以拨打客服热线: 4008202669<br>AppReview@apple.com<br>应用在提交后(处于“审核中”),应用和应用内购的状态<br>状态更新通知——与开发者遭拒和影响审核时间相关的信息<
</summary>
<category term="Mac" scheme="http://www.jeyblogs.com/categories/Mac/"/>
<category term="苹果邮箱" scheme="http://www.jeyblogs.com/tags/%E8%8B%B9%E6%9E%9C%E9%82%AE%E7%AE%B1/"/>
</entry>
<entry>
<title>Jey的Github收藏</title>
<link href="http://www.jeyblogs.com/2015/03/20/Jey%E7%9A%84Github%E6%94%B6%E8%97%8F/"/>
<id>http://www.jeyblogs.com/2015/03/20/Jey的Github收藏/</id>
<published>2015-03-20T07:29:40.000Z</published>
<updated>2016-10-21T08:43:22.000Z</updated>
<content type="html"><![CDATA[<ol>
<li>ARAnimation(封装的动画库): <a href="https://github.com/AugustRush/ARAnimation" target="_blank" rel="external">https://github.com/AugustRush/ARAnimation</a></li>
<li>Masonry自动布局约束:<a href="https://github.com/SnapKit/Masonry" target="_blank" rel="external">https://github.com/SnapKit/Masonry</a></li>
<li>ALSystemUtilities:<a href="https://github.com/andrealufino/ALSystemUtilities" target="_blank" rel="external">https://github.com/andrealufino/ALSystemUtilities</a><br> 提供相当完整的 iOS 设备状态查询,包括电池、记忆体用量、网路状态、执行序数目或是越狱情况等等</li>
<li>YYText: <a href="https://github.com/ibireme/YYText" target="_blank" rel="external">https://github.com/ibireme/YYText</a><br> 显示和编辑富文本的文本框架。</li>
<li>AFNetworking: <a href="https://github.com/AFNetworking/AFNetworking" target="_blank" rel="external">https://github.com/AFNetworking/AFNetworking</a><br> 网络请求封装,不用多说</li>
<li>SDWebImage:<a href="https://github.com/rs/SDWebImage" target="_blank" rel="external">https://github.com/rs/SDWebImage</a><br> 对图片缓存库</li>
<li>MJRefresh:<a href="https://github.com/CoderMJLee/MJRefresh" target="_blank" rel="external">https://github.com/CoderMJLee/MJRefresh</a><br> 上下拉刷新ScrollView</li>
<li>MJExtension:<a href="https://github.com/CoderMJLee/MJExtension" target="_blank" rel="external">https://github.com/CoderMJLee/MJExtension</a><br> 是一套字典和模型Model之间互相转换的超轻量级框架</li>
<li>RTLabel:<a href="https://github.com/honcheng/RTLabel" target="_blank" rel="external">https://github.com/honcheng/RTLabel</a><br> 基于UILabel类的拓展,能够支持Html标记的富文本显示,它是基于Core Text,因此也支持Core Text上的一些东西。</li>
<li>TYSlidePageScrollView:<a href="https://github.com/12207480/TYSlidePageScrollView" target="_blank" rel="external">https://github.com/12207480/TYSlidePageScrollView</a><br>带header,footer,滑动菜单的,分页上下左右滑动的TYSlidePageScrollView</li>
<li>JZDragView:<a href="https://github.com/zys456465111/JZDragView" target="_blank" rel="external">https://github.com/zys456465111/JZDragView</a><br>能够往上或往下拖拉图片展现出更换图片时候的视差效果</li>
<li>LTInfiniteScrollView:<a href="https://github.com/ltebean/LTInfiniteScrollView" target="_blank" rel="external">https://github.com/ltebean/LTInfiniteScrollView</a><br>包含两种效果,一种是常见的横向无限滚动,一种是带有弹动效果的横向无限滚动</li>
<li>UzysAnimatedGifPullToRefresh:<a href="https://github.com/uzysjung/UzysAnimatedGifPullToRefresh" target="_blank" rel="external">https://github.com/uzysjung/UzysAnimatedGifPullToRefresh</a><br>只需要一些简单的代码就可以使用动态的 GIF 添加 PullToRefresh 效果到任意的 scrollView 中,上下拉刷新。</li>
<li>WebViewJavascriptBridge: <a href="https://github.com/marcuswestin/WebViewJavascriptBridge" target="_blank" rel="external">https://github.com/marcuswestin/WebViewJavascriptBridge</a><br>Obj-C和JavaScript通过UIWebViews/WebViews互通消息的一个iOS/OSX的桥梁</li>
<li>XMLDictionary: <a href="https://github.com/nicklockwood/XMLDictionary" target="_blank" rel="external">https://github.com/nicklockwood/XMLDictionary</a><br>解析xml 将XML文件转换为NSDictionary</li>
<li>AMWaveTransition: <a href="https://github.com/andreamazz/AMWaveTransition" target="_blank" rel="external">https://github.com/andreamazz/AMWaveTransition</a><br>实现了表格视图的自定义过渡效果。每一个单元格都实现了类似波形效果的动画切换</li>
<li>ParallaxTableViewHeader:<a href="https://github.com/Vinodh-G/ParallaxTableViewHeader" target="_blank" rel="external">https://github.com/Vinodh-G/ParallaxTableViewHeader</a><br>当 tableView 滚动时的时候 UITableView 头部视图的视差滚动视图。</li>
<li>PLPlayerKit:<a href="https://github.com/pili-engineering/PLPlayerKit" target="_blank" rel="external">https://github.com/pili-engineering/PLPlayerKit</a><br>是一个适用于 iOS 的音视频播放器 SDK,可高度定制化和二次开发,特色是支持 RTMP 和 HLS 直播流媒体播放,并且支持常见音视频文件例如 MP4/M4A 的播放。</li>
<li>MJParallaxCollectionView:<a href="https://github.com/mayuur/MJParallaxCollectionView" target="_blank" rel="external">https://github.com/mayuur/MJParallaxCollectionView</a><br>TableView的cell视觉差效果</li>
<li>YYKit:<a href="https://github.com/ibireme/YYKit" target="_blank" rel="external">https://github.com/ibireme/YYKit</a><br>是一组庞大、功能丰富的 iOS 组件。<br>• YYModel — 高性能的 iOS JSON 模型框架。<br>• YYCache — 高性能的 iOS 缓存框架。<br>• YYImage — 功能强大的 iOS 图像框架。<br>• YYWebImage — 高性能的 iOS 异步图像加载框架。<br>• YYText — 功能强大的 iOS 富文本框架。<br>• YYKeyboardManager — iOS 键盘监听管理工具。<br>• YYDispatchQueuePool — iOS 全局并发队列管理工具。<br>• YYAsyncLayer — iOS 异步绘制与显示的工具。<br>• YYCategories — 功能丰富的 Category 类型工具库。</li>
<li>FancyTabBar:<a href="https://github.com/marvelapp/FancyTabBar" target="_blank" rel="external">https://github.com/marvelapp/FancyTabBar</a><br>类似新浪微博那种弹出动画效果的TabBar</li>
<li>SDAutoLayout:<a href="https://github.com/gsdios/SDAutoLayout" target="_blank" rel="external">https://github.com/gsdios/SDAutoLayout</a><br>一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于做最简单易用的AutoLayout库。</li>
<li>SDCycleScrollView:<a href="https://github.com/gsdios/SDCycleScrollView" target="_blank" rel="external">https://github.com/gsdios/SDCycleScrollView</a><br>Autoscroll Banner. 无限循环图片、文字轮播器。</li>
<li>ZipArchive:<a href="https://github.com/ZipArchive/ZipArchive" target="_blank" rel="external">https://github.com/ZipArchive/ZipArchive</a><br>解压Zip包,解压文件</li>
<li>WZLBadge:<a href="https://github.com/weng1250/WZLBadge" target="_blank" rel="external">https://github.com/weng1250/WZLBadge</a><br>一行代码实现Badge效果,小红点</li>
<li>AGEmojiKeyboard:<a href="https://github.com/ayushgoel/AGEmojiKeyboard" target="_blank" rel="external">https://github.com/ayushgoel/AGEmojiKeyboard</a><br>iOS 上一个实现了对 emoji 表情支持的键盘控件</li>
<li>LBXScan:<a href="https://github.com/MxABC/LBXScan" target="_blank" rel="external">https://github.com/MxABC/LBXScan</a><br>二维码、扫码、扫一扫、ZXing和ios系统自带扫码封装,扫码界面效果封装</li>
<li>iOS-Oncenote:<a href="https://github.com/chenyufeng1991/iOS-Oncenote" target="_blank" rel="external">https://github.com/chenyufeng1991/iOS-Oncenote</a><br>一款类似于印象笔记Evernote的生活类iOS应用——朝夕笔记 Oncenote。</li>
<li>YTKNetwork:<a href="https://github.com/yuantiku/YTKNetwork" target="_blank" rel="external">https://github.com/yuantiku/YTKNetwork</a><br>猿题库 iOS 研发团队基于 AFNetworking 封装的 iOS 网络库,其实现了一套 High Level 的 API,提供了更高层次的网络访问抽象</li>
<li>uiimage-from-animated-gif:<a href="https://github.com/mayoff/uiimage-from-animated-gif" target="_blank" rel="external">https://github.com/mayoff/uiimage-from-animated-gif</a></li>
<li>GiFHUD:<a href="https://github.com/cemolcay/GiFHUD" target="_blank" rel="external">https://github.com/cemolcay/GiFHUD</a><br>progress hud for displaying only animated gif images. no labels (for now)</li>
<li>JSPatch:<a href="https://github.com/bang590/JSPatch" target="_blank" rel="external">https://github.com/bang590/JSPatch</a><br>热补丁</li>
<li>iosStudyResource:<a href="https://github.com/whytimber/iosStudyResource" target="_blank" rel="external">https://github.com/whytimber/iosStudyResource</a><br>牛人博客地址blogs</li>
<li>APNGKit:<a href="https://github.com/onevcat/APNGKit" target="_blank" rel="external">https://github.com/onevcat/APNGKit</a><br>一个高性能的框架用于在iOS中加载和展示APNG图片。</li>
<li>JBChartView:<a href="https://github.com/Jawbone/JBChartView" target="_blank" rel="external">https://github.com/Jawbone/JBChartView</a><br>实现效果非常不错的折线统计图和柱状统计图。可以动态绘制图表。手指在图表上滑动,会显示对应的数值。</li>
<li>JSQMessagesViewController:<a href="https://github.com/jessesquires/JSQMessagesViewController" target="_blank" rel="external">https://github.com/jessesquires/JSQMessagesViewController</a><br>是一个优雅的iOS消息类UI库。聊天界面封装</li>
<li>TLYShyNavBar: <a href="https://github.com/telly/TLYShyNavBar" target="_blank" rel="external">https://github.com/telly/TLYShyNavBar</a><br>自动滚动的导航条。</li>
<li>NVActivityIndicatorView:<a href="https://github.com/ninjaprox/NVActivityIndicatorView" target="_blank" rel="external">https://github.com/ninjaprox/NVActivityIndicatorView</a></li>
<li>CWStatusBarNotification:<a href="https://github.com/cezarywojcik/CWStatusBarNotification" target="_blank" rel="external">https://github.com/cezarywojcik/CWStatusBarNotification</a><br>一个在状态栏提醒信息的控件。可实现延迟自动消失</li>
<li>ResearchKit:<a href="https://github.com/ResearchKit/ResearchKit" target="_blank" rel="external">https://github.com/ResearchKit/ResearchKit</a><br>是苹果专为医学研究者打造的一款软件基础架构,用于帮助人们诊断各种疾病。</li>
<li>RDVTabBarController:<a href="https://github.com/robbdimitrov/RDVTabBarController" target="_blank" rel="external">https://github.com/robbdimitrov/RDVTabBarController</a><br>封装的TabBar</li>
<li>BButton :<a href="https://github.com/mattlawer/BButton" target="_blank" rel="external">https://github.com/mattlawer/BButton</a></li>
<li>JDStatusBarNotification:<a href="https://github.com/jaydee3/JDStatusBarNotification" target="_blank" rel="external">https://github.com/jaydee3/JDStatusBarNotification</a><br>状态栏提醒信息的控件。</li>
<li>UITableView-FDTemplateLayoutCell:<a href="https://github.com/forkingdog/UITableView-FDTemplateLayoutCell" target="_blank" rel="external">https://github.com/forkingdog/UITableView-FDTemplateLayoutCell</a><br>TableView自动布局,自动高度</li>
<li>PNChart:<a href="https://github.com/kevinzhow/PNChart" target="_blank" rel="external">https://github.com/kevinzhow/PNChart</a><br>折线统计图和柱状统计图,图表统计 </li>
<li>appirater:<a href="https://github.com/arashpayan/appirater" target="_blank" rel="external">https://github.com/arashpayan/appirater</a><br>一个可以直接使用到任何iPhone应用(iOS4.0及以上)中的开源类,用于提醒用户在打开App时,对应用进行评论或打分。AppStore评分</li>
<li>SearchHistory:<a href="https://github.com/zhiwupei/SearchHistory" target="_blank" rel="external">https://github.com/zhiwupei/SearchHistory</a><br>搜索历史标签</li>
<li>EAIntroView: <a href="https://github.com/ealeksandrov/EAIntroView" target="_blank" rel="external">https://github.com/ealeksandrov/EAIntroView</a><br>一个用来实现软件启动时介绍的控件,支持多个视图进行滑动显示。</li>
<li>SKTagView:<a href="https://github.com/zsk425/SKTagView" target="_blank" rel="external">https://github.com/zsk425/SKTagView</a><br>一款支持自动布局的标签tag.</li>
<li>iOS-Slide-Menu:<a href="https://github.com/aryaxt/iOS-Slide-Menu" target="_blank" rel="external">https://github.com/aryaxt/iOS-Slide-Menu</a><br>左侧菜单栏</li>
<li>JKCategories:<a href="https://github.com/shaojiankui/JKCategories" target="_blank" rel="external">https://github.com/shaojiankui/JKCategories</a><br>category,控件类别</li>
<li>NetworkEye:<a href="https://github.com/coderyi/NetworkEye" target="_blank" rel="external">https://github.com/coderyi/NetworkEye</a><br>网络调试库,可以监控App内HTTP请求并显示请求相关的详细信息,方便App开发的网络调试。</li>
<li>MDRadialProgress:<a href="https://github.com/mdinacci/MDRadialProgress" target="_blank" rel="external">https://github.com/mdinacci/MDRadialProgress</a><br>自定义显示进度状态视图</li>
<li>terminal-notifier: <a href="https://github.com/julienXX/terminal-notifier" target="_blank" rel="external">https://github.com/julienXX/terminal-notifier</a><br>一个用来给 Mac OS X 用户发送通知的命令行工具</li>
<li>TTTAttributedLabel:<a href="https://github.com/TTTAttributedLabel/TTTAttributedLabel" target="_blank" rel="external">https://github.com/TTTAttributedLabel/TTTAttributedLabel</a><br>是 UILable 的改进,支持 NSAttributedStrings,据说用起来比较方便,但是需要增加很多代码,但比较灵活</li>
<li>CocoaLumberjack:<a href="https://github.com/CocoaLumberjack/CocoaLumberjack" target="_blank" rel="external">https://github.com/CocoaLumberjack/CocoaLumberjack</a><br>Mac和iOS上一个集快捷、简单、强大和灵活于一身的日志框架。</li>
<li>realm-cocoa:<a href="https://github.com/realm/realm-cocoa" target="_blank" rel="external">https://github.com/realm/realm-cocoa</a><br>是一个跨平台的移动数据库引擎,于 2014 年 7 月发布,准确来说,它是专门为移动应用所设计的数据持久化解决方案之一。</li>
<li>MobileProject:<a href="https://github.com/wujunyang/MobileProject" target="_blank" rel="external">https://github.com/wujunyang/MobileProject</a><br>开发框架</li>
<li>MagicalRecord:<a href="https://github.com/magicalpanda/MagicalRecord" target="_blank" rel="external">https://github.com/magicalpanda/MagicalRecord</a><br>第三方库实现的数据库</li>
<li>iOSBlogCN:<a href="https://github.com/tangqiaoboy/iOSBlogCN" target="_blank" rel="external">https://github.com/tangqiaoboy/iOSBlogCN</a><br>中文 iOS/Mac 开发博客列表</li>
<li>TopTabControl:<a href="https://github.com/liqiushui/TopTabControl" target="_blank" rel="external">https://github.com/liqiushui/TopTabControl</a><br>类似于网易新闻主界面中切换菜单的一个空间,定制自由度高。</li>
<li>IQKeyboardManager:<a href="https://github.com/hackiftekhar/IQKeyboardManager" target="_blank" rel="external">https://github.com/hackiftekhar/IQKeyboardManager</a><br>键盘</li>
<li>UICollectionView-Pure-code:<a href="https://github.com/cjq002/UICollectionView-Pure-code" target="_blank" rel="external">https://github.com/cjq002/UICollectionView-Pure-code</a><br>使用纯代码创建UICollectionView,自定义cell,添加类似tableViewHeader的头部。</li>
<li>iOS-H.264-hareware-encode-and-decode:<a href="https://github.com/LevyGG/iOS-H.264-hareware-encode-and-decode" target="_blank" rel="external">https://github.com/LevyGG/iOS-H.264-hareware-encode-and-decode</a><br>使用 Video Toolbox 进行H.264编码,视频播放</li>
<li>PLCameraStreamingKit:<a href="https://github.com/pili-engineering/PLCameraStreamingKit" target="_blank" rel="external">https://github.com/pili-engineering/PLCameraStreamingKit</a><br>视频播放,一个适用于 iOS 的 RTMP 直播推流 SDK,可高度定制化和二次开发。特色是支持 iOS Camera 画面捕获并进行 H.264 硬编码,以及支持 iOS 麦克风音频采样并进行 AAC 硬编码;同时,还根据移动网络环境的多变性,实现了一套可供开发者灵活选择的编码参数集合。</li>
<li>GPUImage:<a href="https://github.com/BradLarson/GPUImage" target="_blank" rel="external">https://github.com/BradLarson/GPUImage</a><br>一个基于GPU图像和视频处理的开源iOS框架,提供各种各样的图像处理滤镜,并且支持照相机和摄像机的实时滤镜; 基于GPU的图像加速,因此可以加速对实时摄像头视频、电影以及image的滤镜和其它效果处理,并且能够自定义图像滤镜</li>
<li>TZImagePickerController:<a href="https://github.com/banchichen/TZImagePickerController" target="_blank" rel="external">https://github.com/banchichen/TZImagePickerController</a><br>一个支持多选、选原图和视频的图片选择器,同时有预览功能,适配了iOS6789系统。</li>
<li>XMPPFramework:<a href="https://github.com/robbiehanson/XMPPFramework" target="_blank" rel="external">https://github.com/robbiehanson/XMPPFramework</a><br>一个OS X/iOS平台的开源项目,使用Objective-C实现了XMPP协议(RFC-3920),同时还提供了用于读写XML的工具,大大简化了基于XMPP的通信应用的开发。</li>
<li>CocoaAsyncSocket:<a href="https://github.com/robbiehanson/CocoaAsyncSocket" target="_blank" rel="external">https://github.com/robbiehanson/CocoaAsyncSocket</a><br>封装了CFSocket和CFSteam的TCP/IP socket网络库。它提供了异步操作,本地cocoa类的基于delegate的完整支持。</li>
<li>ACCodeSnippetRepositoryPlugin:<a href="https://github.com/acoomans/ACCodeSnippetRepositoryPlugin" target="_blank" rel="external">https://github.com/acoomans/ACCodeSnippetRepositoryPlugin</a><br>是 Xcode 的一个代码段的管理插件,像管理Xcode的插件一样,在Xcode里管理代码段是不容易的。该插件用Git仓库来同步Xcode的代码片段。</li>
<li>HZExtend:<a href="https://github.com/GeniusBrother/HZExtend" target="_blank" rel="external">https://github.com/GeniusBrother/HZExtend</a><br>1.解放VC:基于MVVM的思想,将数据相关的业务逻辑交给到ViewModel处理从而减少控制器的压力,降低代码耦合.<br>2.网络请求:基于AFN自定义了贴切业务逻辑的网络请求框架.<br>3.缓存体系:基于TMCache定制与业务逻辑相符的缓存体系.<br>4.数据元组:基于FMDB自定于实现了与表元组对应的数据模型.<br>5.URLManager:根据URL进行页面的跳转导航<br>6.一些常用的基础类扩展.</li>
<li>ReactiveCocoa:<a href="https://github.com/ReactiveCocoa/ReactiveCocoa" target="_blank" rel="external">https://github.com/ReactiveCocoa/ReactiveCocoa</a><br>由Github开源的一个应用于iOS和OS开发的新框架,Cocoa是苹果整套框架的简称,因此很多苹果框架喜欢以Cocoa结尾。</li>
<li>Mantle:<a href="https://github.com/Mantle/Mantle" target="_blank" rel="external">https://github.com/Mantle/Mantle</a><br>iOS和Mac平台下基于Objective-C编写的一个简单高效的模型层框架。</li>
<li>UIGestureRecognizer:<a href="https://github.com/cjq002/UIGestureRecognizer" target="_blank" rel="external">https://github.com/cjq002/UIGestureRecognizer</a><br>Tap(点击)、Pinch(捏合)、Rotation(旋转)、Swipe(滑动)、Pan(拖移)、LongPress(长按)手势的创建和使用。</li>
<li>OWUProximityManager:<a href="https://github.com/ohwutup/OWUProximityManager" target="_blank" rel="external">https://github.com/ohwutup/OWUProximityManager</a><br>一个方便的 iBeacon + CoreBluetooth 管理器</li>
<li>DGAdLaunchView:<a href="https://github.com/Desgard/DGAdLaunchView" target="_blank" rel="external">https://github.com/Desgard/DGAdLaunchView</a><br>登录页广告</li>
<li>BetterDribbble:<a href="https://github.com/zangqilong198812/BetterDribbble" target="_blank" rel="external">https://github.com/zangqilong198812/BetterDribbble</a></li>
<li>XLVideoPlayer:<a href="https://github.com/ShelinShelin/XLVideoPlayer" target="_blank" rel="external">https://github.com/ShelinShelin/XLVideoPlayer</a><br>基于AVFoundation的视频播放器</li>
<li>BarrageRenderer:<a href="https://github.com/unash/BarrageRenderer" target="_blank" rel="external">https://github.com/unash/BarrageRenderer</a><br>开源弹幕渲染库.</li>
<li>JMHoledView:<a href="https://github.com/leverdeterre/JMHoledView" target="_blank" rel="external">https://github.com/leverdeterre/JMHoledView</a><br>添加一片圆形,方型,圆角方型以及自定义视图的高亮区域到视图当中。可以用于应用页面的某些强调说明,点击该区域支持delegate回调,指导操作页</li>
<li>PinYin4Objc:<a href="https://github.com/kimziv/PinYin4Objc" target="_blank" rel="external">https://github.com/kimziv/PinYin4Objc</a><br>最好用的汉字转拼音代码PinYin4Objc</li>
<li>JHChainableAnimations:<a href="https://github.com/jhurray/JHChainableAnimations" target="_blank" rel="external">https://github.com/jhurray/JHChainableAnimations</a><br>实现易读链式动画写法</li>
<li>Canvas:<a href="https://github.com/CanvasPod/Canvas" target="_blank" rel="external">https://github.com/CanvasPod/Canvas</a></li>
<li>iCarousel:<a href="https://github.com/nicklockwood/iCarousel" target="_blank" rel="external">https://github.com/nicklockwood/iCarousel</a><br>是一个用来简化在 iOS 上实现旋转木马时的视图切换效果,支持 iPad,提供多种切换效果。内容类似的页面需要并排列出来,供用户选择。iCarousel具有非常酷的3D效果,比如经典的CoverFlow, TimeMachine。另外还具有线性,圆柱状等其它效果。可用于图片选择,书籍选择,网页选择等。</li>
<li>DTCoreText:<a href="https://github.com/Cocoanetics/DTCoreText" target="_blank" rel="external">https://github.com/Cocoanetics/DTCoreText</a><br>iOS/OSX里的文字渲染引擎,在iOS/OSX上看到的所有文字在底层都是由CoreText去渲染。</li>
<li>DACircularProgress:<a href="https://github.com/danielamitay/DACircularProgress" target="_blank" rel="external">https://github.com/danielamitay/DACircularProgress</a><br>圆环的进度指示栏。圆形进度条</li>
<li>KRVideoPlayer:<a href="https://github.com/36Kr-Mobile/KRVideoPlayer" target="_blank" rel="external">https://github.com/36Kr-Mobile/KRVideoPlayer</a><br>类似Weico的播放器,支持竖屏模式下全屏播放</li>
<li>DAAppsViewController:<a href="https://github.com/danielamitay/DAAppsViewController" target="_blank" rel="external">https://github.com/danielamitay/DAAppsViewController</a><br>可以按多种方式查看App Store上的App,比如按照开发者的ID查看所有该开发者发布的App,或者按照App ID查看对应的某个App,或者按照App Bundle,也可以搜索某个关键字显示所有搜索结果。</li>
<li>SAMKeychain:<a href="https://github.com/soffes/SAMKeychain" target="_blank" rel="external">https://github.com/soffes/SAMKeychain</a><br>在应用间利用KeyChain共享数据</li>
<li>PINRemoteImage:<a href="https://github.com/pinterest/PINRemoteImage" target="_blank" rel="external">https://github.com/pinterest/PINRemoteImage</a><br>一个线程安全的,高性能,功能丰富的图像下载iOS库</li>
<li>FFmpeg:<a href="https://github.com/FFmpeg/FFmpeg" target="_blank" rel="external">https://github.com/FFmpeg/FFmpeg</a><br>FFmpeg发送流媒体的命令</li>
<li>XHImageViewer:<a href="https://github.com/JackTeam/XHImageViewer" target="_blank" rel="external">https://github.com/JackTeam/XHImageViewer</a><br>实现图片浏览功能,点击图片,开启图片全屏浏览模式。支持下载和显示网络图片</li>
<li>XXBRippleView:<a href="https://github.com/sixTiger/XXBRippleView" target="_blank" rel="external">https://github.com/sixTiger/XXBRippleView</a><br>水波纹效果</li>
<li>BTSimpleRippleButton:<a href="https://github.com/balram3429/BTSimpleRippleButton" target="_blank" rel="external">https://github.com/balram3429/BTSimpleRippleButton</a><br>水波纹效果按钮</li>
<li>DownloadButton:<a href="https://github.com/PavelKatunin/DownloadButton" target="_blank" rel="external">https://github.com/PavelKatunin/DownloadButton</a><br>自定义的 App Store 风格的下载按钮。可自定义设计组件,用 IB 进行编辑。</li>
<li>sdkdemoapp3.0:<a href="https://github.com/easemob/sdkdemoapp3.0_ios" target="_blank" rel="external">https://github.com/easemob/sdkdemoapp3.0_ios</a><br>环信</li>
<li>iOSKeyPointExploration:<a href="https://github.com/huang303513/iOSKeyPointExploration" target="_blank" rel="external">https://github.com/huang303513/iOSKeyPointExploration</a><br>GCD系列、Operation、KVC、KVO、Notification、响应链、模型解析、图片本地缓存、</li>
<li>TMCache:<a href="https://github.com/tumblr/TMCache" target="_blank" rel="external">https://github.com/tumblr/TMCache</a><br>缓存</li>
<li>FBAnnotationClustering:<a href="https://github.com/infinum/FBAnnotationClustering" target="_blank" rel="external">https://github.com/infinum/FBAnnotationClustering</a><br>地图适分法</li>
<li>MiaowShow:<a href="https://github.com/SunLiner/MiaowShow" target="_blank" rel="external">https://github.com/SunLiner/MiaowShow</a><br>iOS视频直播项目</li>
<li>BabyBluetooth:<a href="https://github.com/coolnameismy/BabyBluetooth" target="_blank" rel="external">https://github.com/coolnameismy/BabyBluetooth</a><br>蓝牙</li>
<li>BeaconOSX:<a href="https://github.com/mttrb/BeaconOSX" target="_blank" rel="external">https://github.com/mttrb/BeaconOSX</a></li>
<li><a href="https://github.com/coolnameismy/demo" target="_blank" rel="external">https://github.com/coolnameismy/demo</a><br>基础实用东西</li>
<li>hexo-theme-next:<a href="https://github.com/iissnan/hexo-theme-next" target="_blank" rel="external">https://github.com/iissnan/hexo-theme-next</a><br>next主题</li>
<li>PodsRepertory:<a href="https://github.com/heyuan110/PodsRepertory" target="_blank" rel="external">https://github.com/heyuan110/PodsRepertory</a></li>
<li>study:<a href="https://github.com/ming1016/study" target="_blank" rel="external">https://github.com/ming1016/study</a><br>学习资料</li>
<li>popping:<a href="https://github.com/schneiderandre/popping" target="_blank" rel="external">https://github.com/schneiderandre/popping</a><br>封装的动画库</li>
<li>AYBubbleView:<a href="https://github.com/AYJk/AYBubbleView" target="_blank" rel="external">https://github.com/AYJk/AYBubbleView</a><br>QQ / 仿qq的可拖拽未读气泡</li>
<li>TagView:<a href="https://github.com/xhzengAIB/TagView" target="_blank" rel="external">https://github.com/xhzengAIB/TagView</a><br>图片标签,分叉树标签</li>
<li>FunctionGuideController:<a href="https://github.com/wbxiaowangzi/FunctionGuideController" target="_blank" rel="external">https://github.com/wbxiaowangzi/FunctionGuideController</a><br>新功能引导控制器,传入两个数组就能使用,由于添加了自定义字体,和图片资源,所以比较大,代码本身并不大</li>
<li>KVOController:<a href="https://github.com/facebook/KVOController" target="_blank" rel="external">https://github.com/facebook/KVOController</a><br>FBKVOControlloer是FaceBook开源的一个 在 iOS,maxOS上使用 kvo的 开源库;<br>提供了block和@selector(SEL) 的回调操作,很方便实用</li>
<li>SXWaveAnimate: <a href="https://github.com/dsxNiubility/SXWaveAnimate" target="_blank" rel="external">https://github.com/dsxNiubility/SXWaveAnimate</a><br>水花无限循环,灌水是用图片做的,现在已经改成了用贝塞尔曲线画,水波纹,百分比数字</li>
<li>Context-Menu.iOS:<a href="https://github.com/Yalantis/Context-Menu.iOS" target="_blank" rel="external">https://github.com/Yalantis/Context-Menu.iOS</a><br>可以为app的菜单添加漂亮的动画展开菜单,可自定义icon,并可根据自己的喜好设计单元格和布局。</li>
<li>BSCycleTextView:<a href="https://github.com/blurryssky/BSCycleTextView" target="_blank" rel="external">https://github.com/blurryssky/BSCycleTextView</a><br>滚动文字,循环</li>
<li>MarqueeLabel:<a href="https://github.com/cbpowell/MarqueeLabel" target="_blank" rel="external">https://github.com/cbpowell/MarqueeLabel</a><br>一个实现了超长文本的自动滚动显示,类似 HTML 里的 \<marquee\> 标签的行为。</marquee\></li>
<li>iOS_3D_ClusterAnnotation:<a href="https://github.com/hadesh/iOS_3D_ClusterAnnotation" target="_blank" rel="external">https://github.com/hadesh/iOS_3D_ClusterAnnotation</a><br>MAMapKit 点聚合,高德</li>
<li>JYJNavigationBar:<a href="https://github.com/jiangyongjian/JYJNavigationBar" target="_blank" rel="external">https://github.com/jiangyongjian/JYJNavigationBar</a><br>不一样的导航栏渐变效果</li>
<li>FDFullscreenPopGesture:<a href="https://github.com/forkingdog/FDFullscreenPopGesture" target="_blank" rel="external">https://github.com/forkingdog/FDFullscreenPopGesture</a><br>全屏POP手势动画,包含带顶栏标题和不带顶栏标题两种</li>
<li>MotionKit:<a href="https://github.com/MHaroonBaig/MotionKit" target="_blank" rel="external">https://github.com/MHaroonBaig/MotionKit</a><br>一款CoreMotion框架实用又简洁的的包装,并且全部使用Swift书写。Core Motion框架的作用是从设备硬件获取设备运动数据,并对获取到的数据进行了一层加工。数据来源可以是加速计,磁力仪和陀螺仪。另外你还可以从CMDeviceMotion获取提炼加工过的陀螺仪和加速计数据。</li>
<li>LocationManager:<a href="https://github.com/intuit/LocationManager" target="_blank" rel="external">https://github.com/intuit/LocationManager</a><br>定位管理</li>
<li>Reader:<a href="https://github.com/vfr/Reader" target="_blank" rel="external">https://github.com/vfr/Reader</a><br>阅读器,能够让 iOS 开发者轻而易举地在 iOS 设备屏幕上显示 PDF 文件。代码通用,不需要任何 XIB (因为所有 UI 元素都是代码生成的,具有极大的灵活性),运行于 iOS 4.0 及其以上版本设备中,同时还支持所有 Retina Display 设备。</li>
<li>Chameleon:<a href="https://github.com/ViccAlexander/Chameleon" target="_blank" rel="external">https://github.com/ViccAlexander/Chameleon</a><br>轻量级颜色框架</li>
<li>awesome-ios-cn:<a href="https://github.com/jobbole/awesome-ios-cn" target="_blank" rel="external">https://github.com/jobbole/awesome-ios-cn</a><br>iOS 资源大全中文版,内容包括:框架、组件、测试、Apple Store、SDK、XCode、网站、书籍等</li>
<li>Linkage:<a href="https://github.com/leejayID/Linkage" target="_blank" rel="external">https://github.com/leejayID/Linkage</a><br>【联动】:两个TableView之间的联动,TableView与CollectionView之间的联动,分类选择类似</li>
<li>FTreasure:<a href="https://github.com/Cherishforever/FTreasure" target="_blank" rel="external">https://github.com/Cherishforever/FTreasure</a><br>高仿网易1元夺宝</li>
<li>BGFMDB:<a href="https://github.com/huangzhibiao/BGFMDB" target="_blank" rel="external">https://github.com/huangzhibiao/BGFMDB</a><br>FMDB数据库封装</li>
<li>iOS-Echarts:<a href="https://github.com/Pluto-Y/iOS-Echarts" target="_blank" rel="external">https://github.com/Pluto-Y/iOS-Echarts</a><br>图表框架</li>
<li>NeiHanDuanZI:<a href="https://github.com/Charlesyaoxin/NeiHanDuanZI" target="_blank" rel="external">https://github.com/Charlesyaoxin/NeiHanDuanZI</a><br>纯干货:短期纯代码高仿优质《内涵段子》</li>
<li>SRClimate:<a href="https://github.com/guowilling/SRClimate" target="_blank" rel="external">https://github.com/guowilling/SRClimate</a><br>简约天气预报</li>
<li>SougouReading:<a href="https://github.com/YinTokey/SougouReading" target="_blank" rel="external">https://github.com/YinTokey/SougouReading</a><br>仿搜狗阅读 ,用 charles抓取数据</li>
<li>LZEasemob3:<a href="https://github.com/nacker/LZEasemob3" target="_blank" rel="external">https://github.com/nacker/LZEasemob3</a><br>酷信 | 高仿微信| WeChat | 高仿朋友圈 | moments| Github上最牛逼的高仿微信项目没有之一</li>
<li>SmallDay:<a href="https://github.com/ZhongTaoTian/SmallDay" target="_blank" rel="external">https://github.com/ZhongTaoTian/SmallDay</a><br>小日子 - By Swift 2.0</li>
</ol>
]]></content>
<summary type="html">
<ol>
<li>ARAnimation(封装的动画库): <a href="https://github.com/AugustRush/ARAnimation" target="_blank" rel="external">https://github.com/AugustR