Поделиться через


UIFocusUpdateContext.MovementDidFailNotification Свойство

Определение

Константа уведомлений для MovementDidFail

[Foundation.Advice("Use UIFocusUpdateContext.Notifications.ObserveMovementDidFail helper method instead.")]
[Foundation.Field("UIFocusMovementDidFailNotification", "UIKit")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public static Foundation.NSString MovementDidFailNotification { [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)] [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.MovementDidFailNotification : Foundation.NSString

Значение свойства

Константа NSString должна использоваться в качестве токена для NSNotificationCenter.

Атрибуты

Комментарии

Эту константу NSNotificationCenter можно использовать вместе с , чтобы зарегистрировать прослушиватель для этого уведомления. Кроме того, разработчики могут использовать строго типизированное уведомление ObserveMovementDidFail . Это NSString вместо строки, так как эти значения можно использовать в качестве маркеров в некоторых собственных библиотеках, а не только для их фактического содержимого строк. Параметр notification для обратного вызова содержит дополнительные сведения, относящиеся к типу уведомления.

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


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

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (UIFocusUpdateContext.MovementDidFailNotification, Callback);
}

Применяется к