UITextField.TextDidEndEditingNotification プロパティ

定義

TextDidEndEditing の通知定数

[Foundation.Advice("Use UITextField.Notifications.ObserveTextDidEndEditing helper method instead.")]
[Foundation.Field("UITextFieldTextDidEndEditingNotification", "UIKit")]
public static Foundation.NSString TextDidEndEditingNotification { get; }
member this.TextDidEndEditingNotification : Foundation.NSString

プロパティ値

NSString 定数は、NSNotificationCenter のトークンとして使用する必要があります。

属性

注釈

この定数を と共 NSNotificationCenter に使用して、この通知のリスナーを登録できます。 これらの値は、実際の文字列コンテンツに対して純粋に使用されるのではなく、一部のネイティブ ライブラリでトークンとして使用できるため、これは文字列ではなく NSString です。 コールバックの 'notification' パラメーターには、通知の種類に固有の追加情報が含まれています。

この通知をサブスクライブする場合は、通知のパラメーターへの厳密に型指定されたアクセスを提供する便利UITextField.NotificationsObserveTextDidEndEditingな メソッド を使用できます。

次の例は、厳密に型指定された Notifications クラスを使用して、通知で使用可能なプロパティから推測を取り出す方法を示しています。

//
// Lambda style
//

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

// 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);
}

void Setup ()
{
    notification = UITextField.Notifications.ObserveTextDidEndEditing (Callback);
}

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

次の例は、DefaultCenter API で通知を使用する方法を示しています。

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


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

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (UITextField.TextDidEndEditingNotification, Callback);
}

適用対象