Skip to content

Commit

Permalink
修改 劫持UIView 方法bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hongru1227 committed Aug 11, 2017
1 parent 10bb49a commit d0529d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion WTSafeGuard.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'WTSafeGuard'
s.version = '1.1.0'
s.version = '1.1.1'
s.summary = 'A short description of WTSafeGuard.'

# This description is used to generate tags and improve search results.
Expand Down
8 changes: 4 additions & 4 deletions WTSafeGuard/Classes/UI/UIView+WTSafe.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ + (void)runSafeGuard
{
NSError *error = nil;

[UIView jr_swizzleClassMethod:@selector(setNeedsLayout) withClassMethod:@selector(WT_safe_setNeedsLayout) error:&error];
[UIView jr_swizzleMethod:@selector(setNeedsLayout) withMethod:@selector(WT_safe_setNeedsLayout) error:&error];
[WTSafeGuard logSafeMethodErrorThenSetNil:&error];
[UIView jr_swizzleClassMethod:@selector(layoutIfNeeded) withClassMethod:@selector(WT_safe_layoutIfNeeded) error:&error];
[UIView jr_swizzleMethod:@selector(layoutIfNeeded) withMethod:@selector(WT_safe_layoutIfNeeded) error:&error];
[WTSafeGuard logSafeMethodErrorThenSetNil:&error];
[UIView jr_swizzleClassMethod:@selector(layoutSubviews) withClassMethod:@selector(WT_safe_layoutSubviews) error:&error];
[UIView jr_swizzleMethod:@selector(layoutSubviews) withMethod:@selector(WT_safe_layoutSubviews) error:&error];
[WTSafeGuard logSafeMethodErrorThenSetNil:&error];
[UIView jr_swizzleClassMethod:@selector(setNeedsUpdateConstraints) withClassMethod:@selector(WT_safe_setNeedsUpdateConstraints) error:&error];
[UIView jr_swizzleMethod:@selector(setNeedsUpdateConstraints) withMethod:@selector(WT_safe_setNeedsUpdateConstraints) error:&error];
[WTSafeGuard logSafeMethodErrorThenSetNil:&error];

}
Expand Down
1 change: 0 additions & 1 deletion WTSafeGuard/Classes/WebView/WKWebView+WTSafe.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ + (void)runSafeGuard
NSError *error = nil;
[WKWebView jr_swizzleMethod:@selector(loadRequest:) withMethod:@selector(wt_safeLoadRequest:) error:&error];
[WTSafeGuard logSafeMethodErrorThenSetNil:&error];
//KVO
[WKWebView jr_swizzleMethod:@selector(loadFileURL:allowingReadAccessToURL:) withMethod:@selector(wt_safeLoadFileURL:allowingReadAccessToURL:) error:&error];
[WTSafeGuard logSafeMethodErrorThenSetNil:&error];
[WKWebView jr_swizzleMethod:@selector(loadHTMLString:baseURL:) withMethod:@selector(wt_safeLoadHTMLString:baseURL:) error:&error];
Expand Down

0 comments on commit d0529d2

Please sign in to comment.