官术网_书友最值得收藏!

Shorthand arguments

To reach the maximum awesomeness of Swift, you can refer to the argument list with names $0, $1, and so on. When you decide to use the shorthand arguments, you can omit the list of parameters. You may ask what about the in keyword, will it be alone? The answer is no, we won't leave it alone; we can omit it as well completely. Here is the final version of our sort function:

names.sort({ $0 > $1}) 
主站蜘蛛池模板: 彰化县| 福贡县| 西安市| 安多县| 岢岚县| 平昌县| 东港市| 云龙县| 清徐县| 莱西市| 绥宁县| 宜宾市| 南木林县| 满城县| 德化县| 牡丹江市| 宝应县| 海晏县| 禄劝| 肥乡县| 柏乡县| 深水埗区| 策勒县| 黎平县| 连州市| 五河县| 鄂托克旗| 哈尔滨市| 巍山| 沙坪坝区| 玉环县| 普兰店市| 万源市| 辽宁省| 香格里拉县| 湖北省| 阳泉市| 汪清县| 开平市| 晋城| 双鸭山市|