diff --git a/yinmeng-ios/yinmeng-ios.xcodeproj/xcshareddata/xcschemes/yinmeng-ios.xcscheme b/yinmeng-ios/yinmeng-ios.xcodeproj/xcshareddata/xcschemes/yinmeng-ios.xcscheme index 55ea517..347a377 100644 --- a/yinmeng-ios/yinmeng-ios.xcodeproj/xcshareddata/xcschemes/yinmeng-ios.xcscheme +++ b/yinmeng-ios/yinmeng-ios.xcodeproj/xcshareddata/xcschemes/yinmeng-ios.xcscheme @@ -31,7 +31,7 @@ @property (strong, nonatomic) WKWebView *webview; @property (strong, nonatomic) UIProgressView *progressView; -@property (nonatomic, strong) WKUserContentController *userContentController; +@property (nonatomic, strong) WKUserContentController *mew_userContentController; @end @@ -220,18 +220,18 @@ NSString * const kJSGetUid = @"getUid"; NSString *realCookie = [NSString stringWithFormat:@"%@=%@",@"uid",uid]; WKUserScript *cookieScript = [[WKUserScript alloc] initWithSource: [NSString stringWithFormat:@"document.cookie = '%@';", realCookie] injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO]; - [self.userContentController addUserScript:cookieScript]; + [self.mew_userContentController addUserScript:cookieScript]; ///禁止缩放 NSString *scaleJs = @"$('meta[name=description]').remove(); $('head').append( '' );"; WKUserScript *scaleScript = [[WKUserScript alloc] initWithSource:scaleJs injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO]; - [self.userContentController addUserScript:scaleScript]; + [self.mew_userContentController addUserScript:scaleScript]; //根据生成的WKUserScript对象,初始化WKWebViewConfiguration configuration.preferences.javaScriptEnabled = YES; configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES; configuration.preferences.minimumFontSize = 10; configuration.selectionGranularity = WKSelectionGranularityCharacter; - configuration.userContentController = self.userContentController; + configuration.userContentController = self.mew_userContentController; CGSize size = [UIScreen mainScreen].bounds.size; _webview = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, size.width,size.height) configuration:configuration]; @@ -267,13 +267,13 @@ NSString * const kJSGetUid = @"getUid"; return _webview; } -- (WKUserContentController *)userContentController{ - if (!_userContentController) { +- (WKUserContentController *)mew_userContentController{ + if (!_mew_userContentController) { //自定义的WKScriptMessageHandler 是为了解决内存不释放的问题 WeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[WeakWebViewScriptMessageDelegate alloc] initWithDelegate:self]; - _userContentController = [[WKUserContentController alloc] init]; + _mew_userContentController = [[WKUserContentController alloc] init]; // 获取uid - [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid]; + [_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid]; // 分享面板 // [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenSharePage]; // // 钱包页面 @@ -315,6 +315,6 @@ NSString * const kJSGetUid = @"getUid"; // [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCheckResultFinish]; // [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kOpenNativeTarotPay]; } - return _userContentController; + return _mew_userContentController; } @end