第12月第26天 swift 下划线
1.
The _ is used to define that the parameter is not named
If you have multiple _ it states that you do not need to name the parameters in your function call
func myFunc(name:String, _ age:String){
}
myFunc(“Milo", "I'm a really old wizard")
If you do not use the underscore you would use
myFunc(“Milo”, age: "I'm a really old wizard")
The _ is not necessary in function calls. It is just used to indicate that something does not to have a name.
In regards to how you would refer to your function, You would not have to pass any name for the function call.
But since you also don’t define a parameter type this seems to me like a invalid example (it at least doesn’t work in xCode 7 with swift 2.0)
Edit:
Since swift 3.0
myFunc(name: “Milo”, age: "I'm a really old wizard")
Should be used
http://www.cnblogs.com/bhlsheji/p/4746072.html
https://stackoverflow.com/questions/30876068/what-is-in-swift-telling-me
2.
// Set up the quad vertices with respect to the orientation and aspect ratio of the video.
CGRect vertexSamplingRect = AVMakeRectWithAspectRatioInsideRect(self.presentationRect, self.layer.bounds);
第12月第26天 swift 下划线的更多相关文章
- 2018年12月25&26日
小结:昨天因为整理课件,调代码耗费了大量时间,所以没来得及整理作业,这两天主要做的题目是关于树链剖分和线段树的,难度大约都是省选难度,毕竟只要涉及到树链剖分难度就肯定不低. 一. 完成的题目: 洛谷P ...
- 2013年12月26日 星期四 doxygen入门--很好
body{ font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI& ...
- 2016年12月31日 星期六 --出埃及记 Exodus 21:26
2016年12月31日 星期六 --出埃及记 Exodus 21:26 "If a man hits a manservant or maidservant in the eye and d ...
- 2016年12月26日 星期一 --出埃及记 Exodus 21:21
2016年12月26日 星期一 --出埃及记 Exodus 21:21 but he is not to be punished if the slave gets up after a day or ...
- 2016年12月5日 星期一 --出埃及记 Exodus 20:26
2016年12月5日 星期一 --出埃及记 Exodus 20:26 And do not go up to my altar on steps, lest your nakedness be exp ...
- VC++6.0 下配置 pthread库2010年12月12日 星期日 13:14VC下的pthread多线程编程 转载
VC++6.0 下配置 pthread库2010年12月12日 星期日 13:14VC下的pthread多线程编程 转载 #include <stdio.h>#include &l ...
- 我的Python成长之路---第一天---Python基础(1)---2015年12月26日(雾霾)
2015年12月26日是个特别的日子,我的Python成之路迈出第一步.见到了心目中的Python大神(Alex),也认识到了新的志向相投的伙伴,非常开心. 尽管之前看过一些Python的视频.书,算 ...
- 北京Uber优步司机奖励政策(12月26日)
滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...
- [2018-11-27]2018年12月1日宁波dotnet社区线下活动
离上次活动,转眼又过了一个月,幸得各路大神支持,于本周六(12月1日),宁波dotnet社区的线下分享活动又来啦! 活动嘉宾及主题 董斌辉 2015-2019年微软全球最有价值专家(.NET方向) 2 ...
随机推荐
- B1029 旧键盘 (20 分)
20/20,第一次没调试就过了. #include<bits/stdc++.h> using namespace std; /* 1.standardize 2.put to the se ...
- EOS 权限管理之-权限的使用
首先,跟大家说声抱歉,由于之前一直在准备EOS上线的一些工作,所以,很长时间没有更新内容.今天正好有时间,也想到了一些题材,就来说一下这个话题.本文完全是个人见解,如有不当之处,欢迎指出. 前提回顾: ...
- 1084. Broken Keyboard (20)-水题
#include <iostream> #include <cstdio> #include <string.h> #include <algorithm&g ...
- Linux 使用NC命令永久监听本地端口
感谢: 冰点阳光 Linux可以使用nc命令来测试网络端口是否正常,类似于telnet命令,但也可以用nc命令来监听本地端口,支持TCP.UDP协议,当我们测试NTP服务网络策略是否正常时,可以使用到 ...
- python中 除了if else def class 有作用域 其余没有作用域
python中 除了if else def class 有作用域 其余没有作用域
- codeforces1A
Theatre Square CodeForces - 1A 一个城市的广场面积有 N×M平方米,过段时间,恰逢这个城市的庆典活动,主办方决定在广场上铺设一种新的地砖,这种地砖每块都是a×a平方米的. ...
- Eclipse Job
Job可以我们基于Eclipse的Java程序中,我们有很多种方式提供多任务的实现.熟悉Java的朋友立即会想到Java的Thread类,这是Java中使 用最多的一个实现多任务的类.Eclipse平 ...
- IDEA中新建Module时Module name、Content root、Module file location的含义
如下图测试: 最开始默认情况下,Content root.Module file location两行,最末尾的数据跟Module name是相同的. 现在对三行数据,强制进行不同的命名,Finish ...
- MT【80】单调性求函数表达式
提示:$f(f(f(x)-lnx)-ln(f(x)-lnx))=1+e=f(f(x)-lnx),\because f(x)$单调.得: $f(f(x)-lnx)-ln(f(x)-lnx)=f(x)-l ...
- emWin 界面切换注意事项
@2018-07-10 emWin 在做界面切换时,须将切换前的界面所有信息 “删除”,否则将造成切换后的界面死机 此 “删除” 对象包括: > 界面上绘制的曲线(随时间一直变化).绘制的2D ...