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

index(options:passingTest:)

Returns the index of the first object that passes the predicate Block test using the specified enumeration options. 措定された列挙オプションを使ってBlockテストに合格する最初のオブジェクトのインデックスを返します。

Declaration 宣言

func index(options opts: NSEnumerationOptions = [], 
passingTest predicate: (Int, UnsafeMutablePointer<ObjCBool>) -> Bool) -> Int

Parameters パラメータ

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). See NSEnumerationOptions for the supported values. 列挙に対するオプションを指定するビットマスク(それが並行して実行されるべきかどうかそしてそれが逆順で実行されるべきかどうか)。NSEnumerationOptionsを支持される値のために見てください。

predicate

The Block to apply to elements in the set. 集合の中の要素に適用するブロック。

The Block takes two arguments: ブロックは2つの引数をとります。

idx

The index of the object. オブジェクトのインデックス。

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 Boolean to YES within the Block. あるブール値への参照。ブロックは、値をtrueに設定することで、それ以上の集合の処理を止めることができます。stop引数は、ひとつの退出専用引数です。あなたは、常にこのブールをBlock内でYESに設定するだけであるべきです。

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

Return Value 戻り値

The index of the first object that passes the predicate test. 述部テストに合格する、最初のオブジェクトのインデックス。

See Also 参照

Querying Index Sets インデックス集合に問い合わせる