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

Fixed swizzling crash as soon as AFNetworking was loading #87

Merged
merged 1 commit into from
Jul 13, 2016

Conversation

MP0w
Copy link
Member

@MP0w MP0w commented Jul 12, 2016

Swift is not able to override + (void)load so we swizzled in +(void)initialize this caused a crash as soon as AFNetworking (and potentially other code) started swizzling some class that required our swizzled class to load. Fixed by using an objective C category.

PS: will leave AFNetworking and Alamofire in because anyway we will need them for #86

Swift is not able to override `+ (void)load` so we swizzled in `+(void)initialize` this caused a crash as soon as AFNetworking (and potentially other code) started swizzling some class that required our swizzled class to load. Fixed by using an objective C category.
@MP0w MP0w added the bug label Jul 12, 2016
@MP0w MP0w added this to the 0.1.0 milestone Jul 12, 2016

static NSString * RequestHTTPBodyKey = @"kkp_requestHTTPBody";

@implementation NSMutableURLRequest (FixCopy)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only this is a relevant change (+ removed swift file)

@codecov-io
Copy link

codecov-io commented Jul 12, 2016

Current coverage is 98.46%

Sunburst

No coverage report found for master at 03c548c.

Powered by Codecov. Last updated by 03c548c...571f1ce

@joanromano
Copy link
Member

Not so sure about leaving Alamofire and AFNetworking there

@MP0w
Copy link
Member Author

MP0w commented Jul 12, 2016

check next PR, that's the reason

@MP0w MP0w merged commit 571f1ce into master Jul 13, 2016
@MP0w MP0w deleted the fix/SwizzlingIncompatibility branch July 13, 2016 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants