Skip to content

Commit

Permalink
[Close #15] Remove dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Cee committed Oct 13, 2016
1 parent fc88554 commit 0093222
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 318 deletions.
15 changes: 7 additions & 8 deletions Classes/PFWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import "PFWebViewNavigationHeader.h"
#import "PFWebViewToolBar.h"
#import <WebKit/WebKit.h>
#import "UIView+ViewFrameGeometry.h"

#define SCREENWIDTH [UIScreen mainScreen].bounds.size.width
#define SCREENHEIGHT [UIScreen mainScreen].bounds.size.height
Expand Down Expand Up @@ -123,7 +122,7 @@ - (void)viewDidLayoutSubviews {

self.webMaskView.frame = self.webView.frame;
self.readerWebView.frame = self.webView.frame;
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, _readerWebView.width, self.maskLayer.bounds.size.height);
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, _readerWebView.frame.size.width, self.maskLayer.bounds.size.height);
}

#pragma mark - Lazy Initialize
Expand Down Expand Up @@ -189,8 +188,8 @@ - (void)setupReaderMode {
[self.view addSubview:self.webMaskView];

self.maskLayer = [CALayer layer];
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, self.readerWebView.width, 0.0f);
self.maskLayer.borderWidth = self.readerWebView.height / 2.0f;
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, self.readerWebView.frame.size.width, 0.0f);
self.maskLayer.borderWidth = self.readerWebView.frame.size.height / 2.0f;
self.maskLayer.anchorPoint = CGPointMake(0.5, 1.0f);

[self.readerWebView.layer setMask:self.maskLayer];
Expand Down Expand Up @@ -283,7 +282,7 @@ - (void)webViewToolbarGoBack:(PFWebViewToolBar *)toolbar {
if ([self.webView canGoBack]) {
[UIView animateWithDuration:0.3f animations:^{
self.webMaskView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.0f];
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, _readerWebView.width, 0.0f);
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, _readerWebView.frame.size.width, 0.0f);
} completion:^(BOOL finished) {
_readerWebView.userInteractionEnabled = NO;
}];
Expand All @@ -296,7 +295,7 @@ - (void)webViewToolbarGoForward:(PFWebViewToolBar *)toolbar {
if ([self.webView canGoForward]) {
[UIView animateWithDuration:0.3f animations:^{
self.webMaskView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.0f];
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, _readerWebView.width, 0.0f);
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, _readerWebView.frame.size.width, 0.0f);
} completion:^(BOOL finished) {
_readerWebView.userInteractionEnabled = NO;
}];
Expand Down Expand Up @@ -336,7 +335,7 @@ - (void)webViewToolbarDidSwitchReaderMode:(PFWebViewToolBar *)toolbar {
} else {
[UIView animateWithDuration:0.2f animations:^{
self.webMaskView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.0f];
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, _readerWebView.width, 0.0f);
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, _readerWebView.frame.size.width, 0.0f);
} completion:^(BOOL finished) {
_readerWebView.userInteractionEnabled = NO;
}];
Expand Down Expand Up @@ -445,7 +444,7 @@ - (void)userContentController:(WKUserContentController *)userContentController
dispatch_async(dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.1f delay:0.2f options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.webMaskView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.4f];
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, _readerWebView.width, _readerWebView.height);
self.maskLayer.frame = CGRectMake(0.0f, 0.0f, _readerWebView.frame.size.width, _readerWebView.frame.size.height);
} completion:^(BOOL finished) {
_readerWebView.userInteractionEnabled = YES;
}];
Expand Down
42 changes: 0 additions & 42 deletions Classes/UIView+ViewFrameGeometry.h

This file was deleted.

250 changes: 0 additions & 250 deletions Classes/UIView+ViewFrameGeometry.m

This file was deleted.

Binary file removed Demo/Present.mov
Binary file not shown.
Binary file removed Demo/Push.mov
Binary file not shown.
Loading

0 comments on commit 0093222

Please sign in to comment.