我在使用scrollview的baseview控制器。在那個scrollview中我添加了三個viewcontrollers視圖(xib)。所以我可以在horizantal中滾動這三個。在我的第一個視圖控制器中,我顯示一個tablevieew.While運行我的應用程序,它顯示所有我的3視圖controllers.But當我觸摸我的tableview單元格消失。我已經在xcode 7.3中做了。它工作正常。但在xcode 8中它不工作。請幫我解決這個問題。我重視我的示例代碼在scrollview中添加視圖控制器ios swift
let scrollViewWidth:CGFloat = self.scrollContainer.frame.width
let scrollViewHeight:CGFloat = self.scrollContainer.frame.height
let x = CGFloat(i) * scrollViewWidth
if i == 0{
let qualification = EducationViewController (nibName: "EducationViewController", bundle: nil)
//qualification.view.frame.size.height = scrollViewHeight
//qualification.view.frame.size.width = scrollViewWidth
qualification.view.frame.origin.x = x
self.scrollContainer!.addSubview(qualification.view)
qualification.didMove(toParentViewController: self)
}
else if i == 1{
let state = StateRegistrationViewController (nibName: "StateRegistrationViewController", bundle: nil)
//state.view.frame.size.height = scrollViewHeight
// state.view.frame.size.width = scrollViewWidth
state.view.frame.origin.x = x
self.scrollContainer!.addSubview(state.view)
state.view.backgroundColor = UIColor.red
state.didMove(toParentViewController: self)
}
else if i == 2{
let exp = ExperienceViewController (nibName: "ExperienceViewController", bundle: nil)
// exp.view.frame.size.height = scrollViewHeight
// exp.view.frame.size.width = scrollViewWidth
exp.view.frame.origin.x = x
self.scrollContainer!.addSubview(exp.view)
exp.view.backgroundColor = UIColor.orange
exp.didMove(toParentViewController: self)
}}