방금 해결책을 찾았습니다! 페이지 뷰 컨트롤러에서
, 당신의 아이 뷰 컨트롤러에서
override func viewDidLoad(){
super.viewDidLoad()
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(yourpageviewcontroller.enableSwipe(_:)), name:"enableSwipe", object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(yourpageviewcontroller.disableSwipe(_:)), name:"disableSwipe", object: nil)
}
func disableSwipe(notification: NSNotification){
self.dataSource = nil
}
func enableSwipe(notification: NSNotification){
self.dataSource = self
}
를 다음을 추가, 당신은 단지에 따라 알림을 게시 할 수 있습니다.
NSNotificationCenter.defaultCenter().postNotificationName("enableSwipe", object: nil)
또는
NSNotificationCenter.defaultCenter().postNotificationName("disableSwipe", object: nil)