ݺߣ

ݺߣShare a Scribd company logo
Swi$??iOS????? 
2014?9? 
???????? 
?
???? 
? 
mokemokechicken 
@{Twi6er, 
Facebook, 
Github, 
Qiita} 
? ????????2014??CTO 
???1????? 
? /????/??????/iOS 
?? 
? ?????????????? 
?
??PJ?????? 
????????????? 
(????????) 
? ??????? 
? ??Swi$? 
? Core 
Data??? 
?????????????????????? 
?
Swi$???? 
?
Swi$?????f 
??????Object???? 
???????????????????? 
???f?????? 
Generics???? 
CocoaPods 
????? 
???????????????(^^; 
?
??????Object???? 
var 
????????? 
let 
?????????? 
?????? 
?
???????????????????? 
??????????????????? 
?OK 
???? 
?
???f?????? 
????????? 
??????????????? 
? 
?????? 
?????????? 
?????????Closure????????? 
???Blocks? 
???? 
?
???f?? 
???? 
Pickup??? 
?
Module 
? ?????????? 
? import 
???Module?????? 
? Framework?ApplicaWon???????? 
??
Module 
????Project?Target?Module???? 
??
Module????? 
petamp 
Module??MyClass 
???Class? 
petamp.MyClass 
?????????? 
Module??????????????? 
??????????? 
??
Access??? 
? public 
protected 
???? 
C ??Module???????? 
? Internal 
(?????? 
C ??Module????????? 
C ??Module??????????? 
? private 
C ??????????????? 
C ????????????????? 
??
nil??????f?? 
????String??????????????????? 
????? 
?????? 
?? 
String 
String? 
String! 
???????????????? 
????Swi$??????
nil??????f?? 
????????nil??????? 
? 
??! 
??????nil 
?????? 
???????? 
??
nil??????f?? 
???????????? 
??? 
???????? 
??
nil??????f?? 
??!??? 
???????????? 
??????nil??????????? 
Nil??????? 
????? 
??
nil??????f?? 
?????? 
?????????!??????????????????? 
???? 
???????? 
??
nil??????f?? 
?????????????nil?????nil??? 
???!?????????nil??????????? 
????? 
???ObjC????? 
??
nil??????f?? 
?????? 
?? 
???! 
??? 
nil 
??????? 
if 
let 
name 
!= 
nil 
??? 
sureName 
? 
name! 
?????? 
??
nil??????f?? 
var 
name: 
String 
?????? 
? nil??? 
???????? 
???nil 
????? 
String ???? name.isEmpty ????? 
String? ??? 
name?.isEmpty 
nil??? 
name!.isEmpty ?????? 
String! ??? name.isEmpty ?????? 
????? 
???????? 
??
???????????? 
?????nil????????????? 
???? 
????????nil????? 
???nil?????????????????? 
????????????? 
??
Swi$?nil??????????????? 
Class??????? 
init() 
?????????? 
??????????? 
???NG 
????OK 
??
??????????: 
??? 
ViewController 
???init()????? 
???viewDidLoad 
?????????? 
????????? 
???! 
???????? 
???? 
???????????????? 
?IBOutlet??????? 
???!??????OK?f??? 
??
nil??????f?????? 
? ??????API?nil?????????? 
C ?????????????????? 
? nil???????????????????? 
Nil?? 
??
ObjecWve-?\C 
????? 
ObjC 
? 
Swi$???? 
project?-?\Bridging-?\Header.h 
?????????????? 
import???? 
petamp-?\Bridging-?\Header.h 
??
ObjecWve-?\C 
????? 
Swi$?ObjC???? 
1. Swi$?Class?public?????@objc???? 
2. ObjC???project?-?\Swi$.h 
? 
import?? 
petamp????????? 
??
@objc 
?????? 
?????????????? 
? ObjecWve-?\C??export???????? 
? Protocol?weak??????????? 
????????? 
??
Swi$??????? 
??
Header????????????? 
? ????????? 
? Property????f?????????? 
? ????????????????????? 
.h?.m? 
??????? 
????????? 
??
??Prefix?Class??????????? 
Module???????????YMY????? 
Prefix????Class????????????? 
??????????????? 
Prefix???????????? 
??????????? 
???????? 
??
???????nil??? 
? id?????????????????? 
? Generics?OpWonal????????? 
???????????????????????? 
? ??????????????????? 
?????? 
???? 
??
?????????????? 
? Closure?????? 
? ???Switch 
Case 
? enum 
??????? 
? ??????????????? 
? ???default??????? 
? Class 
property 
? 
get, 
set, 
willSet, 
didSet 
? extension 
??????Int 
???????? 
??
Swi$??????? 
??
ObjC?? 
weak????? 
???? 
property? 
Swi$??Object? 
???????????? 
NSObject?????????????? 
h6p://qiita.com/mokemokechicken/items/c0386acqb37429f9c16 
?? 
?? 
OK 
???????????nil????? 
??
@selector 
???Object??? 
UIBu6on#addTarget 
NSNoWficaWonCenter#addObserver 
????@selector??????????? 
???????Object? 
NSObject???????@objc 
????????? 
??????????Crash??? 
?? 
h6p://qiita.com/mokemokechicken/items/9d7b941a45a5534411c9
@selector 
???Object??? 
?? 
??????????????? 
Hoge 
????????? 
? 
NSObject??????? 
@objc 
??????????? 
h6p://qiita.com/mokemokechicken/items/9d7b941a45a5534411c9
protected??????????? 
? Java??C#????????????? 
? ?????ObjecWve?C????????? 
??? 
??
???????????? 
 
??????????????Module??? 
 
???????????????public 
??????? 
?? 
??
???????????? 
[??] 
???????????????public??? 
?????????????????????????? 
????? 
? 
??????????? 
???? 
????? 
??
???? 
? Swi$????????????????? 
? iOS???????????????? 
? ?? 
ObjecWve-?\C 
??????????????? 
Swi$ 
???? 
???????? 
??

More Related Content

ɾڳ٤?ξ?꿪k