Swift Tip

Optional 其实是一种 Enum
enum Optional {
case None
case Some(T)
}
let x: String? =nil
… is …
let x = Optional.None
let x: String? = “hello”
… is …
let x = Optional.Some(“hello”)

评论

此博客中的热门博文

viewWillAppear不执行的解决办法

iOS中使用xpc/xpc.h

图片旋转时的边缘抗锯齿的三种方法以及性能