This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
建立一个symbol断点,symbol写UIViewAlertForUnsatisfiableConstraints。 | |
断点action填写 expr -l objc++ -O -- [[UIWindow keyWindow] _autolayoutTrace] | |
expr -l Swift -- import UIKit | |
expr -l Swift -- unsafeBitCast(0x控件地址, to: UIView.self).backgroundColor = UIColor.red |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
遇到一个奇怪的问题,公司所有小伙伴的推送都能正常显示内容,只有一个手机内容只会显示body,各种查,找,猜,最后发现项目里NotificationServiceExtension设置的 | |
版本比这台测试手机版本高,导致的。🤣🤣🤣 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//停止滚动检测方式很多 这个方案不管是代码设置的滚动动画 还是 用户触摸事件的停止滚动 都能获取到 效率测试了下还可以 | |
func scrollViewDidScroll(_ scrollView: UIScrollView) { | |
isScrolling = true | |
NSObject.cancelPreviousPerformRequests(withTarget: self) | |
self.perform(#selector(scrollViewDidEndScrollingAnimation(_:)), with: scrollView, afterDelay: 0.3) | |
} | |
func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) { | |
NSObject.cancelPreviousPerformRequests(withTarget: self) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 先了解下Module在iOS中的概念 | |
// Module,中文译为「标准部件;模块」。iOS 中的 Module 类似于 Java 中的 Jar 包,也可以称作第三方库,或者框架(Framework)。 | |
// 假设一个场景 A项目用cocoapods使用了B框架,这时候项目就2个module,A B,我们想修改B项目中一个公开方法的实现 | |
// 方案一: fork自己任意修改,这样可以达到目的,但是一来费事,二来可能这么做不一定合理 | |
// 方案二: 利用iOS访问控制,当我们在A module里面调用B里面的一个方法,系统会首先在当前Module里查找要调用方法所属类的extension里的同名方法, | |
// 这话有点绕,上代码吧 | |
// A 中 |