- iOS Programming Cookbook
- Hossam Ghareeb
- 79字
- 2021-07-09 18:29:38
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})
推薦閱讀
- Designing Purpose:Built Drones for Ardupilot Pixhawk 2.1
- Getting Started with oVirt 3.3
- Windows Server 2012 Hyper-V:Deploying the Hyper-V Enterprise Server Virtualization Platform
- 網絡操作系統:Windows Server 2003管理與應用
- UNIX操作系統設計
- 大學計算機應用基礎實踐教程(Windows 7+Office 2013)
- Windows Phone 7.5 Data Cookbook
- Windows Phone應用程序開發
- Windows Phone 8 Application Development Essentials
- Kali Linux 2018:Windows Penetration Testing
- jQuery UI Cookbook
- 從實踐中學習Kali Linux無線網絡滲透測試
- iOS 8開發指南
- Windows Vista終極技巧金典
- Mastering Sass