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

indexes(ofObjectsAt:options:passingTest:)

Returns the index, from a given set of indexes, of the object in the ordered set that passes a test in a given block for a given set of enumeration options. 順序集合の中のオブジェクトの、ある与えられたインデックス集合からの、インデックスを返します、それは与えられたブロックの中のテストをある与えられた列挙オプションの集合に対して合格するものです。

Declaration 宣言

func indexes(ofObjectsAt s: IndexSet, 
     options opts: NSEnumerationOptions = [], 
 passingTest predicate: (Any, Int, UnsafeMutablePointer<ObjCBool>) -> Bool) -> IndexSet

Parameters パラメータ

indexSet

The indexes of the objects over which to enumerate. それらを1つ1つ列挙していくことになるいくらかのオブジェクトのインデックス。

opts

A bitmask that specifies the options for the enumeration (whether it should be performed concurrently and whether it should be performed in reverse order). 列挙に対するオプションを指定するビットマスク(それが並行して実行されるべきかどうかそしてそれが逆順で実行されるべきかどうか)。

predicate

The block to apply to elements in the ordered set. 順序集合の中の要素に適用することになるブロック。

The block takes three arguments: ブロックは、次の3つの引数をとります:

obj

The element in the ordered set. 順序集合の中の要素。

idx

The index of the element in the ordered set. 順序集合の中の要素のインデックス。

stop 中止

A reference to a Boolean value. The block can set the value to true to stop further processing of the set. The stop argument is an out-only argument. You should only ever set this value to true within the block. あるブール値への参照。ブロックは、値をtrueに設定することで、それ以上の集合の処理を止めることができます。stop引数は、ひとつの退出専用引数です。あなたは、この値をブロック内部でtrueに設定するだけであるべきです。

The block returns a Boolean value that indicates whether obj passed the test. この「ブロック」はobjがテストを合格したかどうかを示すブール値を返します。

Return Value 戻り値

The index of the corresponding value in the ordered set that passes the test specified by predicate. If no objects in the ordered set pass the test, returns NSNotFound. 述部によって指定されるテストを合格する、順序集合の中の対応している値のインデックス。順序集合の中にテストを合格するオブジェクトがないならば、NSNotFoundを返します。

Discussion 議論

By default, the enumeration starts with the first object and continues serially through the ordered set to the last object. You can specify concurrent and/or reverse as enumeration options to modify this behavior. 初期状態では、列挙は最初のオブジェクトで開始して順次その順序集合を最後のオブジェクトまで続けます。あなたは、concurrentおよび/またはreverseを列挙オプションとして指定してこの挙動を変えることができます。

See Also 参照

Accessing Set Members 集合メンバにアクセスする