We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var pageViewControllerList: [UIViewController] = []
func createPageViewController() { let sb = UIStoryboard(name: "WalkThrough", bundle: nil) let vc1 = sb.instantiateViewController(withIdentifier: FirstViewController.reuseIdentifier) as! FirstViewController let vc2 = sb.instantiateViewController(withIdentifier: SecondViewController .reuseIdentifier) as! SecondViewController let vc3 = sb.instantiateViewController(withIdentifier: ThirdViewController.reuseIdentifier) as! ThirdViewController pageViewControllerList = [vc1, vc2, vc3] }
extension PageViewController: UIPageViewControllerDelegate, UIPageViewControllerDataSource { func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? { // 현재 페이지뷰컨트롤러에 보이는 뷰컨(ViewController)의 인덱스 가져오기 guard let viewControllerIndex = pageViewControllerList.firstIndex(of: viewController) else { return nil } let previousIndex = viewControllerIndex - 1 return previousIndex < 0 ? nil : pageViewControllerList[previousIndex] } func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? { guard let viewControllerIndex = pageViewControllerList.firstIndex(of: viewController) else { return nil } let nextIndex = viewControllerIndex + 1 return nextIndex >= pageViewControllerList.count ? nil : pageViewControllerList[nextIndex] } func presentationCount(for pageViewController: UIPageViewController) -> Int { return pageViewControllerList.count } func presentationIndex(for pageViewController: UIPageViewController) -> Int { guard let first = viewControllers?.first, let index = pageViewControllerList.firstIndex(of: first) else { return 0 } return index } }
위에 presentationCount, presentaitonIndex는 무슨 코드일까?
display
func configurePageViewController() { delegate = self dataSource = self // display guard let first = pageViewControllerList.first else { return } setViewControllers([first], direction: .forward, animated: true) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
위에 presentationCount, presentaitonIndex는 무슨 코드일까?
display
The text was updated successfully, but these errors were encountered: