UIButton サンプルサンプルで動作を確認 コピーペーストで確認できます。全体をコピー後、不必要な部分を削除することでコーディングを素早くできます。 // システムボタンを指定してボタンを作成 let button : UIButton = UIButton(type: UIButtonType.System) // ボタンに設定されている UILabel を取得 let uiLabel : UILabel = button.titleLabel! // ノーマル状態時のタイトルを取得 let stateTitle : String = button.titleForState(UIControlState.Normal)! // ステートを指定して、タイトルを設定 button.setTitle("タイトル",forState:UIControlState.Normal) // ステ
![【Swift】UIButton | ポケットリファレンス サンプル付き](https://cdn-ak-scissors.b.st-hatena.com/image/square/161b0fd26307cf643749b62cf8dfd5a93091b183/height=288;version=1;width=512/https%3A%2F%2Fblog.77jp.net%2Fwp-content%2Fuploads%2Feci%2Feci-xcode6.png)