1
NavigationBar에 포함 된 ViewController가 있습니다.수정 및 UINavigationBar 다시 단추의 동작 사용자 지정
조건이 fullfilled 경우- 는, 조건이 fullfilled되지 않은 경우, 뒤로 버튼
- 의 정상적인 동작을 적용 머물면서에 남아 : 나는 탐색 모음에서 뒤로 버튼은 다음과 같은 효과를 갖고 싶어 같은 VC는
NavigationBar에 포함 된 ViewController가 있습니다.수정 및 UINavigationBar 다시 단추의 동작 사용자 지정
조건이 fullfilled 경우이 같은 시도 뭔가해야 할 일 : -
override func viewDidLoad() {
let transparentButton = UIButton()
transparentButton.frame = CGRectMake(0, 0, 50, 40)
transparentButton.backgroundColor = UIColor.orangeColor()
transparentButton.addTarget(self, action:"backAction:", forControlEvents:.TouchUpInside)
self.navigationController?.navigationBar.addSubview(transparentButton)
}
을 그리고 기능은
입니다func backAction(sender:UIButton) {
// check your condition
}
작업 : #selector (backAction (sender :) great – user3239711
) 네비게이션 컨트롤러의 정상적인 백을 수행하기 위해 'backAction'에 넣어야하는 코드를 알고 계십니까? ? – user3239711
예. 확인하고 싶은 조건을 놓고 성공하면 self.navigationController.popViewController (animated : true)로 돌아가서 커스텀 태스크를 수행하십시오. 내 이해를위한 – Himanshu