![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Swift
文章平均质量分 80
SHZnt
这个作者很懒,什么都没留下…
展开
-
Swift2.0语法更新(2)
2.Checking API Availability Swift有内置的API可用性检查,它保证了你不会误用在当前系统上不支持的API,如果你使用了则会在运行时报错,你可以使用#available 配合if 或guard 来实现。 if #available (iOS 9, OSX 10.10, *) { // Use iOS 9 APIs on转载 2015-12-15 12:50:53 · 352 阅读 · 0 评论 -
Swift2.0语法更新(3)
6.Optional Pattern let someOptional: Int? = 42 if case .Some(let x) = someOptional { print(x) } if case let x? = someOptional { print(x) } if let x转载 2015-12-15 12:52:07 · 456 阅读 · 0 评论 -
Swift2.0语法更新(1)
1. Error Handling 在Swift中,用满足ErrorType协议类型来表示Error。 enum VendingMachingError: ErrorType { case InvalidSelection case InsufficientFunds(required: Double) case OutO转载 2015-12-15 12:49:05 · 288 阅读 · 0 评论 -
iOS输入法开发(Swift)
我会复习一下有关键盘扩展的内容,然后通过使用iOS 8中的新应用扩展API的设计一个摩斯码的输入法。完成这个教程大约需要花费20分钟。完整代码 概览 通过使用自定义输入法替换系统输入法,用户可以实现一些特别的功能。例如一个特别新颖的输入方式,或输入iOS原生并不支持的语言。自定义输入法的基本功能很简单:通过点击、手势,或者其他输入事件,然后通过一个未分类的 NSString转载 2016-01-26 10:38:31 · 4366 阅读 · 1 评论