スポンサーリンク

【Swift】UINavigationItem | ポケットリファレンス サンプル付き

UINavigationItem サンプル

サンプルで動作を確認 コピーペーストで確認できます。

// タイトルを設定
self.navigationItem.title = "タイトル"

// プロンプトを設定
self.navigationItem.prompt = "プロンプト"

// ビゲーションの右側にボタンを複数配置
self.navigationItem.setRightBarButtonItems((myRightButtons as! [UIBarButtonItem]), animated: true)

// ビゲーションの左側にボタンを1つ配置
self.navigationItem.setLeftBarButtonItem(uiBarButtonItem3, animated: true)

UINavigationItem 概要

ナビゲーションバーボタンの詳細を設定します。

おすすめの本