0

내 응용 프로그램에서 SWRevealViewController를 사용하여 사이드 메뉴를 구현했습니다. 거기에, 어떤 이유에서 볼 컨트롤러 앞에 드러내는 뷰를 내비게이션 컨트롤러에 넣어야했습니다.SWRevealViewController panGesture 문제 - IOS/Swift

이 내 스토리 보드입니다

enter image description here

모든 것은 한 가지 이외의 잘 작동합니다. 내 홈보기에서 화면의 왼쪽 가장자리에서 오른쪽으로 (팬 제스처) 끌면 사이드 메뉴 대신 이전보기 (여기서는 중간에 단추가 들어있는 중간보기)로 이동합니다. .

이는 그렇게 끌어 때 사이드 메뉴를이를 방지하고 싶어

enter image description here

을 드래그 할 때처럼 보이는 방법이다. 누군가가 나를 도울 수 있습니까? 어떤 도움을 주시면 감사하겠습니다.

편집 :

이것은 front_view 그리고 당신은 당신이 할 수 싶지 않아 모든보기 컨트롤러의 탐색 컨트롤러에서 popGesture를 제거해야

enter image description here

+0

스토리 보드의 어떤 장면이 rear_view 및 front_view인지 알려주시겠습니까? –

+0

@nikdange_me 사실 그들은 이미지에 없습니다. 잠깐 내가 내 질문을 편집하겠습니다. – GMHSJ

+0

형제 님, 해결책을 찾으면 답을 받아 들일 필요가 있습니다. 그렇지 않으면 사람들은 질문에 답하지 않을 것입니다. –

답변

1

ViewController.swift 파일 처음 버튼을 가지고있는 ViewController를위한 e.

class ViewController: UIViewController { 

    override func viewDidLoad() { 
     super.viewDidLoad() 

     // Do any additional setup after loading the view. 
    } 

    override func viewDidAppear(_ animated: Bool) { 
     super.viewDidAppear(animated) 
     self.navigationController?.interactivePopGestureRecognizer?.isEnabled = false 

    } 

    override func didReceiveMemoryWarning() { 
     super.didReceiveMemoryWarning() 
     // Dispose of any resources that can be recreated. 
    } 


    /* 
    // MARK: - Navigation 

    // In a storyboard-based application, you will often want to do a little preparation before navigation 
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 
     // Get the new view controller using segue.destinationViewController. 
     // Pass the selected object to the new view controller. 
    } 
    */ 

} 

swrevealviewcontroller 구현에는 문제가 없지만 탐색 컨트롤러의 기본 동작으로 인해이 문제가 발생합니다.

+0

UINavigationControllerDelegate는 필요하지 않습니다. 그렇지? – GMHSJ

+0

아니요, 필수 사항은 아닙니다. 그것을 제거하십시오 –

+0

어쨌든, 도와 줘서 고마워. 그것은 간단하고 일했습니다. 건배 – GMHSJ

1

rear_view입니다 스 와이프 제스처를 사용하려면 :

var gestureRecognizer: UIGestureRecognizer? { 
    guard let nc = navigationController else { return nil } 
    return nc.interactivePopGestureRecognizer 
    } 

    override func viewDidAppear(_ animated: Bool) { 
    super.viewDidAppear(animated) 

    if let gr = gestureRecognizer { 
     gr.isEnabled = false 
    } 
    } 
+0

@DJSK를 도와 주셔서 감사합니다. – GMHSJ