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

Swizzle dealloc crash #29

Closed
codwam opened this issue May 8, 2017 · 1 comment
Closed

Swizzle dealloc crash #29

codwam opened this issue May 8, 2017 · 1 comment

Comments

@codwam
Copy link

codwam commented May 8, 2017

My code:
`

UIViewController.swizzleInstanceMethod(origSelector: Selector.dealloc, toAlterSelector: Selector.swizzle_dealloc)

@objc
func swizzle_dealloc() {
    #if DEBUG
        print("dealloc:------ \(self))")
    #endif
}

`
Crash in

NSObject+Alive.swift
view.agent?.responder = r

@codwam
Copy link
Author

codwam commented May 14, 2017

改为下面就好了。
if let agent = view.agent, let _ = agent.responder { view.agent?.responder = r }

@codwam codwam closed this as completed May 14, 2017
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