摘要:
pre-commit文件中内容为: git-format-staged --formatter "swiftformat stdin --stdinpath '{}'" "*.swift" 在终端中,git commit不会报错。Sourcetree中提交具体错误: git-format-stage 阅读全文
摘要:
按钮已添加到屏幕,并且点击事件也正常添加。 兄弟视图是一个只响应长按事件的视图,但不遮盖按钮区域。在处理pointInSide时,出现了区域放大的bug,覆盖了按钮区域,但是该区域抛弃了点击事件。导致按钮点击无效 阅读全文
摘要:
先上代码 let tView = UIView()override func viewDidLoad() { tView.backgroundColor = .orange view.addSubview(tView)} override func viewWillLayoutSubViews() 阅读全文
摘要:
iOS 中利用通过 setFrame 来固定一个 view 的位置,例如下面代码: let dView = UIView() dView.frame = CGRect(x: 100, y: 100, width: 100, height: 70.8) dView.backgroundColor = 阅读全文
摘要:
先看https是怎么携带cookie的: var properties: [HTTPCookiePropertyKey: Any] = [:] properties[.name] = "key" properties[.path] = "/" properties[.value] = "value" 阅读全文
摘要:
起初是同事和我说,property为readonly,外部还能set成功。实在没想明白。 常规的写法, .m中可以直接set成功,而外部创建的FCTest对象,无法set成功(见FCObject)。 FCTest.h @interface FCTest : NSObject @property (n 阅读全文
摘要:
按照官方文档的写法,在iOS 10上必现crash。 在网上找到类似的问题,但是我遇到的博客中说的不会crash的方式 swift还是不要用kvo了,用combine框架吧 阅读全文
摘要:
背景 需要做一个扇形带指示器的进度条动画,最初实现的是如下效果 代码如下 func startAnimation() { let width = self.frame.width let bezierPath = UIBezierPath(arcCenter: CGPoint(x: width / 阅读全文
摘要:
问题 工程代码中cell在侧滑删除时,cell会抖动。 在只用masonry代码中,cell会偏移。加上以下代码,cell会消失。 let label = UILabel() label.isHidden = true label.sizeToFit() label.frame = CGRectMa 阅读全文
摘要:
最初的想法 两个UIView直接切换,上代码 let aView = UIView() let bView = UIView() aView.frame = CGRect(x: 100, y: 300, width: 100, height: 100) aView.alpha = 1 aView.b 阅读全文