Instance Method インスタンスメソッド

acceptInput(forMode:before:)

Runs the loop once or until the specified date, accepting input only for the specified mode. ループを一度だけまたは指定された日付まで走らせます、指定されたモードに対してのみ入力を受け入れます。

Declaration 宣言

func acceptInput(forMode mode: RunLoop.Mode, 
          before limitDate: Date)

Parameters パラメータ

mode

The mode in which to run. このモードで実行することになります。 You may specify custom modes or use one of the modes listed in Run Loop Modes.

limitDate

The date up until which to run. それに至るまで動作することになる日付。

Discussion 議論

If no input sources or timers are attached to the run loop, this method exits immediately; otherwise, it runs the run loop once, returning as soon as one input source processes a message or the specifed time elapses. 入力ソースまたはタイマーが実行ループに添付されないならば、このメソッドは直ちに退出します;そうでなければ、それは実行ループを一度だけ走らせて、1つの入力ソースがメッセージを処理するか指定された時間が経過するやいなや返ります。

Manually removing all known input sources and timers from the run loop is not a guarantee that the run loop will exit. macOS can install and remove additional input sources as needed to process requests targeted at the receiver’s thread. Those sources could therefore prevent the run loop from exiting. 全ての既知の入力ソースとタイマーを実行ループから手動で取り除くことは、実行ループが退出する保証ではありません。macOSは、追加の入力ソースを必要に応じてインストールおよび除去して、レシーバのもつスレッドで目標とされる要請それらを処理できます。これらのソースは、従って実行ループが退出することを妨げます。

See Also 参照

Running a Loop ループを実行する