问题记录

Read more   2018/7/31 posted in  codeDaily

fastlane相关

Read more   2018/7/25 posted in  codeDaily

首页的优化记录

记录一个复杂页面的优化过程

Read more   2018/7/24 posted in  codeDaily

踩坑记录

问题1 使用 Leaks检查项目内存泄漏,崩溃的问题

问题描述

进入Leaks模拟器或者真机app,进入30s左右就出现崩溃的现象,但是正常运行app没有问题

参考资料
最后找到解决方案:
进入leaks之后,在开启任务前,
通过操作file -> recordOptions -> recordCount 取消选择

问题2 对于约束的判定

应用场景: 一个superview 加入 一个子view-UITableView。
在后续需要找到tableView的顶部约束并改变其值,使之发生改变。

  self.view.constraints.foreach { (const) in
    if const.firstAttribute == NSLayoutAttribute.top.
        let view = const.firstItem as? UITableView,
            view = self.tableView {
            //TODO: 此处已识别,do sth
            }
  }

在这对关系中 const中的item1是UITableView,item2是superView
由于tableView的位置需要通过 superView来进行确定。
在最初添加约束时, superView.addConstraints(...)

2018/6/6 posted in  codeDaily