Instance Property インスタンスプロパティ

fireDate

The date at which the timer will fire. タイマーが発火するであろう日付。

Declaration 宣言

var fireDate: Date { get set }

Discussion 議論

If the timer is no longer valid, the last date at which the timer fired. タイマーがもはや有効でないならば、タイマーが発火した最後の日付。

You can set this property to adjust the firing time of a repeating timer. Although resetting a timer’s next firing time is a relatively expensive operation, it may be more efficient in some situations. For example, you could use it in situations where you want to repeat an action multiple times in the future, but at irregular time intervals. Adjusting the firing time of a single timer would likely incur less expense than creating multiple timer objects, scheduling each one on a run loop, and then destroying them. あなたは、このプロパティを設定して、ある反復タイマーの発火する時間を調節できます。あるタイマーのもつ次の発火時間を設定し直すことは比較的高くつく演算だとはいえ、それはいくつかの状況ではより効率的であるかもしれません。例えば、あなたが将来にある動作を複数回繰り返すことを、しかし変則的な時間間隔で望む状況において、あなたはそれを使うことが可能です。ある単一のタイマーの発火時間を調節することは、複数のタイマーオブジェクトを作成して、ある実行ループ上でそれぞれ1つ予定して、そしてそれからそれらを破壊するよりも、少ない出費をおそらく招くでしょう。

You should not change the fire date of a timer that has been invalidated, which includes non-repeating timers that have already fired. You could potentially change the fire date of a non-repeating timer that had not yet fired, although you should always do so from the thread to which the timer is attached to avoid potential race conditions. あなたは、無効にされたタイマーの発火日付を変更すべきではありません、それはすでに発火した非反復タイマーを含みます。あなたはまだ発火していない非反復タイマーの発火日付を変えることが潜在的に可能です、とはいえあなたは常にそのタイマーが取り付けられたスレッドからそうすべきです、起こりうる競合状態を防ぐために。

Use the isValid method to verify that the timer is valid. isValidメソッドを使ってタイマーが有効であることを検証してください。

See Also 参照

Retrieving Timer Information タイマー情報を取って来る