还是叫一章一章吧
1.//使用typealias自定义一个类型
typealias myCustomInt=UInt
var myvalue:myCustomInt=3
2.//Boolean类型只有true和false
let isTrue=true
if isTrue
{
/* do something*/
}else
{
/* do something*/
}
3.//if 后面是Boolean类型的
4.//定义一组元数据
var httpError=(404,"not be found")
5,//下面的下发里面不想填写的参数可以用_代替
let (statueCode,statueMessage)=httpError
let (_,statueMessageError)=httpError
<span style="font-size:24px;"><u><strong>6.//我们还可以通过索引打印出来httpError里面包含的值</strong></u></span>
<pre name="code" class="objc">httpError.0
httpError.1
7.//上面的也可以这样的写
let httpError=(statueCode:404,statueStr:"not be found")
httpError.statueCode
httpError.statueStr
8//我们可以使用toInt()函数把一个字符串转变成int,如果字符串不是整数,将会返回nil
let value="3"
var aInt=value.toInt()
9,//如果aInt存在就是true,否则是false
//如果aInt存在就是true,否则是false
if aInt {
}else
{
}