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

string(from:)

Returns a formatted string based on the specified number of seconds. 指定された秒数に基づいて書式設定された文字列を返します。

Declaration 宣言

func string(from ti: TimeInterval) -> String?

Parameters パラメータ

ti

The time interval, measured in seconds. The value must be a finite number. Negative numbers are treated as positive numbers when creating the string. 時間の隔たり、秒で計られる。値は、有限数でなければなりません。負数は、文字列を作成する時に正数として扱われます。

Return Value 戻り値

A formatted string representing the specified time interval. 指定された時間間隔を表している書式設定された文字列。

Discussion 議論

This method formats the specified number of seconds into the appropriate units. For example, if the formatter allows the display of minutes and seconds, creating an abbreviated string for the value 70 seconds results in the string “1m 10s”. このメソッドは、指定された秒数を適切な単位へと書式設定します。例えば、フォーマッタが分と秒の表示を許されるならば、値70秒の省略文字列の作成は、文字列 “1m 10s” という結果になります。

See Also 参照

Formatting Values 書式設定値