- iOS Programming Cookbook
- Hossam Ghareeb
- 44字
- 2021-07-09 18:29:38
Omitting the return keyword
Swift can make your life easier than that. When closure body consists of only one expression, the return keyword can be omitted. So, the new version of sort function will be like this:
names.sort({ str1, str2 in str1 > str2})
推薦閱讀
- Linux實戰
- Ganglia系統監控
- 精解Windows8
- 混沌工程:復雜系統韌性實現之道
- 奔跑吧 Linux內核(入門篇)
- 嵌入式實時操作系統μC/OS原理與實踐
- Kali Linux 2018:Windows Penetration Testing
- Linux命令行大全(第2版)
- RHCSARHCE 紅帽Linux認證學習指南(第7版)EX200 & EX300
- VMware Horizon View Essentials
- Cassandra 3.x High Availability(Second Edition)
- HTML5 Enterprise Application Development
- Website Development with PyroCMS
- Getting Started with Raspberry Pi Zero
- Mastering AWS CloudFormation