Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
[client] some wacky stuff to fix weird ios 8 crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
kirb committed Aug 19, 2016
1 parent 7f199c9 commit 93f6af5
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions client/Client.xm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
self = %orig;

if (self) {
[[HBTSStatusBarAlertController sharedInstance] addStatusBar:self];
if (![self isKindOfClass:%c(SBFakeStatusBarView)]) {
[[HBTSStatusBarAlertController sharedInstance] addStatusBar:self];
}
}

return self;
Expand Down Expand Up @@ -65,12 +67,11 @@
- (void)_swapToNewForegroundView {
%orig;

if (self._typeStatus_needsNewForegroundView) {
if (self._typeStatus_needsNewForegroundView && ![self isKindOfClass:%c(SBFakeStatusBarView)]) {
self._typeStatus_needsNewForegroundView = NO;
self._typeStatus_foregroundView = nil;

[self._typeStatus_foregroundView removeFromSuperview];

UIStatusBarForegroundView *statusBarView = MSHookIvar<UIStatusBarForegroundView *>(self, "_foregroundView");
UIStatusBarForegroundView *statusBarView = [self valueForKey:@"_foregroundView"];

HBTSStatusBarForegroundView *typeStatusView;

Expand Down Expand Up @@ -111,7 +112,7 @@
HBTSStatusBarAnimation animation = [HBTSPreferences sharedInstance].overlayAnimation;

HBTSStatusBarForegroundView *typeStatusView = self._typeStatus_foregroundView;
UIStatusBarForegroundView *statusBarView = MSHookIvar<UIStatusBarForegroundView *>(self, "_foregroundView");
UIStatusBarForegroundView *statusBarView = [self valueForKey:@"_foregroundView"];

self.clipsToBounds = YES;
self._typeStatus_isVisible = direction;
Expand Down Expand Up @@ -181,6 +182,12 @@
}];
}

- (void)dealloc {
[[HBTSStatusBarAlertController sharedInstance] removeStatusBar:self];

%orig;
}

%end

#pragma mark - Constructor
Expand Down

0 comments on commit 93f6af5

Please sign in to comment.