1
我正在研究一個需要菜單欄的應用程序,它應該用在許多不同的視圖中,所以這就是我所做的。如何通過點擊swift子視圖中的按鈕來改變父視圖(Xcode)
我做了一個子菜單,它是由Main.storyboard中的其他視圖加載的子視圖。
Main.storyboard -----這包含父視圖
SimpleCustomView.xib -----這是子視圖
這裏的問題是:
- 如何製作內的按鈕它可以更改Main.storyboard中的父視圖?所以用戶可以點擊菜單切換頁面。
我曾嘗試:
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "PC") as UIViewController
// self.presentViewController(vc, animated: true, completion: nil)
//superview.presentViewController(vc, animated: true, completion: nil)
無論是3號線,也沒有4號線工程。
所以我很困惑,我該怎麼做。
請不要將代碼作爲圖片發佈。請[編輯]您的問題,並將您的實際代碼複製並粘貼到您的問題中。 – rmaddy