Skip to content

Commit

Permalink
Merge pull request #79 from HDB-Li/1.3.6
Browse files Browse the repository at this point in the history
1.3.6
  • Loading branch information
HDB-Li authored Nov 7, 2019
2 parents f9bc14a + ffb865c commit 5a5e453
Show file tree
Hide file tree
Showing 15 changed files with 79 additions and 47 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## [1.3.6](https://github.com/HDB-Li/LLDebugTool/releases/tag/1.3.6) (11/07/2019)

### Optimize functional experience

* Remove `Masonry`.
* Fix some bugs.
* More code comments.
* Fix error in XCode 10.
* Fix a crash when call twice load method.

## [1.3.5](https://github.com/HDB-Li/LLDebugTool/releases/tag/1.3.5) (11/07/2019)

### Optimize functional experience
Expand Down
2 changes: 1 addition & 1 deletion LLDebugTool.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "LLDebugTool"
s.version = "1.3.5"
s.version = "1.3.6"
s.summary = "LLDebugTool is a debugging tool for developers and testers that can help you analyze and manipulate data in non-xcode situations."
s.homepage = "https://github.com/HDB-Li/LLDebugTool"
s.license = "MIT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,20 @@ - (void)rightItemClick:(UIButton *)sender {
}
Class cls = NSClassFromString(self.webViewClass);

UIViewController *customViewController = [LLConfig shared].htmlViewControllerProvider(urlString);
if (customViewController && cls == [customViewController class]) {
[LLSettingManager shared].lastWebViewUrl = urlString;
[self.navigationController pushViewController:customViewController animated:YES];
return;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (cls != [UIWebView class] && cls != [WKWebView class]) {
#pragma clang diagnostic pop
if ([LLConfig shared].htmlViewControllerProvider != nil) {
UIViewController *customViewController = [LLConfig shared].htmlViewControllerProvider(urlString);
if (customViewController && cls == [customViewController class]) {
[LLSettingManager shared].lastWebViewUrl = urlString;
[self.navigationController pushViewController:customViewController animated:YES];
return;
}
[[LLToastUtils shared] toastMessage:@"Provider custom webView failed."];
return;
}
[[LLToastUtils shared] toastMessage:@"Invalid webView class"];
return;
}
Expand Down Expand Up @@ -141,9 +144,11 @@ - (void)showWebViewClassAlert {
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[actions addObject:NSStringFromClass([UIWebView class])];
#pragma clang diagnostic pop
UIViewController *vc = [LLConfig shared].htmlViewControllerProvider(nil);
if (vc) {
[actions addObject:NSStringFromClass([vc class])];
if ([LLConfig shared].htmlViewControllerProvider != nil) {
UIViewController *vc = [LLConfig shared].htmlViewControllerProvider(nil);
if (vc) {
[actions addObject:NSStringFromClass([vc class])];
}
}
__weak typeof(self) weakSelf = self;
[self LL_showActionSheetWithTitle:@"Web View Style" actions:actions currentAction:self.webViewClass completion:^(NSInteger index) {
Expand Down
2 changes: 0 additions & 2 deletions LLDebugTool/Core/Component/Network/Function/LLNetworkHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#import "LLConfig.h"
#import "LLTool.h"

#import "NSObject+LL_Runtime.h"

static LLNetworkHelper *_instance = nil;

@interface LLNetworkHelper ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#import "LLConst.h"

#import "UIViewController+LL_Utils.h"
#import "NSObject+LL_Runtime.h"

@interface LLSettingViewController () <UITableViewDataSource>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
@implementation UIView (LLWidgetBorder)

+ (void)load {
[self LL_swizzleInstanceMethodWithOriginSel:@selector(layoutSubviews) swizzledSel:@selector(LL_layoutSubviews)];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[[UIView class] LL_swizzleInstanceMethodWithOriginSel:@selector(layoutSubviews) swizzledSel:@selector(LL_layoutSubviews)];
});
}

- (void)LL_layoutSubviews {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
@implementation NSURLSession (LL_Utils)

+ (void)load {
[self LL_swizzleClassMethodWithOriginSel:@selector(sessionWithConfiguration:delegate:delegateQueue:) swizzledSel:@selector(LL_sessionWithConfiguration:delegate:delegateQueue:)];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[[NSURLSession class] LL_swizzleClassMethodWithOriginSel:@selector(sessionWithConfiguration:delegate:delegateQueue:) swizzledSel:@selector(LL_sessionWithConfiguration:delegate:delegateQueue:)];
});
}

+ (NSURLSession *)LL_sessionWithConfiguration:(NSURLSessionConfiguration *)configuration delegate:(nullable id <NSURLSessionDelegate>)delegate delegateQueue:(nullable NSOperationQueue *)queue {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,19 @@
@implementation NSURLSessionConfiguration (LL_Utils)

+ (void)load {
[self LL_swizzleClassMethodWithOriginSel:@selector(defaultSessionConfiguration) swizzledSel:@selector(LL_defaultSessionConfiguration)];

[self LL_swizzleClassMethodWithOriginSel:@selector(ephemeralSessionConfiguration) swizzledSel:@selector(LL_ephemeralSessionConfiguration)];

Class cls = NSClassFromString(@"__NSCFURLSessionConfiguration") ? : NSClassFromString(@"NSURLSessionConfiguration");

Method method1 = class_getInstanceMethod(cls, @selector(protocolClasses));
Method method2 = class_getInstanceMethod([NSURLSessionConfiguration class], @selector(LL_protocolClasses));

[self LL_swizzleMethod:method1 anotherMethod:method2];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[[NSURLSessionConfiguration class] LL_swizzleClassMethodWithOriginSel:@selector(defaultSessionConfiguration) swizzledSel:@selector(LL_defaultSessionConfiguration)];

[[NSURLSessionConfiguration class] LL_swizzleClassMethodWithOriginSel:@selector(ephemeralSessionConfiguration) swizzledSel:@selector(LL_ephemeralSessionConfiguration)];

Class cls = NSClassFromString(@"__NSCFURLSessionConfiguration") ? : NSClassFromString(@"NSURLSessionConfiguration");

Method method1 = class_getInstanceMethod(cls, @selector(protocolClasses));
Method method2 = class_getInstanceMethod([NSURLSessionConfiguration class], @selector(LL_protocolClasses));

[[NSURLSessionConfiguration class] LL_swizzleMethod:method1 anotherMethod:method2];
});
}

+ (NSURLSessionConfiguration *)LL_defaultSessionConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
@implementation UIResponder (LL_Utils)

+ (void)load {
[self LL_swizzleInstanceMethodWithOriginSel:@selector(motionBegan:withEvent:) swizzledSel:@selector(LL_motionBegan:withEvent:)];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[[UIResponder class] LL_swizzleInstanceMethodWithOriginSel:@selector(motionBegan:withEvent:) swizzledSel:@selector(LL_motionBegan:withEvent:)];
});
}

