Skip to content

Commit

Permalink
remove some build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pcjbird committed Aug 30, 2018
1 parent 70ab011 commit 08a3bb7
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 47 deletions.
2 changes: 1 addition & 1 deletion QuickWebKit.podspec
Original file line number Diff line number Diff line change
@@ -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。
Expand Down
14 changes: 5 additions & 9 deletions QuickWebKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@
898A50B61FE7FDE7002DDFA7 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0920;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = "Zero Status";
TargetAttributes = {
890BF6BA1FED31A1003E8E7C = {
Expand Down Expand Up @@ -1079,13 +1079,15 @@
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;
CLANG_WARN_ENUM_CONVERSION = YES;
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;
Expand Down Expand Up @@ -1138,13 +1140,15 @@
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;
CLANG_WARN_ENUM_CONVERSION = YES;
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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -37,7 +36,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
3 changes: 3 additions & 0 deletions QuickWebKit/QuickWebKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.新增导航栏按钮颜色偏好设置。
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]])
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
#define SDK_BUNDLE [NSBundle bundleWithPath:[[NSBundle bundleForClass:[QuickWebQRCodePlugin class]] pathForResource:@"QuickWebKit" ofType:@"bundle"]]
@interface QuickWebQRCodePlugin()<UIGestureRecognizerDelegate,UIActionSheetDelegate>
{
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

Expand Down Expand Up @@ -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];

Expand All @@ -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];
Expand All @@ -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
Expand All @@ -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];
}
Expand All @@ -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];
}];
Expand Down
2 changes: 1 addition & 1 deletion QuickWebKit/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.3.0</string>
<string>1.3.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down

0 comments on commit 08a3bb7

Please sign in to comment.