Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 14.5崩溃 #12

Open
tanpengsccd opened this issue Apr 29, 2021 · 3 comments
Open

iOS 14.5崩溃 #12

tanpengsccd opened this issue Apr 29, 2021 · 3 comments

Comments

@tanpengsccd
Copy link

tanpengsccd commented Apr 29, 2021

///扩大点击响应面积,edge 正数值是缩小面积,扩大是负数

    func expandResponseArea(edge:UIEdgeInsets){
        let imp: @convention(block) (UIView , CGPoint , UIEvent ) -> Bool = { (v,p,e) in
            v.callOriginalMethod {
                v.point(inside: p, with: e) //必须调用一次原始方法
            }
            let r = v.bounds.inset(by: edge)
            return r.contains(p)
        }
        //劫持point(inside:with:
        self.hookMethod(#selector(UIButton.point(inside:with:)), impBlock: imp)  //Crash Here:Thread 1: EXC_BAD_ACCESS (code=2, address=0x215c5e880)
        
    }
@tanpengsccd
Copy link
Author

只有 升级到iOS 14.5 才触发,且 6s X 不会触发,11,12 ,Xs 会触发。 很奇怪

@tanpengsccd
Copy link
Author

image

@tanpengsccd
Copy link
Author

facebook/fishhook#82
fishhook这边有解释

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant