0
모달 뷰 컨트롤러 프레젠테이션에 대한 알림을 받으려면 NSNotificationCenter
을 게시하고 내 사용자 지정 알림을 관찰 할 수 있지만 이러한 종류의 알림이 이미 있는지 알고 싶습니다.
감사합니다.
Andrea보기 컨트롤러가 새보기 컨트롤러를 모달로로드 할 때 알림을받을 수 있습니까?
모달 뷰 컨트롤러 프레젠테이션에 대한 알림을 받으려면 NSNotificationCenter
을 게시하고 내 사용자 지정 알림을 관찰 할 수 있지만 이러한 종류의 알림이 이미 있는지 알고 싶습니다.
감사합니다.
Andrea보기 컨트롤러가 새보기 컨트롤러를 모달로로드 할 때 알림을받을 수 있습니까?
해결책을 찾았습니다. 물론
- (void) presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated{
[[NSNotificationCenter defaultCenter] postNotificationName:PresentingModal object:self];
[super presentModalViewController:modalViewController animated: animated];
}
내 모든 뷰 컨트롤러가 상속 : 난 그냥 그렇게, 모달 뷰를 표현하기위한 방법을 무시하는 추상 클래스를 작성했습니다.
희망이 도움이됩니다.