Skip to content

Commit e42e856

Browse files
committed
Revert "fix bug of iOS 14 beta 6 navigation bar weird behavior. (#157)"
This reverts commit 3725ad5.
1 parent 37650ec commit e42e856

File tree

3 files changed

+0
-34
lines changed

3 files changed

+0
-34
lines changed

KMNavigationBarTransition/UINavigationBar+KMNavigationBarTransition.m

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
// THE SOFTWARE.
2323

2424
#import "UINavigationBar+KMNavigationBarTransition.h"
25-
#import "UINavigationBar+KMNavigationBarTransition_internal.h"
26-
#import "KMWeakObjectContainer.h"
2725
#import <objc/runtime.h>
2826
#import "KMSwizzle.h"
2927

@@ -37,13 +35,6 @@ + (void)load {
3735
@selector(layoutSubviews),
3836
[self class],
3937
@selector(km_layoutSubviews));
40-
// fix the bug of iOS14 beta 6
41-
if (@available(iOS 14.0, *)) {
42-
KMSwizzleMethod([self class],
43-
NSSelectorFromString(@"_accessibility_navigationController"),
44-
[self class],
45-
@selector(km_accessibility_navigationController));
46-
}
4738
});
4839
}
4940
#endif
@@ -64,24 +55,4 @@ - (void)setKm_isFakeBar:(BOOL)hidden {
6455
objc_setAssociatedObject(self, @selector(km_isFakeBar), @(hidden), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
6556
}
6657

67-
- (UINavigationController *) km_accessibility_navigationController {
68-
UINavigationController * navigationController = [self km_accessibility_navigationController];
69-
if (self.km_isFakeBar) {
70-
// if it's fake navigation bar
71-
// return previously bound navigationController.
72-
return self.km_fakeController;
73-
}
74-
return navigationController;
75-
}
76-
77-
- (UINavigationController *)km_fakeController
78-
{
79-
return km_objc_getAssociatedWeakObject(self, @selector(km_fakeController));
80-
}
81-
82-
- (void)setKm_fakeController:(UINavigationController *)km_fakeController
83-
{
84-
km_objc_setAssociatedWeakObject(self, @selector(km_fakeController), km_fakeController);
85-
}
86-
8758
@end

KMNavigationBarTransition/UINavigationBar+KMNavigationBarTransition_internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,5 @@
2626
@interface UINavigationBar (KMNavigationBarTransition_internal)
2727

2828
@property (nonatomic, assign) BOOL km_isFakeBar;
29-
// store current navigation controller.
30-
@property (nonatomic, weak) UINavigationController *km_fakeController;
3129

3230
@end

KMNavigationBarTransition/UIViewController+KMNavigationBarTransition.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ - (void)km_addTransitionNavigationBarIfNeeded {
128128
[self km_adjustScrollViewContentOffsetIfNeeded];
129129
UINavigationBar *bar = [[UINavigationBar alloc] init];
130130
bar.km_isFakeBar = YES;
131-
if (@available(iOS 14.0, *)) {
132-
bar.km_fakeController = self.navigationController;
133-
}
134131
bar.barStyle = self.navigationController.navigationBar.barStyle;
135132
if (bar.translucent != self.navigationController.navigationBar.translucent) {
136133
bar.translucent = self.navigationController.navigationBar.translucent;

0 commit comments

Comments
 (0)