「Ios/swift」の版間の差分
ナビゲーションに移動
検索に移動
編集の要約なし |
|||
| 21行目: | 21行目: | ||
#▶︎を押して再生 | #▶︎を押して再生 | ||
参照:http://vdeep.net/start-ios-swift | 参照:http://vdeep.net/start-ios-swift | ||
==swiftバージョン確認== | |||
$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -v | |||
Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31) | |||
2016年6月17日 (金) 12:43時点における版
swift準備
- macのapp_storeでxcodeをインストール
- create new projectを選択
- Single View Applicationを選択
- ProductNameをHelloworld、OriginalIdをcom.example、LanguageをSwift、DevicesをiPhoneで作成
コンソールにHelloworld
- ViewController.swiftの以下の場所にprintを追加
override func viewDidLoad() {
super.viewDidLoad()
print("Helloworld");
}
- ▶︎を押して再生すると右下のコンソール欄にHelloworldと表示される
参照:http://qiita.com/maximum80/items/4116985b7276fdb45576
画面上にHelloworldのラベルを表示
- Main.storyboradを選択し、右下の◎を選択してオブジェクト一覧を選択
- Labelを中央にドラッグしてくる。
- LabelにHelloworldを記載し
- ▶︎を押して再生
参照:http://vdeep.net/start-ios-swift
swiftバージョン確認
$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -v Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31)