- (void)LL_motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
Expand Down
5 changes: 4 additions & 1 deletion LLDebugTool/Core/Others/Category/UIView/UIView+LL_Utils.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
@implementation UIView (LL_Utils)

+ (void)load {
[self LL_swizzleInstanceMethodWithOriginSel:@selector(sizeToFit) swizzledSel:@selector(LL_sizeToFit)];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[[UIView class] LL_swizzleInstanceMethodWithOriginSel:@selector(sizeToFit) swizzledSel:@selector(LL_sizeToFit)];
});
}

- (void)setLL_horizontalPadding:(CGFloat)LL_horizontalPadding {
Expand Down
19 changes: 11 additions & 8 deletions LLDebugTool/Core/Others/Category/UIWindow/UIWindow+LL_Utils.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@
@implementation UIWindow (LL_Utils)

+ (void)load {
// NSString *canAffectSelectorString = @"_canAffectStatusBarAppearance";
// SEL canAffectSelector = NSSelectorFromString(canAffectSelectorString);

NSString *canBecomeKeySelectorString = @"_canBecomeKeyWindow";
SEL canBecomeKeySelector = NSSelectorFromString(canBecomeKeySelectorString);

// [self LL_swizzleInstanceMethodWithOriginSel:canAffectSelector swizzledSel:@selector(_LL_canAffectStatusBarAppearance)];
[self LL_swizzleInstanceMethodWithOriginSel:canBecomeKeySelector swizzledSel:@selector(_LL_canBecomeKeyWindow)];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// NSString *canAffectSelectorString = @"_canAffectStatusBarAppearance";
// SEL canAffectSelector = NSSelectorFromString(canAffectSelectorString);

NSString *canBecomeKeySelectorString = @"_canBecomeKeyWindow";
SEL canBecomeKeySelector = NSSelectorFromString(canBecomeKeySelectorString);

// [[UIWindow class] LL_swizzleInstanceMethodWithOriginSel:canAffectSelector swizzledSel:@selector(_LL_canAffectStatusBarAppearance)];
[[UIWindow class] LL_swizzleInstanceMethodWithOriginSel:canBecomeKeySelector swizzledSel:@selector(_LL_canBecomeKeyWindow)];
});
}

