2017-10-24 9 views
0

저는 8 개의보기 컨트롤러에 가깝습니다. 각각의 모든보기 컨트롤러에는 다음 및 뒤로 버튼이 있습니다. 어떻게하면 신속한 코드를 통해 왼쪽과 오른쪽으로 전환 할 수 있습니까? 이전 화면보기 제어기가 왼쪽에서 미끄러 져야하고 다음 화면 제어기에서 오른쪽으로 미끄러 져 가야합니다.iOS : 스위프트 : 오른쪽 및 왼쪽보기 컨트롤러가 다중보기 컨트롤러간에 전환

저는 iOS 개발에 새로운 경험이 있습니다. 사전

+1

'UIPageViewController'가 다음과 같이 설계되었습니다. https://developer.apple.com/documentation/uikit/uipageviewcontroller – DonMag

+0

@SrAn 당신이 원하는 것을 얻었습니까? –

답변

0

에서

덕분에 당신은 그것의 위임과 결합 UIPageViewController를 사용 할 수 있어야합니다.

그러나 대화 형 전환을 사용하는 사용자 지정 컨테이너의 내 오픈 소스 프로젝트 인 - InteractiveTransitioningContainer을 부끄러워 할 것입니다. 이 (가 UIPageViewController 작품과 방법 viewControllers을 통해 보내 주시면 허용하는 용기를 포함하는 예로서) 대화 형 컨테이너를 구현 할 수 있도록 목표로하는 동안, 당신은 당신이 원하는 것을 달성하기 위해 SwipeToSlideInteractiveTransitioningContainer 클래스를 사용할 수 있습니다 :

// here you will want your 8 controllers 
let vcs = [FirstViewController(), SecondViewController(), ThirdViewController()] 

let container = SwipeToSlideInteractiveTransitioningContainer(with: vcs) 
// this will disable swiping to navigate between containees 
container.interactive = false 
self.present(container, animated: true, completion: nil) 

// shows the second viewController (index based from 0) 
container.show(at: 1, animated: true) 

// or move using previous and next convenience methods 
let success = container.showNext(animated: true) 

에게 당신을 Cocoa 포드를 사용하여 설치할 수 있습니다. 의견 환영 :).