다음을 통해 공유


MPMoviePlayerController.WillEnterFullscreenNotification 속성

정의

WillEnterFullscreen에 대한 알림 상수

[Foundation.Advice("Use MPMoviePlayerController.Notifications.ObserveWillEnterFullscreen helper method instead.")]
[Foundation.Field("MPMoviePlayerWillEnterFullscreenNotification", "MediaPlayer")]
[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, "Use 'AVPlayerViewController' (AVKit) instead.")]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public static Foundation.NSString WillEnterFullscreenNotification { [ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, "Use 'AVPlayerViewController' (AVKit) instead.")] [ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.WillEnterFullscreenNotification : Foundation.NSString

속성 값

NSString 상수는 NSNotificationCenter에 대한 토큰으로 사용해야 합니다.

특성

설명

이 상수는 와 함께 NSNotificationCenter 사용하여 이 알림에 대한 수신기를 등록할 수 있습니다. 이러한 값은 실제 문자열 콘텐츠에만 사용되는 대신 일부 네이티브 라이브러리에서 토큰으로 사용할 수 있으므로 문자열 대신 NSString입니다. 콜백에 대한 'notification' 매개 변수에는 알림 유형과 관련된 추가 정보가 포함됩니다.

이 알림을 구독하기 위해 개발자는 알림의 매개 변수에 강력한 형식의 액세스를 제공하는 편의성 MPMoviePlayerController.Notifications.ObserveWillEnterFullscreen 메서드를 사용할 수 있습니다.

다음 예제에서는 강력한 형식의 Notifications 클래스를 사용하여 알림의 사용 가능한 속성에서 추측을 수행하는 방법을 보여 줍니다.

//
// Lambda style
//

// listening
notification = MPMoviePlayerController.Notifications.ObserveWillEnterFullscreen ((sender, args) => {
    /* Access strongly typed args */
    Console.WriteLine ("Notification: {0}", args.Notification);

    Console.WriteLine ("AnimationDuration", args.AnimationDuration);
    Console.WriteLine ("AnimationCurve", args.AnimationCurve);
});

// To stop listening:
notification.Dispose ();

//
// Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
    // Access strongly typed args
    Console.WriteLine ("Notification: {0}", args.Notification);

    Console.WriteLine ("AnimationDuration", args.AnimationDuration);
    Console.WriteLine ("AnimationCurve", args.AnimationCurve);
}

void Setup ()
{
    notification = MPMoviePlayerController.Notifications.ObserveWillEnterFullscreen (Callback);
}

void Teardown ()
{
    notification.Dispose ();
}

다음 예제에서는 DefaultCenter API와 함께 알림을 사용하는 방법을 보여줍니다.

// Lambda style
NSNotificationCenter.DefaultCenter.AddObserver (
        MPMoviePlayerController.WillEnterFullscreenNotification, (notification) => {Console.WriteLine ("Received the notification MPMoviePlayerController", notification); }


// Method style
void Callback (NSNotification notification)
{
    Console.WriteLine ("Received a notification MPMoviePlayerController", notification);
}

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (MPMoviePlayerController.WillEnterFullscreenNotification, Callback);
}

적용 대상