|
@@ -15,7 +15,7 @@
|
|
|
#import <ComPDFKit/ComPDFKit.h>
|
|
|
#import <compdfkit_tools/compdfkit_tools.h>
|
|
|
|
|
|
-@interface CPDFViewController ()<UISearchBarDelegate,CPDFViewDelegate,CPDFListViewDelegate, CPDFMoreListViewDelegate, CSearchToolbarDelegate, CPDFDisplayViewDelegate, CPDFBOTAViewControllerDelegate,CPDFSearchResultsDelegate, CPDFThumbnailViewControllerDelegate,CPDFPopMenuViewDelegate,UIDocumentPickerDelegate>
|
|
|
+@interface CPDFViewController ()<UISearchBarDelegate,CPDFViewDelegate,CPDFListViewDelegate, CPDFMoreListViewDelegate, CSearchToolbarDelegate, CPDFDisplayViewDelegate, CPDFBOTAViewControllerDelegate,CPDFSearchResultsDelegate, CPDFThumbnailViewControllerDelegate,CPDFPopMenuViewDelegate,UIDocumentPickerDelegate,CPDFPopMenuDelegate>
|
|
|
|
|
|
@property(nonatomic, strong) NSString *filePath;
|
|
|
|
|
@@ -33,6 +33,8 @@
|
|
|
|
|
|
@property(nonatomic, strong) CPDFPopMenu *popMenu;
|
|
|
|
|
|
+@property(nonatomic, assign) BOOL popMenuClosed;
|
|
|
+
|
|
|
|
|
|
@end
|
|
|
|
|
@@ -92,16 +94,20 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
- (void)viewWillLayoutSubviews {
|
|
|
[super viewWillLayoutSubviews];
|
|
|
|
|
|
- if (@available(iOS 11.0, *)) {
|
|
|
- [self.popMenu showMenuInRect:CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 250, CGRectGetMaxY(self.navigationController.navigationBar.frame), 250, 200)];
|
|
|
- } else {
|
|
|
- // Fallback on earlier versions
|
|
|
- [self.popMenu showMenuInRect:CGRectMake(self.view.frame.size.width - 250, CGRectGetMaxY(self.navigationController.navigationBar.frame), 250, 200)];
|
|
|
+ if(!self.popMenuClosed) {
|
|
|
+ if (@available(iOS 11.0, *)) {
|
|
|
+ [self.popMenu showMenuInRect:CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 250, CGRectGetMaxY(self.navigationController.navigationBar.frame), 250, 200)];
|
|
|
+ } else {
|
|
|
+ // Fallback on earlier versions
|
|
|
+ [self.popMenu showMenuInRect:CGRectMake(self.view.frame.size.width - 250, CGRectGetMaxY(self.navigationController.navigationBar.frame), 250, 200)];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
CGFloat tPosY = 0;
|
|
|
if (!self.navigationController.navigationBarHidden) {
|
|
|
CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
|
|
@@ -188,6 +194,7 @@
|
|
|
menuView.delegate = self;
|
|
|
self.popMenu = [CPDFPopMenu popMenuWithContentView:menuView];
|
|
|
self.popMenu.dimCoverLayer = YES;
|
|
|
+ self.popMenu.delegate = self;
|
|
|
|
|
|
if (@available(iOS 11.0, *)) {
|
|
|
[self.popMenu showMenuInRect:CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 250, CGRectGetMaxY(self.navigationController.navigationBar.frame), 250, 200)];
|
|
@@ -218,6 +225,7 @@
|
|
|
}
|
|
|
|
|
|
- (void)PDFViewCurrentPageDidChanged:(CPDFView *)pdfView {
|
|
|
+ NSLog(@"");
|
|
|
}
|
|
|
|
|
|
#pragma mark - CPDFListViewDelegate
|
|
@@ -307,6 +315,10 @@
|
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
|
}
|
|
|
|
|
|
+#pragma mark - CPDFPopMenuDelegate
|
|
|
+- (void)MenuDidClosedIn:(CPDFPopMenu *)menu isClosed:(BOOL)isClosed {
|
|
|
+ self.popMenuClosed = isClosed;
|
|
|
+}
|
|
|
#pragma mark - CPDFThumbnailViewControllerDelegate
|
|
|
|
|
|
- (void)thumbnailViewController:(CPDFThumbnailViewController *)thumbnailViewController pageIndex:(NSInteger)pageIndex {
|