not good but great

プログラミング、アート、映画・本の感想について書きます。

2015-06-29から1日間の記事一覧

Trailing closure syntaxを使ってsplitのisSepalatorを省略する

let num = "one,two,three" //["one", "two", "three"] let array = split(num){ $0 == "," } SwiftではcomponentsSeparatedByStringではなく、splitで文字列を分割することができる。またTrailing closure syntaxを使って、isSepalatorを省略することもでき…