|
|
@@ -23,10 +23,7 @@
|
|
|
|
|
|
const int delta = 25;
|
|
|
|
|
|
-@interface ResultViewController () <JLRefreshDelegate,QLPreviewControllerDataSource,QLPreviewControllerDelegate>
|
|
|
-
|
|
|
-@property (nonatomic,strong) QLPreviewController *quickLook;
|
|
|
-@property (nonatomic,copy) NSString *documentPath;
|
|
|
+@interface ResultViewController () <JLRefreshDelegate,QLPreviewControllerDataSource,QLPreviewControllerDelegate,UIViewControllerPreviewingDelegate>
|
|
|
|
|
|
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *w_constraint;
|
|
|
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *h_constraint;
|
|
|
@@ -44,7 +41,7 @@ const int delta = 25;
|
|
|
- (void)viewDidLoad {
|
|
|
|
|
|
[super viewDidLoad];
|
|
|
-
|
|
|
+ self.titleLabel.text = nil;
|
|
|
|
|
|
// self.labelTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(labelTapAction:)];
|
|
|
//
|
|
|
@@ -100,6 +97,10 @@ const int delta = 25;
|
|
|
// self.tableview.tableHeaderView = [self get_tableHeader];
|
|
|
}
|
|
|
|
|
|
+- (void)presses3DTouchForIndexPath:(NSIndexPath *)indexPath {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
-(void)cellDoubleTapAction:(UIGestureRecognizer*)gestureRecognizer
|
|
|
{
|
|
|
|
|
|
@@ -405,6 +406,7 @@ const int delta = 25;
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
|
|
|
return [self.content_data[@"count"] intValue];
|
|
|
+// return 0;
|
|
|
|
|
|
}
|
|
|
//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
|
|
@@ -433,8 +435,8 @@ const int delta = 25;
|
|
|
value =self.content_layout[@"header"][@"bg_color"];//[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
|
|
|
|
|
|
if(value==nil)
|
|
|
- value=@"";
|
|
|
- unsigned long bgcolor = strtoul([value UTF8String],0,16);
|
|
|
+ value=@"0xFFFFFF";
|
|
|
+ unsigned long bgcolor = strtoul([value UTF8String],0,16);
|
|
|
|
|
|
UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
|
|
|
myView.backgroundColor = UIColorFromRGB(bgcolor);
|
|
|
@@ -552,6 +554,14 @@ const int delta = 25;
|
|
|
cellDoubleTap.numberOfTapsRequired = 2; //tap次数
|
|
|
[cell addGestureRecognizer:cellDoubleTap];
|
|
|
|
|
|
+ // 3D Touch
|
|
|
+ if (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable) {
|
|
|
+ DebugLog(@"3D Touch 可用!");
|
|
|
+ //给cell注册3DTouch的peek(预览)和pop功能
|
|
|
+ [self registerForPreviewingWithDelegate:self sourceView:cell];
|
|
|
+ } else {
|
|
|
+ DebugLog(@"3D Touch 无效");
|
|
|
+ }
|
|
|
|
|
|
|
|
|
NSArray* arr_col=self.content_layout[@"header"][@"col"];
|
|
|
@@ -707,6 +717,7 @@ const int delta = 25;
|
|
|
self.tableview.jl_footer.offsetBlock = ^(CGFloat offset) {
|
|
|
|
|
|
if (offset <= 0) {
|
|
|
+
|
|
|
weakSelf.footer_top_constraint.constant = offset;
|
|
|
}
|
|
|
};
|
|
|
@@ -749,6 +760,7 @@ const int delta = 25;
|
|
|
}
|
|
|
else if([actiontype isEqualToString:@"save"])
|
|
|
{
|
|
|
+ [weakSelf save];
|
|
|
}
|
|
|
}];
|
|
|
[alertControl addAction:actioni];
|
|
|
@@ -766,6 +778,11 @@ const int delta = 25;
|
|
|
|
|
|
[self presentViewController:alertControl animated:NO completion:nil];
|
|
|
}
|
|
|
+
|
|
|
+- (void)save {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
-(void)Export:(NSString*) url
|
|
|
{
|
|
|
|
|
|
@@ -1077,4 +1094,37 @@ const int delta = 25;
|
|
|
//修改tableHeaderView的frame
|
|
|
self.tableview.tableHeaderView.frame = headerFrame;
|
|
|
}
|
|
|
+
|
|
|
+#pragma mark - 3D Touch Delegate (PreviewingDelegate)
|
|
|
+
|
|
|
+// peek (预览)
|
|
|
+- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext viewControllerForLocation:(CGPoint)location {
|
|
|
+ // [previewingContext sourceView]即为所按压的视图
|
|
|
+ UITableViewCell *view = (UITableViewCell *)[previewingContext sourceView];
|
|
|
+//
|
|
|
+// // 设置不被虚化的范围
|
|
|
+// CGRect rect = view.bounds;
|
|
|
+// [previewingContext setSourceRect:rect];
|
|
|
+//
|
|
|
+// NSIndexPath *indexPath = [self.tableview indexPathForCell:view];
|
|
|
+// // peek (预览界面)
|
|
|
+// UIViewController *tvc = [self viewControllerFor3DTouch:indexPath];
|
|
|
+//
|
|
|
+// tvc.preferredContentSize = CGSizeMake(0, 480); // 预览图的大小
|
|
|
+//
|
|
|
+// return tvc;
|
|
|
+
|
|
|
+ NSIndexPath *indexPath = [self.tableview indexPathForCell:view];
|
|
|
+ [self presses3DTouchForIndexPath:indexPath];
|
|
|
+
|
|
|
+ return nil;
|
|
|
+}
|
|
|
+
|
|
|
+// pop (在预览基础上更用力按压)
|
|
|
+- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext commitViewController:(UIViewController *)viewControllerToCommit {
|
|
|
+
|
|
|
+// [self showViewController:viewControllerToCommit sender:self];
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
@end
|