나는 아래의 코드로 흔들기 제스쳐를 잡는 방법을 이미 알고있다.IOS보기를 변경하려면 흔들어보기
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
if (event.subtype == UIEventSubtypeMotionShake)
{
// Put in code here to handle shake
NSLog(@"Device Shaked");
}
if ([super respondsToSelector:@selector(motionEnded:withEvent:)])
[super motionEnded:motion withEvent:event];
}
NSLog는
의 흔들림을 받았지만 다른 뷰를 밀어 넣거나 마지막 뷰로 되돌려 보내는 방법을 보여준다. 우리는 아래 코드가 View 클래스 대신 ViewController 클래스에서만 사용할 수 있다는 것을 알고 있으므로이 Leavesview는 LeavesviewController가 처리하고 다른 viewViewroller를 사용하여 다른 PDFViewController에서 표시 할 수 있습니다. 어떻게 다른 뷰로 이동하거나 취소 할 수 있습니까? ??
UIViewController *myView = [[UIViewController alloc]init];
[self.navigationController pushViewController:myView animated:YES];
'viewDidDisappear :'의 사임을 호출해야한다고 생각하지 않습니다. 그것은 무해하지만 일반적으로 첫 번째 응답자를 사퇴시키는 코드를 추가하지는 않습니다. 그러나 그렇지 않으면 훌륭한 대답입니다. –