摘要: // 实现摇一摇的两种方式 // 1、使用加速计获取加速度数据,自定义一个范围,超过该范围就判定为产生摇动事件 // 2、使用系统封装好的摇动事件 import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() ... 阅读全文
posted @ 2017-02-12 18:34 小课桌 阅读(238) 评论(0) 推荐(0) 编辑
摘要: // 近距离传感器的实现封装在UIKit中 // 需要使用真机测试 import UIKit enum YSSession:Int { case audio = 1 // 音频 case video = 2 // 视频 } class ViewController: UIViewController { override func viewDidLoad... 阅读全文
posted @ 2017-02-12 18:23 小课桌 阅读(660) 评论(0) 推荐(0) 编辑