LoginSignup
1
0

More than 1 year has passed since last update.

【Swift】クロージャ 簡略引数名

Posted at

■ 簡略引数名 - 引数名の省略

簡略引数名 (shorthand argument name)は、
$に引数のインデックスを付けた$0や$1となります。

let isEqual: (Int, Int) -> Bool = {
    return $0 == $1
}

isEqual(1, 1) // true
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0