赤い画面からスクロールできません。
ここを参照しました
Swift
1import UIKit 2 3class PageViewController: UIPageViewController { 4 5 override func viewDidLoad() { 6 super.viewDidLoad() 7 self.setViewControllers([getFirst()], direction: .Forward, animated: true, completion: nil) 8 // Do any additional setup after loading the view. 9 } 10 11 func getFirst() -> ChatViewController { 12 return storyboard!.instantiateViewControllerWithIdentifier("ChatViewController") as! ChatViewController 13 } 14 15 func getSecond() -> RankingViewController { 16 return storyboard!.instantiateViewControllerWithIdentifier("RankingViewController") as! RankingViewController 17 } 18 19 func getThird() -> ReviewViewController { 20 return storyboard!.instantiateViewControllerWithIdentifier("ReviewViewController") as! ReviewViewController 21 } 22 23 override func didReceiveMemoryWarning() { 24 super.didReceiveMemoryWarning() 25 // Dispose of any resources that can be recreated. 26 } 27 28 29 /* 30 // MARK: - Navigation 31 32 // In a storyboard-based application, you will often want to do a little preparation before navigation 33 override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 34 // Get the new view controller using segue.destinationViewController. 35 // Pass the selected object to the new view controller. 36 } 37 */ 38 39} 40 41//以下追加 42extension PageViewController : UIPageViewControllerDataSource { 43 44 func pageViewController(pageViewController: UIPageViewController, viewControllerBeforeViewController viewController: UIViewController) -> UIViewController? { 45 if viewController.isKindOfClass(ReviewViewController) { 46 // レビュー -> ランキング 47 return getSecond() 48 } else if viewController.isKindOfClass(RankingViewController) { 49 // ランキング -> チャット 50 return getFirst() 51 } else { 52 // チャット -> end of the road 53 return nil 54 } 55 } 56 57 func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController viewController: UIViewController) -> UIViewController? { 58 if viewController.isKindOfClass(ChatViewController) { 59 // チャット -> ランキング 60 return getSecond() 61 } else if viewController.isKindOfClass(RankingViewController) { 62 // 2 -> 3 63 return getThird() 64 } else { 65 // レビュー -> end of the road 66 return nil 67 } 68 } 69} 70
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。