1.Swift限制textField输入位数为10位:

func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
guard let text = textField.text else{
return true
}
let textLength = text.count + string.count - range.length
return textLength <=
}

2.iOS float与double的范围和精度:

https://www.jianshu.com/p/ab37c083317b

            // 这里账单金额过大的时候会造成小数点被抹了 po bill["billMoney"]! 5978501.1
// let formatMoney = String(format: "%.2f", (bill["billMoney"] as? Double)!)
// footPriceLabel.text = String.getSeparatedString(orgStr: String.stringValue(formatMoney, defaultValue: "0"))

3.whose view is not in the window hierarchy:

该错误简单的说,是由于 "ViewController" 还没有被加载,就调用该 ViewController 或者 ViewController 内的方法时,就会报这个错误。

 self.dismiss(animated: false, completion: {
let vc = PersonAAController()
vc.personNum = num
// print((UIApplication.shared.delegate as? AppDelegate)?.window?.rootViewController.self)
// whose view is not in the window hierarchy
var rootVC = (UIApplication.shared.delegate as? AppDelegate)?.window?.rootViewController
while ((rootVC?.presentedViewController) != nil) {
rootVC = rootVC?.presentedViewController
}
rootVC?.popup(controller: vc, direction: .center)
})

 

最新文章

  1. iOS开发之SQLite--C语言接口规范(三)——Binding Values To Prepared Statements
  2. 帆软报表FineReport中数据连接的JDBC连接池属性问题
  3. javascript优化--11模式(设计模式)02
  4. ci配置smarty手记
  5. Android studio 环境搭建
  6. Makefile中=、:=、+=、?=的区别
  7. 开通GitHub以及使用笔记
  8. sqlserver中的锁
  9. C#学习笔记(4)
  10. 探求Floyd算法的动态规划本质(转)
  11. Laravel Migrate
  12. 地理位置 API
  13. Windows Internals 笔记——进程的权限
  14. &quot;hello,world&quot;———C++入门有感
  15. java329 继承、类的高级概念
  16. T 分布(近似标准正态分布)
  17. IOS UIView圆角,阴影,边框,渐增光泽
  18. 汽车检测SIFT+BOW+SVM
  19. Windows &quot;计划任务&quot;功能设置闹钟~
  20. SET HANDLER - FOR

热门文章

  1. 品优购项目 单表过程 乒乓过程 入口 MyBatis逆向工程 dubbo框架搭建 品牌表CRUD bug集锦
  2. ECMAScript规范解读this
  3. Game of Cards Gym - 101128G (SG函数)
  4. LeetCode 737. Sentence Similarity II
  5. 使用nodegui 开发高性能的跨平台桌面端应用
  6. 8-ESP8266 SDK开发基础入门篇--编写串口上位机软件
  7. swoolefy PHP的异步、并行、高性能网络通信引擎内置了Http/WebSocket服务器端/客户端
  8. GitHub上如何创建文件夹
  9. trutle库的使用基础
  10. SSL证书创建与部署