Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
Added orientation fix by Ricardo Pinto
Browse files Browse the repository at this point in the history
  • Loading branch information
clsource committed Feb 20, 2019
1 parent 9c01696 commit cecc701
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/Jasonette/Jason.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ + (Jason*)client {
}
- (id)init {
if (self = [super init]) {

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onForeground) name:UIApplicationDidBecomeActiveNotification object:nil];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onBackground) name:UIApplicationDidEnterBackgroundNotification object:nil];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationChange) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];

self.searchMode = NO;
self.services = [[NSMutableDictionary alloc] init];

Expand Down Expand Up @@ -3141,6 +3146,16 @@ - (void)onForeground{
isForeground = YES;
}

- (void) onOrientationChange {
JasonViewController *vc = (JasonViewController *)[[Jason client] getVC];
WKWebView *agent = vc.agents[@"$webcontainer"];

if (agent) {
CGRect bounds = [[UIScreen mainScreen] bounds];
agent.frame = bounds;
}
}

# pragma mark - View Linking
- (void)go:(NSDictionary *)href{
/*******************************
Expand Down

1 comment on commit cecc701

@clsource
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.