From 08a3bb73f7a01a0bb727f3ed561e368c858113a2 Mon Sep 17 00:00:00 2001 From: pcjbird Date: Thu, 30 Aug 2018 16:22:49 +0800 Subject: [PATCH] remove some build warnings --- QuickWebKit.podspec | 2 +- QuickWebKit.xcodeproj/project.pbxproj | 14 ++--- .../xcschemes/QuickWebKit.xcscheme | 4 +- QuickWebKit/QuickWebKit.h | 3 ++ .../QuickWebJSBridgeContactProxy.m | 5 +- .../QuickWebJSBridgePlugin.m | 11 ++-- .../QuickWebQRCodePlugin.m | 54 ++++++++++--------- QuickWebKit/Supporting Files/Info.plist | 2 +- 8 files changed, 48 insertions(+), 47 deletions(-) diff --git a/QuickWebKit.podspec b/QuickWebKit.podspec index 2473be5..e0360eb 100644 --- a/QuickWebKit.podspec +++ b/QuickWebKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "QuickWebKit" - s.version = "1.3.0" + s.version = "1.3.1" s.summary = "A great & strong plugin based WebViewController. 一款基于插件的 WebView 视图控制器,您可以基于它设计您的浏览器插件,然后像积木一样来组装它们。" s.description = <<-DESC A great & strong plugin based WebViewController. 一款基于插件的 WebView 视图控制器,您可以基于它设计您的浏览器插件,然后像积木一样来组装它们。如果您仅想使用其中部分(而非全部插件),您可以根据需要仅安装您需要的功能与插件, 该项目支持 Cocoapods 的 subspec。 diff --git a/QuickWebKit.xcodeproj/project.pbxproj b/QuickWebKit.xcodeproj/project.pbxproj index f86699a..bc0b14b 100644 --- a/QuickWebKit.xcodeproj/project.pbxproj +++ b/QuickWebKit.xcodeproj/project.pbxproj @@ -671,7 +671,7 @@ 898A50B61FE7FDE7002DDFA7 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0920; + LastUpgradeCheck = 0940; ORGANIZATIONNAME = "Zero Status"; TargetAttributes = { 890BF6BA1FED31A1003E8E7C = { @@ -1079,6 +1079,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -1086,6 +1087,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -1138,6 +1140,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -1145,6 +1148,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -1180,10 +1184,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 99C0EEF3A45B7A9A91EE25DC /* Pods-QuickWebKit.debug.xcconfig */; buildSettings = { - ARCHS = ( - "$(ARCHS_STANDARD)", - armv7s, - ); CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; @@ -1222,10 +1222,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = B46120495E04462EBBDDC716 /* Pods-QuickWebKit.release.xcconfig */; buildSettings = { - ARCHS = ( - "$(ARCHS_STANDARD)", - armv7s, - ); CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; diff --git a/QuickWebKit.xcodeproj/xcshareddata/xcschemes/QuickWebKit.xcscheme b/QuickWebKit.xcodeproj/xcshareddata/xcschemes/QuickWebKit.xcscheme index 07affbe..27bc451 100644 --- a/QuickWebKit.xcodeproj/xcshareddata/xcschemes/QuickWebKit.xcscheme +++ b/QuickWebKit.xcodeproj/xcshareddata/xcschemes/QuickWebKit.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/QuickWebKit/QuickWebKit.h b/QuickWebKit/QuickWebKit.h index 57198c9..5a66850 100644 --- a/QuickWebKit/QuickWebKit.h +++ b/QuickWebKit/QuickWebKit.h @@ -8,6 +8,9 @@ // 框架名称:QuickWebKit // 框架功能:A great & strong plugin based WebViewController. 一款基于插件的 WebView 视图控制器,您可以基于它设计您的浏览器插件,然后像积木一样来组装它们。 // 修改记录: +// pcjbird 2018-08-30 Version:1.3.1 Build:201808300001 +// 1.remove some build warnings。 +// // pcjbird 2018-08-17 Version:1.3.0 Build:201808170001 // 1.新增导航栏按钮颜色偏好设置。 // diff --git a/QuickWebKit/QuickWebPlugins/QuickWebJSBridgePlugin/Proxies/CoreProxies/QuickWebJSBridgeContactProxy.m b/QuickWebKit/QuickWebPlugins/QuickWebJSBridgePlugin/Proxies/CoreProxies/QuickWebJSBridgeContactProxy.m index c53df64..560b23c 100644 --- a/QuickWebKit/QuickWebPlugins/QuickWebJSBridgePlugin/Proxies/CoreProxies/QuickWebJSBridgeContactProxy.m +++ b/QuickWebKit/QuickWebPlugins/QuickWebJSBridgePlugin/Proxies/CoreProxies/QuickWebJSBridgeContactProxy.m @@ -221,7 +221,8 @@ - (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)p personViewController.displayedPerson = person; [peoplePicker pushViewController:personViewController animated:YES]; } - +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person { return YES; } @@ -266,7 +267,7 @@ - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)p } return YES; } - +#pragma clang diagnostic pop //iOS 9 - (void)contactPickerDidCancel:(CNContactPickerViewController *)picker NS_AVAILABLE_IOS(9_0) { diff --git a/QuickWebKit/QuickWebPlugins/QuickWebJSBridgePlugin/QuickWebJSBridgePlugin.m b/QuickWebKit/QuickWebPlugins/QuickWebJSBridgePlugin/QuickWebJSBridgePlugin.m index 7cc3f1a..48224b2 100644 --- a/QuickWebKit/QuickWebPlugins/QuickWebJSBridgePlugin/QuickWebJSBridgePlugin.m +++ b/QuickWebKit/QuickWebPlugins/QuickWebJSBridgePlugin/QuickWebJSBridgePlugin.m @@ -13,10 +13,11 @@ @interface QuickWebJSBridgePlugin() { - NSMutableDictionary *_webViewMap; - NSMutableDictionary *_proxyMap; - NSMutableDictionary *_resultMap; + } +@property(nonatomic, strong)NSMutableDictionary *webViewMap; +@property(nonatomic, strong)NSMutableDictionary *proxyMap; +@property(nonatomic, strong)NSMutableDictionary *resultMap; @end @implementation QuickWebJSBridgePlugin @@ -126,13 +127,13 @@ - (NSString*)exec:(NSString*)secretId :(NSString*)service :(NSString*)action :(N SmartJSWebView *webView = [weakSelf getSmartJSWebViewBySecretId:result.secretId]; - NSMutableArray *cacheResults = [_resultMap objectForKey:result.secretId]; + NSMutableArray *cacheResults = [weakSelf.resultMap objectForKey:result.secretId]; if(![cacheResults isKindOfClass:[NSArray class]]) { cacheResults= [NSMutableArray array]; } [cacheResults addObject:result.results]; - [_resultMap setObject:cacheResults forKey:result.secretId]; + [weakSelf.resultMap setObject:cacheResults forKey:result.secretId]; if([webView isKindOfClass:[SmartJSWebView class]]) { diff --git a/QuickWebKit/QuickWebPlugins/QuickWebQRCodePlugin/QuickWebQRCodePlugin.m b/QuickWebKit/QuickWebPlugins/QuickWebQRCodePlugin/QuickWebQRCodePlugin.m index dbad80d..a693e74 100644 --- a/QuickWebKit/QuickWebPlugins/QuickWebQRCodePlugin/QuickWebQRCodePlugin.m +++ b/QuickWebKit/QuickWebPlugins/QuickWebQRCodePlugin/QuickWebQRCodePlugin.m @@ -16,11 +16,13 @@ #define SDK_BUNDLE [NSBundle bundleWithPath:[[NSBundle bundleForClass:[QuickWebQRCodePlugin class]] pathForResource:@"QuickWebKit" ofType:@"bundle"]] @interface QuickWebQRCodePlugin() { - NSString* _touchedImageUrl; - NSString* _resultQRCode; - NSString* _touchedLinkUrl; + } +@property(nonatomic, strong)NSString* touchedImageUrl; +@property(nonatomic, strong)NSString* resultQRCode; +@property(nonatomic, strong)NSString* touchedLinkUrl; + @property(nonatomic, weak) QuickWebViewController* targetWebController; @end @@ -147,22 +149,22 @@ - (void)openContextMenuAt:(CGPoint)pt { NSString *str = [NSString stringWithFormat:@"document.elementFromPoint(%f, %f).href", pt.x, pt.y]; [webView evaluateJavaScript:str completionHandler:^(id result, NSError *error) { - _touchedLinkUrl = result; + weakSelf.touchedLinkUrl = result; //打开链接 UIAlertAction *openLinkAction = [UIAlertAction actionWithTitle:NSLocalizedStringFromTableInBundle(@"OpenLink", @"Localizable", SDK_BUNDLE, nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { - [[NSNotificationCenter defaultCenter] postNotificationName:QUICKWEBREQUESTURLHANDLERNOTIFICATION object:_touchedLinkUrl]; - _resultQRCode = nil; - _touchedImageUrl = nil; - _touchedLinkUrl = nil; + [[NSNotificationCenter defaultCenter] postNotificationName:QUICKWEBREQUESTURLHANDLERNOTIFICATION object:weakSelf.touchedLinkUrl]; + weakSelf.resultQRCode = nil; + weakSelf.touchedImageUrl = nil; + weakSelf.touchedLinkUrl = nil; }]; [alertController addAction:openLinkAction]; //在Safari中打开 UIAlertAction *openInSafariAction = [UIAlertAction actionWithTitle:NSLocalizedStringFromTableInBundle(@"OpenInSafari", @"Localizable", SDK_BUNDLE, nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[_touchedImageUrl ? _touchedImageUrl : _touchedLinkUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; - _resultQRCode = nil; - _touchedImageUrl = nil; - _touchedLinkUrl = nil; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[weakSelf.touchedImageUrl ? weakSelf.touchedImageUrl : weakSelf.touchedLinkUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; + weakSelf.resultQRCode = nil; + weakSelf.touchedImageUrl = nil; + weakSelf.touchedLinkUrl = nil; }]; [alertController addAction:openInSafariAction]; @@ -172,7 +174,7 @@ - (void)openContextMenuAt:(CGPoint)pt { //保存图片 UIAlertAction *saveImageAction = [UIAlertAction actionWithTitle:NSLocalizedStringFromTableInBundle(@"SaveImage", @"Localizable", SDK_BUNDLE, nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { - UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:_touchedImageUrl]]]; + UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:weakSelf.touchedImageUrl]]]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; imageView.backgroundColor = [UIColor whiteColor]; [imageView setContentMode:UIViewContentModeScaleToFill]; @@ -188,16 +190,16 @@ - (void)openContextMenuAt:(CGPoint)pt UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(result, weakSelf, @selector(image:didFinishSavingWithError:contextInfo:), NULL); - _resultQRCode = nil; - _touchedImageUrl = nil; - _touchedLinkUrl = nil; + weakSelf.resultQRCode = nil; + weakSelf.touchedImageUrl = nil; + weakSelf.touchedLinkUrl = nil; }]; [alertController addAction:saveImageAction]; NSString *str = [NSString stringWithFormat:@"document.elementFromPoint(%f, %f).src", pt.x, pt.y]; [webView evaluateJavaScript:str completionHandler:^(id result, NSError *error) { - _touchedImageUrl = result; + weakSelf.touchedImageUrl = result; NSString* imgStr = result; UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imgStr]]]; CGImageRef imageToDecode = image.CGImage; // Given a CGImage in which we are looking for barcodes @@ -224,14 +226,14 @@ - (void)openContextMenuAt:(CGPoint)pt NSString *formatString = [weakSelf barcodeFormatToString:format]; NSString *display = [NSString stringWithFormat:@"识别到二维码,格式: %@ 内容:\n%@", formatString, contents]; SDK_LOG(@"%@",display); - _resultQRCode = qrresult.text; + weakSelf.resultQRCode = qrresult.text; //识别二维码 UIAlertAction *decodeQRCodeAction = [UIAlertAction actionWithTitle:NSLocalizedStringFromTableInBundle(@"DecodeQRCode", @"Localizable", SDK_BUNDLE, nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { - [[NSNotificationCenter defaultCenter] postNotificationName:QUICKWEBREQUESTURLHANDLERNOTIFICATION object:_resultQRCode]; - _resultQRCode = nil; - _touchedImageUrl = nil; - _touchedLinkUrl = nil; + [[NSNotificationCenter defaultCenter] postNotificationName:QUICKWEBREQUESTURLHANDLERNOTIFICATION object:weakSelf.resultQRCode]; + weakSelf.resultQRCode = nil; + weakSelf.touchedImageUrl = nil; + weakSelf.touchedLinkUrl = nil; }]; [alertController addAction:decodeQRCodeAction]; } @@ -243,10 +245,10 @@ - (void)openContextMenuAt:(CGPoint)pt } //在Safari中打开 UIAlertAction *openInSafariAction = [UIAlertAction actionWithTitle:NSLocalizedStringFromTableInBundle(@"OpenInSafari", @"Localizable", SDK_BUNDLE, nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[_touchedImageUrl ? _touchedImageUrl : _touchedLinkUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; - _resultQRCode = nil; - _touchedImageUrl = nil; - _touchedLinkUrl = nil; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[weakSelf.touchedImageUrl ? weakSelf.touchedImageUrl : weakSelf.touchedLinkUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; + weakSelf.resultQRCode = nil; + weakSelf.touchedImageUrl = nil; + weakSelf.touchedLinkUrl = nil; }]; [alertController addAction:openInSafariAction]; }]; diff --git a/QuickWebKit/Supporting Files/Info.plist b/QuickWebKit/Supporting Files/Info.plist index 3c2f9a0..0dd958f 100644 --- a/QuickWebKit/Supporting Files/Info.plist +++ b/QuickWebKit/Supporting Files/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.3.0 + 1.3.1 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass