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

[REV]添加埋点通知 #187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ReactiveObjC/NSObject+RACSelectorSignal.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,17 @@ static void RACSwizzleForwardInvocation(Class class) {
// invoke any existing implementation of -forwardInvocation:. If there
// was no existing implementation, throw an unrecognized selector
// exception.

id newForwardInvocation = ^(id self, NSInvocation *invocation) {

// 去除rac_alias_前缀
NSCharacterSet *set = [NSCharacterSet characterSetWithCharactersInString:@"rac_alias"];
NSString *trimmedString = [NSStringFromSelector(invocation.selector) stringByTrimmingCharactersInSet:set];

// 将target和selctor传出去
NSDictionary * info = @{@"target":NSStringFromClass([invocation.target class]),@"selector":trimmedString};
[NSNotificationCenter.defaultCenter postNotificationName:@"RACForwardInvocation_Dot" object:nil userInfo:info];

BOOL matched = RACForwardInvocation(self, invocation);
if (matched) return;

Expand Down