Skip to content

Commit 9289909

Browse files
authored
Merge pull request alibaba#1911 from acton393/ios-feature-20161208
* [ios] add annotation about fireglobalEvent
2 parents 6f21b6e + b7187cf commit 9289909

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ios/sdk/WeexSDK/Sources/Module/WXGlobalEventModule.m

+5
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ - (void)fireGlobalEvent:(NSNotification *)notification
5656
{
5757
NSDictionary * userInfo = notification.userInfo;
5858
NSString * userWeexInstanceId = userInfo[@"weexInstance"];
59+
/*
60+
1. The userWeexInstanceId param will be passed by globalEvent module notification.
61+
2. The notification is posted by native user using Notificationcenter, native user don't need care about what the userWeexInstanceId is. What you do is to addEventListener in weex file using globalEvent module, and then post notification anywhere.
62+
*/
5963
WXSDKInstance * userWeexInstance = [WXSDKManager instanceForID:userWeexInstanceId];
6064
// In case that userInstanceId exists but instance has been dealloced
6165
if (!userWeexInstanceId || userWeexInstance == weexInstance) {
66+
6267
for (WXModuleKeepAliveCallback callback in _eventCallback[notification.name]) {
6368
callback(userInfo[@"param"], true);
6469
}

0 commit comments

Comments
 (0)