Ios UIScrollView分页插入下一页
如何创建包含插入下一页的页面的UIScrollView 我目前的代码如下:Ios UIScrollView分页插入下一页,ios,swift,swift3,Ios,Swift,Swift3,如何创建包含插入下一页的页面的UIScrollView 我目前的代码如下: class scrollViewController: UIViewController, UIScrollViewDelegate { @IBOutlet weak var scrollView: UIScrollView! override func viewDidLoad() { super.viewDidLoad() let V1 = self.storybo
class scrollViewController: UIViewController, UIScrollViewDelegate {
@IBOutlet weak var scrollView: UIScrollView!
override func viewDidLoad() {
super.viewDidLoad()
let V1 = self.storyboard?.instantiateViewController(withIdentifier: "homeToCategory") as UIViewController!
self.addChildViewController(V1!)
self.scrollView.addSubview((V1?.view)!)
V1?.didMove(toParentViewController: self)
V1?.view.frame = scrollView.bounds
let V2 = self.storyboard?.instantiateViewController(withIdentifier: "FeatureViewController") as UIViewController!
self.addChildViewController(V2!)
self.scrollView.addSubview((V2?.view)!)
V2?.didMove(toParentViewController: self)
V2?.view.frame = scrollView.bounds
var V2Frame: CGRect = V2!.view.frame
V2Frame.origin.x = self.view.frame.width
V2?.view.frame = V2Frame
self.scrollView.contentSize = CGSize(width:(self.view.frame.width) * 2, height: (self.view.frame.height))
self.scrollView.contentOffset = CGPoint(x: (self.view.frame.width) * 1, y: (self.view.frame.height))
}
}