do swift: swift 무작정 해보기
TRANSCRIPT
I’m
김윤봉�@y8k�
OSXDev.org�2016�Swift�Study�Staff�
iOS�Developer�@�Viva�Republica�
iOSTip�FB�page��
LET�me�lOg
Swift�Project�시작
Swift�Release�History
Swift�1.0
2010
2014
2015 Swift�2.0
Swift�3.02016
WWDC�2014
WWDC�2015�/�Open�Sourced
by�Chris�Lattner
WWDC�2016
What?!
To quote Apple, “Objective-C is not going away, both Swift and Objective-C are first class citizens for doing Cocoa and Cocoa Touch development.”
So you can still use Objective-C. However, Apple seems to be encouraging you to use Swift for any new development, while not expecting you to go back and re-write all of your Objective-C code.
Although this is pure speculation, we are guessing Apple will also be moving away from Objective-C for future Framework and API development, and some day Objective-C may even be deprecated. So, hop aboard with the rest of the raywenderlich.com Team on the Swift train :]
Is Swift meant to replace Objective-C, or supplement it?
* https://www.raywenderlich.com/74138/swift-language-faq
TIOBE�Index
* http://www.tiobe.com/tiobe_index?page=index
StackOverflow�Report
* http://stackoverflow.com/research/developer-survey-2016#technology-most-loved-dreaded-and-wanted
Bottlenecks
손가락이�기억하고�있는�“[“,�“]”,�“;”,�“NS”,�“@“�
에라�모르겠다�모든�변수는�var로�통일한다!
Optional and Binding
Collection Types
Property
Binding
var nickName: String? nickName = “y8k”
if let name = nickName { self.nameLabel.text = name} else { self.nameLabel.text = “NoName” }
guard let name = nickName else { self.nameLabel.text = “NoName” return} self.nameLabel.text = name
Collection�Types
let alphabets: Array<String> = [“A”, “B”, “C”]
let roomAndNames: Dictionary<String, String>
= [“101” : “Kim”, “102” : “Lee”]
let alphabets: [String] = [“A”, “B”, “C”]
let roomAndNames: [String : String]
= [“101” : “Kim”, “102” : “Lee”]
let selectedNums: Set<Int> = [1, 2, 3]
Property
var name: String {
get {
}
set {
}
}
class fullName: Name {
override var firstName: String {
}
}
Protocol-Oriented�Programming
protocol Drivable {
var topSpeed: Int { get } }
protocol Transport { var seatCount: Int { get } }
struct Car: Drivable, Transport { var topSpeed = 150 var seatCount = 5 }
Cons.
Framework�API�사용은�거의�유사하다.�
Objective-C�능숙자는�여기까지만�알아도�큰�어려움�없이�Swift로�넘어올�수�있다.�하면서�배우게�되더라…�
Swift의�빠른�버전업으로�유지/보수�비용이�증가하나�코드의�간결성과�확장�용이로�인해�증가된�유지/보수�비용이�보상이�되기도�한다.�
Swift를�이용한�Open�Source�프로젝트�전�분야에�걸쳐�많은�시도가�일어나고�있다.�
Objective-C�코드와�Swift�코드는�한�프로젝트�내에서�혼합하여�사용가능하다.�단,�한�파일�내에�두�언어의�코드�혼합은�안됨.
OSXDev.org�Swift�Study
매달�1회�오프라인�스터디�진행�
Open�Study�
The�Swift�Programming�Language�by�Apple�inc.