본문 바로가기

Swift

Swift

반응형



첫 느낌.

javascript 같다.

어!? 

playground 가 아주 좋네

optional type 햇갈린다.


optional Type 은 nil 이 될 수도 있는 변수.

var stringType : string  = "not nil" // nil 이 될 수 없다.
var optionalStringType : string = nil // nil 이 될 수 없다.

null pointer exception 방어가 되려나..

왜 만들어졌을까?