![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
swift
canlanyangg
这个作者很懒,什么都没留下…
展开
-
swift ?? 合并
a != nil ? a! : b 是 a ?? b 的缩写llet defaultColorName = "red"var userDefinedColorName: String? // defaults to nil var colorNameToUse = userDefinedColorName ?? defaultColorName// userDefinedC原创 2016-12-27 16:06:35 · 282 阅读 · 0 评论 -
swift switch tuple where
let anotherPoint = (2,0)switch anotherPoint { case (let x , 0): print("on the x-axis with an x value of \(x)") case (0 , let y): print("on the y-axis with an原创 2016-12-27 16:10:36 · 266 阅读 · 0 评论 -
NSNotificationCenter 移除监听
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadDdataConnect) name:kloginSuccess object:nil];[[NSNotificationCenter defaultCenter] removeObserver:self];原创 2017-02-21 15:49:32 · 984 阅读 · 0 评论