|
@@ -49,7 +49,6 @@
|
|
|
_tableView.rowHeight = UITableViewAutomaticDimension;
|
|
|
_tableView.estimatedRowHeight = 60;
|
|
|
_tableView.tableFooterView = [[UIView alloc] init];
|
|
|
-// [_tableView setEditing:YES animated:YES];
|
|
|
[self.view addSubview:self.tableView];
|
|
|
|
|
|
_noDataLabel = [[UILabel alloc] init];
|
|
@@ -60,8 +59,8 @@
|
|
|
_noDataLabel.autoresizingMask = UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;
|
|
|
[self.view addSubview:self.noDataLabel];
|
|
|
|
|
|
- _addBookmarkBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 60, self.view.frame.size.height - self.view.safeAreaInsets.bottom - 60, 60, 60)];
|
|
|
- _addBookmarkBtn.layer.cornerRadius = 30;
|
|
|
+ _addBookmarkBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width - self.view.safeAreaInsets.right - 50, self.view.frame.size.height - self.view.safeAreaInsets.bottom - 50, 50, 50)];
|
|
|
+ _addBookmarkBtn.layer.cornerRadius = 25;
|
|
|
_addBookmarkBtn.layer.masksToBounds = YES;
|
|
|
_addBookmarkBtn.layer.borderWidth = 1.0;
|
|
|
_addBookmarkBtn.layer.borderColor = [UIColor blueColor].CGColor;
|
|
@@ -101,15 +100,15 @@
|
|
|
}
|
|
|
|
|
|
- (void)panaddBookmarkBtn:(UIPanGestureRecognizer *)recognizer {
|
|
|
- CGPoint point = [recognizer translationInView:_tableView];
|
|
|
- CGRect documentFrame = _tableView.frame;
|
|
|
- documentFrame.origin.x -= _tableView.frame.origin.x;
|
|
|
- documentFrame.origin.y -= _tableView.frame.origin.y;
|
|
|
+ CGPoint point = [recognizer translationInView:self.view];
|
|
|
+ CGRect documentFrame = self.view.frame;
|
|
|
+ documentFrame.origin.x -= self.view.frame.origin.x;
|
|
|
+ documentFrame.origin.y -= self.view.frame.origin.y;
|
|
|
|
|
|
- [_addBookmarkBtn setCenter:CGPointMake(_addBookmarkBtn.center.x + point.x, _addBookmarkBtn.center.y + point.y)];
|
|
|
+ [_addBookmarkBtn setCenter:CGPointMake(_addBookmarkBtn.center.x + point.x / 15, _addBookmarkBtn.center.y + point.y / 15)];
|
|
|
|
|
|
if (!CGRectContainsRect(documentFrame,_addBookmarkBtn.frame)) {
|
|
|
- [_addBookmarkBtn setCenter:CGPointMake(_addBookmarkBtn.center.x - point.x, _addBookmarkBtn.center.y - point.y)];
|
|
|
+ [_addBookmarkBtn setCenter:CGPointMake(_addBookmarkBtn.center.x - point.x / 15, _addBookmarkBtn.center.y - point.y / 15)];
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -179,6 +178,7 @@
|
|
|
UIAlertAction *addAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Add", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
CPDFBookmarkViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
|
|
|
cell.titleLabel.text = alert.textFields.firstObject.text;
|
|
|
+ self.pdfView.document.bookmarks[indexPath.row].label = alert.textFields.firstObject.text;
|
|
|
}];
|
|
|
|
|
|
[alert addAction:cancelAction];
|