Files
PojavLauncher_iOS/Natives/LauncherNewsViewController.m
T
Duy Tran Khanh 5eae6015d6 Rearranged UI layout
* Moved account selection to the secondary NavigationController
* Added logo to fill in the primary one
* Moved buttons to the sidebar:
- Custom controls
- Install jar
- Send logs
* Fixed object memory leakage in LauncherNavigationController
* Set fullscreen=false on startup, workaround < 1.13 resizing issue
* Reduced mouse_pointer size

TODOs:
* Add icons for new items, will prefer copying from the Android
version.
* Remove LoginViewController: integrate add account to the account
selector, move Techno text+check to sidebar, etc..
* Instead of separate Microsoft, Demo login; display demo warning
before MS login.
2022-11-21 22:03:59 +07:00

42 lines
1.4 KiB
Objective-C

#import <SafariServices/SafariServices.h>
#import <WebKit/WebKit.h>
#import "LauncherNewsViewController.h"
@interface LauncherNewsViewController()<WKNavigationDelegate>
@end
@implementation LauncherNewsViewController
- (NSString *)imageName {
return @"MenuNews";
}
- (void)viewDidLoad
{
[super viewDidLoad];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://pojavlauncherteam.github.io/changelogs/IOS.html"]];
WKWebViewConfiguration *webConfig = [[WKWebViewConfiguration alloc] init];
WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.frame configuration:webConfig];
webView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
webView.navigationDelegate = self;
webView.opaque = NO;
[webView loadRequest:request];
[self.view addSubview:webView];
}
- (void)webView:(WKWebView *)webView
decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
if (navigationAction.navigationType == WKNavigationTypeLinkActivated) {
SFSafariViewController *vc = [[SFSafariViewController alloc] initWithURL:navigationAction.request.URL];
[self presentViewController:vc animated:YES completion:nil];
decisionHandler(WKNavigationActionPolicyCancel);
return;
}
decisionHandler(WKNavigationActionPolicyAllow);
}
@end