我在视图控制器中有分段按钮控件。
问题是当我点击"数据3"选项卡,它转到Data3 View Controller。
我想在ViewController-1 UI中显示Data3 View Controller(在分段控制按钮下)。
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let innerPage: Data3 = mainStoryboard.instantiateViewController(withIdentifier: “Data3”) as! MediaPack
self.present(innerPage, animated: true, completion: nil)
我怎么能这样做?
答案 0 :(得分:1)
要完成该任务,您可以使用包含viewController3的UiPageViewController或ContainerView。 查找以下链接以实施
<强> UiPageViewController 强> http://samwize.com/2015/10/13/how-to-create-uipageviewcontroller-in-storyboard-in-container-view/
<强> ContainerView 强> https://cocoacasts.com/managing-view-controllers-with-container-view-controllers/