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

setup web view through constraints in order to seamless support iPhone X #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Pod/Core/ios/SimpleAuthWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,20 @@ @implementation SimpleAuthWebViewController {

- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];

self.webView.frame = self.view.bounds;
[self.view addSubview:self.webView];
[self setupWebView];
}

- (void)setupWebView {
[self.view addSubview:self.webView];

self.webView.translatesAutoresizingMaskIntoConstraints = NO;
[self.webView.topAnchor constraintEqualToAnchor:self.view.layoutMarginsGuide.topAnchor].active = YES;
[self.webView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor].active = YES;
[self.webView.bottomAnchor constraintEqualToAnchor:self.view.layoutMarginsGuide.bottomAnchor].active = YES;
[self.webView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor].active = YES;
}

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
Expand Down Expand Up @@ -102,7 +111,6 @@ + (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request {
- (UIWebView *)webView {
if (!_webView) {
_webView = [UIWebView new];
_webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
_webView.delegate = self;
}
return _webView;
Expand Down