dkahgld

WYWeakScriptMessageDelegate.m 707B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // WYWeakScriptMessageDelegate.m
  3. // IMYWebView
  4. //
  5. // Created by wangyangyang on 15/11/17.
  6. // Copyright © 2015年 IMY. All rights reserved.
  7. //
  8. #import "WYWeakScriptMessageDelegate.h"
  9. @implementation WYWeakScriptMessageDelegate
  10. - (instancetype)initWithDelegate:(id<WKScriptMessageHandler>)scriptDelegate
  11. {
  12. self = [super init];
  13. if (self) {
  14. _scriptDelegate = scriptDelegate;
  15. }
  16. return self;
  17. }
  18. #pragma mark - WKScriptMessageHandler
  19. - (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
  20. {
  21. [self.scriptDelegate userContentController:userContentController didReceiveScriptMessage:message];
  22. }
  23. @end