- (UIViewController *)LL_currentShowingViewController {
Expand Down
2 changes: 1 addition & 1 deletion LLDebugTool/DebugTool/LLDebugTool.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ - (void)initial {
// Set Default
_isBetaVersion = NO;

_versionNumber = @"1.3.5";
_versionNumber = @"1.3.6";

_version = _isBetaVersion ? [_versionNumber stringByAppendingString:@"(BETA)"] : _versionNumber;

Expand Down
4 changes: 2 additions & 2 deletions LLDebugToolDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2592,7 +2592,7 @@
INFOPLIST_FILE = LLDebugToolDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.3.5;
MARKETING_VERSION = 1.3.6;
PRODUCT_BUNDLE_IDENTIFIER = myCompany.HDB.LLDebugToolDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -2613,7 +2613,7 @@
INFOPLIST_FILE = LLDebugToolDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.3.5;
MARKETING_VERSION = 1.3.6;
PRODUCT_BUNDLE_IDENTIFIER = myCompany.HDB.LLDebugToolDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
9 changes: 5 additions & 4 deletions README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

[![Version](https://img.shields.io/badge/iOS-%3E%3D8.0-f07e48.svg)](https://img.shields.io/badge/iOS-%3E%3D8.0-f07e48.svg)
[![CocoaPods Compatible](https://img.shields.io/badge/Pod-v1.3.5-blue.svg)](https://img.shields.io/badge/Pod-v1.3.5-blue.svg)
[![CocoaPods Compatible](https://img.shields.io/badge/Pod-v1.3.6-blue.svg)](https://img.shields.io/badge/Pod-v1.3.6-blue.svg)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Platform](https://img.shields.io/badge/Platform-iOS-lightgrey.svg)](https://img.shields.io/badge/Platform-iOS-lightgrey.svg)
[![License](https://img.shields.io/badge/License-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE)
Expand Down Expand Up @@ -46,7 +46,7 @@ LLDebugTool是一款针对开发者和测试者的调试工具,它可以帮助
<img src="https://raw.githubusercontent.com/HDB-Li/HDBImageRepository/master/LLDebugTool/ScreenShot-10.png" width="18%"> </img>
</div>

## 最近更新 (1.3.5)
## 最近更新 (1.3.6)

<img src="https://raw.githubusercontent.com/HDB-Li/HDBImageRepository/master/LLDebugTool/ScreenGif-Screenshot3.gif" width="20%"></img>

Expand All @@ -56,6 +56,7 @@ LLDebugTool是一款针对开发者和测试者的调试工具,它可以帮助
* 修复已知问题。
* 添加更多注释。
* 修复XCode 10无法编译的问题。
* 修复调用二次load方法的崩溃。

## 我能用LLDebugTool做什么?

Expand Down Expand Up @@ -92,15 +93,15 @@ LLDebugTool是一款针对开发者和测试者的调试工具,它可以帮助
##### Objective - C

> 1. 添加 `pod 'LLDebugTool' , '~> 1.0'` 到你的Podfile里。
> 2. 如果只想在Debug模式下使用,则添加`pod 'LLDebugTool' , '~> 1.0' ,:configurations => ['Debug']` 到你的Podfile里,详细的配置方式可以查看[Wiki/如何仅在Debug环境中使用](https://github.com/HDB-Li/LLDebugTool/wiki/如何仅在Debug环境中使用)。如果你想要指定某个版本,可以类似这样使用 `pod 'LLDebugTool' , '1.3.5' ,:configurations => ['Debug']`
> 2. 如果只想在Debug模式下使用,则添加`pod 'LLDebugTool' , '~> 1.0' ,:configurations => ['Debug']` 到你的Podfile里,详细的配置方式可以查看[Wiki/如何仅在Debug环境中使用](https://github.com/HDB-Li/LLDebugTool/wiki/如何仅在Debug环境中使用)。如果你想要指定某个版本,可以类似这样使用 `pod 'LLDebugTool' , '1.3.6' ,:configurations => ['Debug']`
> 3. 推荐的方式是采用多Target来处理,只在Debug Target中添加`pod 'LLDebugTool' , '~> 1.0'`,这样做的好处既不污染Product环境的代码,又可以在Archive Debug环境的App时,将`LLDebugTool`集成进去(如果采用`:configurations => ['Debug']`的方式,只能通过XCode运行,不可以Archive成App)。
> 4. 终端输入`pod install`来进行集成。搜索不到`LLDebugTool`或者搜不到最新版本时,可先运行`pod repo update`,再执行`pod install`
> 5. 在你需要使用LLDebugTool的文件里添加`#import "LLDebug.h"`,或者直接在pch文件中添加`#import "LLDebug.h"`
##### Swift

> 1. 添加 `pod 'LLDebugToolSwift' , '~> 1.0'` 到你的Podfile里。
> 2. 如果只想在Debug模式下使用,则添加`pod 'LLDebugToolSwift' , '~> 1.0' ,:configurations => ['Debug']` 到你的Podfile里,详细的配置方式可以查看[Wiki/如何仅在Debug环境中使用](https://github.com/HDB-Li/LLDebugTool/wiki/如何仅在Debug环境中使用)。如果你想要指定某个版本,可以类似这样使用 `pod 'LLDebugToolSwift' , '1.3.5' ,:configurations => ['Debug']`
> 2. 如果只想在Debug模式下使用,则添加`pod 'LLDebugToolSwift' , '~> 1.0' ,:configurations => ['Debug']` 到你的Podfile里,详细的配置方式可以查看[Wiki/如何仅在Debug环境中使用](https://github.com/HDB-Li/LLDebugTool/wiki/如何仅在Debug环境中使用)。如果你想要指定某个版本,可以类似这样使用 `pod 'LLDebugToolSwift' , '1.3.6' ,:configurations => ['Debug']`
> 3. 推荐的方式是采用多Target来处理,只在Debug Target中添加`pod 'LLDebugToolSwift' , '~> 1.0'`,这样做的好处既不污染Product环境的代码,又可以在Archive Debug环境的App时,将`LLDebugToolSwift`集成进去(如果采用`:configurations => ['Debug']`的方式,只能通过XCode运行,不可以Archive成App)。
> 4. 必须在Podfile中添加 **`use_frameworks!`**
> 5. 终端输入`pod install`来进行集成。搜索不到`LLDebugToolSwift`或者搜不到最新版本时,可先运行`pod repo update`,再执行`pod install`
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

[![Version](https://img.shields.io/badge/iOS-%3E%3D8.0-f07e48.svg)](https://img.shields.io/badge/iOS-%3E%3D8.0-f07e48.svg)
[![CocoaPods Compatible](https://img.shields.io/badge/pod-v1.3.5-blue.svg)](https://img.shields.io/badge/pod-v1.3.5-blue.svg)
[![CocoaPods Compatible](https://img.shields.io/badge/pod-v1.3.6-blue.svg)](https://img.shields.io/badge/pod-v1.3.6-blue.svg)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Platform](https://img.shields.io/badge/Platform-iOS-lightgrey.svg)](https://img.shields.io/badge/Platform-iOS-lightgrey.svg)
[![License](https://img.shields.io/badge/License-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE)
Expand Down Expand Up @@ -46,7 +46,7 @@ Choose LLDebugTool for your next project, or migrate over your existing projects
<img src="https://raw.githubusercontent.com/HDB-Li/HDBImageRepository/master/LLDebugTool/ScreenShot-10.png" width="18%"> </img>
</div>

## What's new in 1.3.5
## What's new in 1.3.6

<img src="https://raw.githubusercontent.com/HDB-Li/HDBImageRepository/master/LLDebugTool/ScreenGif-Screenshot3.gif" width="20%"></img>

Expand All @@ -56,6 +56,7 @@ Choose LLDebugTool for your next project, or migrate over your existing projects
* Fix some bugs.
* More code comments.
* Fix error in XCode 10.
* Fix a crash when call twice load method.

## What can you do with LLDebugTool?

Expand Down Expand Up @@ -92,15 +93,15 @@ Choose LLDebugTool for your next project, or migrate over your existing projects
##### Objective - C

> 1. Add a pod entry for LLDebugTool to your Podfile `pod 'LLDebugTool' , '~> 1.0'`.
> 2. If only you want to use it only in Debug mode, Add a pod entry for LLDebugTool to your Podfile `pod 'LLDebugTool' , '~> 1.0' ,:configurations => ['Debug']`, Details also see [Wiki/Use in Debug environment](https://github.com/HDB-Li/LLDebugTool/wiki/Use-in-Debug-environment). If you want to specify the version, use as `pod 'LLDebugTool' , '1.3.5' ,:configurations => ['Debug']`.
> 2. If only you want to use it only in Debug mode, Add a pod entry for LLDebugTool to your Podfile `pod 'LLDebugTool' , '~> 1.0' ,:configurations => ['Debug']`, Details also see [Wiki/Use in Debug environment](https://github.com/HDB-Li/LLDebugTool/wiki/Use-in-Debug-environment). If you want to specify the version, use as `pod 'LLDebugTool' , '1.3.6' ,:configurations => ['Debug']`.
> 3. The recommended approach is to use multiple targets and only add `pod 'LLDebugTool', '~> 1.0'` to Debug Target. This has the advantage of not contamiling the code in the Product environment and can be integrated into the App in the Archive Debug environment (if `:configurations => ['Debug']`, it can only run through XCode. It is not possible to Archive as an App).
> 4. Install the pod(s) by running `pod install`. If you can't search `LLDebugTool` or you can't find the newest release version, running `pod repo update` before `pod install`.
> 5. Include LLDebugTool wherever you need it with `#import "LLDebug.h"` or you can write `#import "LLDebug.h"` in your .pch in your .pch file.
##### Swift

> 1. Add a pod entry for LLDebugToolSwift to your Podfile `pod 'LLDebugToolSwift' , '~> 1.0'`.
> 2. If only you want to use it only in Debug mode, Add a pod entry for LLDebugToolSwift to your Podfile `pod 'LLDebugToolSwift' , '~> 1.0' ,:configurations => ['Debug']`, Details also see [Wiki/Use in Debug environment](https://github.com/HDB-Li/LLDebugTool/wiki/Use-in-Debug-environment). If you want to specify the version, use as `pod 'LLDebugToolSwift' , '1.3.5' ,:configurations => ['Debug']`.
> 2. If only you want to use it only in Debug mode, Add a pod entry for LLDebugToolSwift to your Podfile `pod 'LLDebugToolSwift' , '~> 1.0' ,:configurations => ['Debug']`, Details also see [Wiki/Use in Debug environment](https://github.com/HDB-Li/LLDebugTool/wiki/Use-in-Debug-environment). If you want to specify the version, use as `pod 'LLDebugToolSwift' , '1.3.6' ,:configurations => ['Debug']`.
> 3. The recommended approach is to use multiple targets and only add `pod 'LLDebugToolSwift', '~> 1.0'` to Debug Target. This has the advantage of not contamiling the code in the Product environment and can be integrated into the App in the Archive Debug environment (if `:configurations => ['Debug']`, it can only run through XCode. It is not possible to Archive as an App).
> 4. Must be added in the Podfile **`use_frameworks!`**.
> 5. Install the pod(s) by running `pod install`. If you can't search `LLDebugToolSwift` or you can't find the newest release version, running `pod repo update` before `pod install`.
Expand Down

0 comments on commit 5a5e453

Please sign in to comment.