上一页 1 ··· 3 4 5 6 7
func lightBtnAction(sender: UIButton){ let device = AVCaptureDevice.default(for:.video) if device == nil { sender.isEnabled = false return } ... Read More
posted @ 2018-08-16 16:00 milaliu99 Views(713) Comments(0) Diggs(0)
修改:output 的 restOfInterest应该为: Read More
posted @ 2018-08-16 15:57 milaliu99 Views(256) Comments(0) Diggs(0)
swift编程时,大概率会用到OC的文件,这时就要使用swift与oc的桥接文件。桥接文件以 XXXX-Bridging-header.h 这样子的文件名形式为标准,XXXX是你的项目名字。 具体创建方式: 1.选中工程,点击New File ->iOS-> Header File 2.点击Next Read More
posted @ 2018-08-16 12:07 milaliu99 Views(1760) Comments(0) Diggs(0)
let kScreenWidth = UIScreen.main.bounds.width let kScreenHeight = UIScreen.main.bounds.height public func FitWidth(_ width: CGFloat) -> CGFloat { return width * kScreenWidth / 375.0 } p... Read More
posted @ 2018-08-16 11:22 milaliu99 Views(1192) Comments(0) Diggs(0)
//获取Image func FImage(_ imageName:String) -> UIImage { return UIImage(named:imageName)! } //获取Url func FUrl(_ urlString: String) -> URL? { return URL(string: urlString) } //验证是手机号的格式 f... Read More
posted @ 2018-08-16 11:08 milaliu99 Views(317) Comments(0) Diggs(0)
如下: Read More
posted @ 2018-08-16 11:04 milaliu99 Views(2287) Comments(0) Diggs(0)
//是否开启相机权限 func IsOpenCamera() -> Bool{ let authStatus = AVCaptureDevice.authorizationStatus(for: .video) return authStatus != .restricted && authStatus != .denied } //是否开启相册权限 func IsOpen... Read More
posted @ 2018-08-16 10:59 milaliu99 Views(2335) Comments(0) Diggs(0)
上一页 1 ··· 3 4 5 6 7