タブバーを変更するにはどうすればよいですか?私はこの投稿が重複しているように見えますが、私はそれに似た疑問を見つけることはできません。今の私の現在のスイッチタブバーにデータ送信が含まれています
のselectedIndex = 0
ので、私もそれが= 2
selectedIndexのあるタブ番号3に行くようにしたいしかし、私currentViewからnextViewにデータを送信したい私はプッシュ+のselectedIndexを使用している場合には、タブ3に進みますが、selectedIndexの= 0からビューをプッシュし、データはあなたが、これはデータを送信しようとすることができるのselectedIndex = 2 私の現在のコード
func redeemBtnPressed(_ sender: UIButton) { let selectedRedeemBtnInfo = fixedGridInfo[sender.tag] as! Dictionary<String, AnyObject> sender.showsTouchWhenHighlighted = true let storyboard = UIStoryboard(name: "FlightExploration", bundle: nil) let searchFlightVC = storyboard.instantiateViewController(withIdentifier: "SearchFlightVC") as! SearchFlightViewController var newFlightType = String() if "\(selectedRedeemBtnInfo["FlightType"]!)" == "Return" { newFlightType = "Round" } else { newFlightType = "One" } searchFlightVC.flightType = newFlightType searchFlightVC.fromHome = true searchFlightVC.departure = "\(selectedRedeemBtnInfo["Departure"]!) (\(selectedRedeemBtnInfo["DepartureCityCode"]!)" searchFlightVC.arrival = "\(selectedRedeemBtnInfo["Destination"]!) (\(selectedRedeemBtnInfo["DestinationCityCode"]!)" self.navigationController?.pushViewController(searchFlightVC, animated: true) tabBarController?.selectedIndex = 2 }
あなたは 'searchFlightVC'をプッシュする問題を解決タブ3のナビゲーションの右側にありますか? –
タブ0で何らかのアクションをクリックすると、いくつかのデータが送信されてタブが2に変わるはずですか? –
@NiravDの並べ替えのように、限り、私は選択したタブ3のすべてのそれらのデータを変更することができます。と同じビューにタブ1の滞在 –