| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265 |
- //
- // ViewController.m
- // phoneTest
- //
- // Created by Ray on 01/09/2017.
- //
- //
- #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
- #import "ResultViewController.h"
- #import "FullyShowViewController.h"
- #import "RANetwork.h"
- #import "RAUtils.h"
- #import "JLRefreshHeader.h"
- #import "JLRefreshFooter.h"
- //#import "OrderDetailViewController.h"
- //#import "KVViewController.h"
- #import <QuickLook/QuickLook.h>
- #import "config.h"
- #import "RAConvertor.h"
- #import "RAUtils.h"
- //#import "RTLabel.h"
- #import "ResultCell.h"
- #import <AudioToolbox/AudioToolbox.h>
- const int delta = 25;
- @interface ResultViewController () <JLRefreshDelegate,QLPreviewControllerDataSource,QLPreviewControllerDelegate,UIViewControllerPreviewingDelegate,ResultCellTouchDelegate,UITableViewDelegate,UITableViewDataSource>
- @property (weak, nonatomic) IBOutlet NSLayoutConstraint *w_constraint;
- @property (weak, nonatomic) IBOutlet NSLayoutConstraint *h_constraint;
- @property (weak, nonatomic) IBOutlet NSLayoutConstraint *trail_constraint;
- @property (weak, nonatomic) IBOutlet NSLayoutConstraint *lead_constraint;
- @end
- @implementation ResultViewController
- + (instancetype)buildInstanceWithParams:(NSMutableDictionary *)params {
- id resultVC = [[self alloc] initWithNibName:@"Result" bundle:nil];
- ((ResultViewController *)resultVC).params = params;
- return resultVC;
- }
- - (void)labelClick {
- NSLog(@"underlineLabel被点击了");
- }
- - (void)resetContraint {
-
- for (NSLayoutConstraint *constraint in self.view.constraints) {
- if ([constraint.identifier isEqualToString:@"title_top"] ) {
- [self.view removeConstraint:constraint];
- }
- if ([constraint.identifier isEqualToString:@"scroll_bottom"]) {
- [self.view removeConstraint:constraint];
- }
- }
-
-
- NSLayoutConstraint *scroll_top = [NSLayoutConstraint constraintWithItem:self.titleBar
- attribute:NSLayoutAttributeTop
- relatedBy:NSLayoutRelationEqual
- toItem:self.topLayoutGuide
- attribute:NSLayoutAttributeBottom
- multiplier:1.0
- constant:0];
-
- NSLayoutConstraint *scroll_bottom = [NSLayoutConstraint constraintWithItem:self.scrollview
- attribute:NSLayoutAttributeBottom
- relatedBy:NSLayoutRelationEqual
- toItem:self.bottomLayoutGuide
- attribute:NSLayoutAttributeTop
- multiplier:1.0
- constant:0];
-
- [self.view addConstraint:scroll_top];
- [self.view addConstraint:scroll_bottom];
-
- CGFloat height = self.bottomLayoutGuide.length;
- self.bottom_mask_constraint.constant = height;
- }
- - (void)viewDidLayoutSubviews {
- [super viewDidLayoutSubviews];
-
- [self resetContraint];
- }
- - (void)viewDidLoad {
-
- [super viewDidLoad];
-
- self.default_row_text_size=14;
- self.default_title_text_size=17;
- self.default_line_color = 0x000000;
- self.titleLabel.text = nil;
- // self.labelTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(labelTapAction:)];
- //
- // self.labelTap.numberOfTouchesRequired = 1; //手指数
- // self.labelTap.numberOfTapsRequired = 2; //tap次数
- //
- //
- //
- //
- // self.cellDoubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cellDoubleTapAction:)];
- //
- // self.cellDoubleTap.numberOfTouchesRequired = 1; //手指数
- // self.cellDoubleTap.numberOfTapsRequired = 2; //tap次数
-
- // UITapGestureRecognizer *singleFingerOne = [[UITapGestureRecognizer alloc] initWithTarget:self
- // action:nil];
- // singleFingerOne.numberOfTouchesRequired = 1; //手指数
- // singleFingerOne.numberOfTapsRequired = 1; //tap次数
- //
- //
-
-
- // singleFingerTwo.delegate = self;
-
- self.label = [MDHTMLLabel new];
- self.label.font = [UIFont systemFontOfSize:self.default_row_text_size];
- self.label.textInsets = UIEdgeInsetsMake(0.f, 8.f, 0.f, 8.f);
- // NSString* Path = [[NSBundle mainBundle] pathForResource:@"layout.json" ofType:nil];
- //
- // NSData *data = [NSData dataWithContentsOfFile:Path];
- // self.content_layout = [[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil] mutableCopy];
- //
- //
- // Path = [[NSBundle mainBundle] pathForResource:@"data.json" ofType:nil];
- //
- // data = [NSData dataWithContentsOfFile:Path];
- // self.content_data = [[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil] mutableCopy];
-
-
- // int width=[self.content_layout[@"header"][@"width"] intValue];
- // if(width<self.tableview.frame.size.width)
- // width=self.tableview.frame.size.width;
- //
- // CGRect frame = CGRectMake(self.tableview.frame.origin.x, self.tableview.frame.origin.y, width, self.tableview.frame.size.height);
- // self.tableview.frame=frame;
- // self.scrollview.contentSize=self.tableview.frame.size;
- // Do any additional setup after loading the view, typically from a nib.
-
- self.automaticallyAdjustsScrollViewInsets = NO;
- self.tableview.tableFooterView = [UIView new];
- [self setupNavigationBar];
- [self configureTableView];
- [self setupTableRefreshView];
- [self loadContent];
-
-
- // self.tableview.tableHeaderView = [self get_tableHeader];
- }
- - (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
- }
- -(void)labelTapAction:(UIGestureRecognizer*)gestureRecognizer
- {
-
-
- NSLog(@"label touched");
- MDHTMLLabel* label = (MDHTMLLabel*)[gestureRecognizer view];
-
- NSIndexPath* index =[self.tableview indexPathForCell:(UITableViewCell*)label.superview];
-
-
- self.tableview.allowsSelection = true;
-
- [self.tableview selectRowAtIndexPath:index animated:NO scrollPosition:UITableViewScrollPositionBottom];
-
- self.label.htmlText = label.htmlText;
- [self.label sizeToFit];
- if(self.label.frame.size.width>label.frame.size.width||self.label.frame.size.height>label.frame.size.height)
- {
-
-
-
-
- FullyShowViewController *fullVC = [[UIStoryboard storyboardWithName:@"Result" bundle:nil] instantiateViewControllerWithIdentifier:@"fullyShowViewController"];
-
-
- fullVC.htmlText = label.htmlText;
-
- fullVC.preferredContentSize = CGSizeMake(200, 240);
-
- fullVC.modalPresentationStyle=UIModalPresentationPopover;
-
- UIPopoverPresentationController* popPc = fullVC.popoverPresentationController;
- popPc.permittedArrowDirections = UIPopoverArrowDirectionAny;
-
-
- CGRect rectl = [RAUtils relativeFrameForScreenWithView:label];
- CGRect rectv =[RAUtils relativeFrameForScreenWithView:self.view];
-
- CGRect intersection_rect=CGRectIntersection(rectl, rectv);
- UIWindow * window=[[[UIApplication sharedApplication] delegate] window];
- CGRect source_rect=[RAUtils relativeFrame:intersection_rect FromView:window toView:label];
- // CGRect rect=[v convertRect: v.bounds toView:window];
-
- popPc.sourceRect = source_rect;
- popPc.sourceView = label;
-
- // popPc.barButtonItem = label;
- popPc.delegate = self;
-
-
-
- [self presentViewController:fullVC animated:true completion:nil];
-
- }
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
-
- }
- -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
- {
- // auto resizing
- // self.scrollview.contentSize=self.tableview.frame.size;
-
- // auto layout
- // int width=[self.content_layout[@"header"][@"width"] intValue];
- // if(width<self.view.frame.size.width)
- // width=self.view.frame.size.width;
- // self.w_constraint.constant = width - CGRectGetWidth(self.view.bounds);
- // self.h_constraint.constant = 0;
- [self updateTableFrame];
-
- }
- #pragma mark - TableView DataSource
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-
- return [self.content_data[@"count"] intValue];
- // return 0;
-
- }
- //- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- //{
- // return 1;
- //}
- - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
- {
- int height=[self.content_layout[@"header"][@"height"] intValue];
- if(height==0)
- height=44;
- return height;
- }
- - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
- {
-
- NSArray* arr_col=self.content_layout[@"header"][@"col"];
-
-
- NSString* value =self.content_layout[@"header"][@"f_color"];//[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
-
- if(value==nil)
- value=@"";
- unsigned long fcolor = strtoul([value UTF8String],0,16);
-
- value =self.content_layout[@"header"][@"bg_color"];//[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
-
- if(value==nil)
- 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);
- myView.layer.shadowPath =[UIBezierPath bezierPathWithRect:myView.bounds].CGPath;
- myView.layer.shadowColor = [UIColor blackColor].CGColor;
- myView.layer.shadowOffset = CGSizeMake(0, 0);
- myView.layer.shadowOpacity = 0.5;
- myView.layer.shadowRadius = 2.0;
-
- int x=0;//[self.content_layout[@"header"][@"margin_l"] intValue];
- int y=0;//[self.content_layout[@"header"][@"margin_t"] intValue];;
- int height = [self.content_layout[@"header"][@"height"] intValue];
- for(int i=0;i<arr_col.count;i++)
- {
-
-
-
- int width = [arr_col[i][@"width"] intValue];
- UILabel *headerlabel = [[UILabel alloc] initWithFrame:CGRectMake(x, y, width, height)];
- headerlabel.font = [UIFont boldSystemFontOfSize:self.default_title_text_size];
- headerlabel.textColor=UIColorFromRGB(fcolor);//UIColor.blackColor;
- headerlabel.backgroundColor = [UIColor clearColor];
- headerlabel.text=arr_col[i][@"name"];
- headerlabel.textAlignment= [self get_TextHAlign:arr_col[i][@"h_align"] ];
-
- // headerlabel.font = [UIFont boldSystemFontOfSize:20];
- // [headerlabel sizeToFit];
-
- headerlabel.layer.borderWidth=0.5;
- headerlabel.layer.borderColor = UIColorFromRGB(self.default_line_color).CGColor;
- [myView addSubview:headerlabel];
- x+=width;
- }
-
-
- myView.autoresizesSubviews=true;
- // [myView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin];
-
-
-
-
- // modellabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
- // pricelabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
- // timelabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
- myView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
- //
- return myView;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- int height=[self.content_layout[@"row"][@"height"] intValue];
- if(height==0)
- height=44;
- return height;
- }
- -(NSTextAlignment) get_TextHAlign:(NSString*)textHAlign
- {
-
-
-
-
- if([textHAlign.lowercaseString isEqualToString:@"center"])
- return NSTextAlignmentCenter;
- else if([textHAlign.lowercaseString isEqualToString:@"left"])
- return NSTextAlignmentLeft;
- else if([textHAlign.lowercaseString isEqualToString:@"right"])
- return NSTextAlignmentRight;
-
- return NSTextAlignmentLeft;
- }
- //-(RTTextAlignment) get_RTTextHAlign:(NSString*)textHAlign
- //{
- //
- //
- //
- //
- // if([textHAlign.lowercaseString isEqualToString:@"center"])
- // return RTTextAlignmentCenter;
- // else if([textHAlign.lowercaseString isEqualToString:@"left"])
- // return RTTextAlignmentLeft;
- // else if([textHAlign.lowercaseString isEqualToString:@"right"])
- // return RTTextAlignmentRight;
- //
- // return RTTextAlignmentLeft;
- //}
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
-
-
-
- {
- NSString *CellIdentifier = @"tCell";
- ResultCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
- cell.touchDelegate = self;
- for(UIGestureRecognizer* g in cell.gestureRecognizers)
- [ cell removeGestureRecognizer:g];
- // cell gesture
- // [cell removeGestureRecognizer:self.cellDoubleTap];
- for(UIView* v in cell.subviews)
- {
- for(UIGestureRecognizer* g in v.gestureRecognizers)
- [ v removeGestureRecognizer:g];
-
- [v removeFromSuperview];
- }
- // cell.detailTextLabel.text=@"detail";
- // cell.textLabel.text=[NSString stringWithFormat:@"%ld",indexPath.row];
-
-
-
- UITapGestureRecognizer *cellDoubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cellDoubleTapAction:)];
-
- cellDoubleTap.numberOfTouchesRequired = 1; //手指数
- 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"];
-
- NSArray* item =self.content_data[[NSString stringWithFormat:@"item_%ld",indexPath.row]];
-
- NSString* value =self.content_layout[@"row"][@"f_color"];//[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
-
- if(value==nil)
- value=@"";
- unsigned long fcolor = strtoul([value UTF8String],0,16);
-
- value =self.content_layout[@"row"][@"color_0"];//[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
-
- if(value==nil)
- value=@"";
-
- unsigned long color0 = strtoul([value UTF8String],0,16);
-
- value =self.content_layout[@"row"][@"color_1"];//[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
-
- if(value==nil)
- value=@"";
-
- unsigned long color1 = strtoul([value UTF8String],0,16);
-
- int x=0;//[self.content_layout[@"header"][@"margin_l"] intValue];
- int y=0;//[self.content_layout[@"header"][@"margin_t"] intValue];;
- int height = [self.content_layout[@"row"][@"height"] intValue];
- for(int i=0;i<arr_col.count;i++)
- {
-
-
-
- int width = [arr_col[i][@"width"] intValue];;
- MDHTMLLabel *vallabel = [[MDHTMLLabel alloc] initWithFrame:CGRectMake(x, y, width, height)];
- vallabel.textInsets = UIEdgeInsetsMake(0.f, 8.f, 0.f, 8.f);
- vallabel.font = [UIFont systemFontOfSize:self.default_row_text_size];
- vallabel.textColor=UIColorFromRGB(fcolor);//UIColor.blackColor;
- vallabel.backgroundColor = [UIColor clearColor];
-
- NSString* text=@"";
- if(i>item.count-1)
- text=@"row data missing";
- else
- text=item[i];
-
-
- // RTTextLineBreakModeWordWrapping = kCTLineBreakByWordWrapping,
- // RTTextLineBreakModeCharWrapping = kCTLineBreakByCharWrapping,
- // RTTextLineBreakModeClip = kCTLineBreakByClipping,
- // NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:text];
-
-
- // vallabel.attributedText = attrStr;
-
- vallabel.htmlText = text;
- vallabel.textAlignment= [self get_TextHAlign:arr_col[i][@"h_align"] ];
-
- vallabel.layer.borderWidth=0.3;
- vallabel.layer.borderColor = UIColorFromRGB(self.default_line_color).CGColor;
-
- // UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(labelTapAction:)];
-
- UITapGestureRecognizer* labelTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(labelTapAction:)];
-
- labelTap.numberOfTouchesRequired = 1; //手指数
- labelTap.numberOfTapsRequired = 1; //tap次数
- [vallabel addGestureRecognizer:labelTap];
-
-
- [labelTap requireGestureRecognizerToFail:cellDoubleTap];
- // [vallabel addGestureRecognizer:self.cellDoubleTap];
- vallabel.userInteractionEnabled = YES;
- // [vallabel becomeFirstResponder];
- // vallabel.delegate = self;
- // [statuslabel sizeToFit];
- [cell addSubview:vallabel];
- x+=width;
- }
-
- cell.touchColor = [UIColor colorWithRed:0.3 green:0.3 blue:0.3 alpha:0.4];
- // cell.contentView.backgroundColor = [UIColor redColor];
-
- if(indexPath.row%2==0)
- cell.backgroundColor=UIColorFromRGB(color0);//[UIColor whiteColor];
- else
- cell.backgroundColor=UIColorFromRGB(color1);//[UIColor lightGrayColor];
-
- return cell;
- }
-
- }
- //- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
- //// cell.backgroundColor = [UIColor whiteColor];
- //}
- //#pragma mark - TouchLabel Delegate
- //- (void)touchLabel:(TouchLabel *)touchLabel touchesWtihTag:(NSInteger)tag
- //{
- //
- //}
- //-(void) empty
- //{
- //
- //}
- #pragma mark - UIPopoverPresentationControllerDelegate Delegate
- //实现该代理方法,返回UIModalPresentationNone值,可以在iPhone设备实现popover效果
- -(UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller{
- return UIModalPresentationNone;//不适配(不区分ipad或iPhone)
- }
- #pragma mark - TableView Delegate
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- NSLog(@"cell selected");
- }
- - (UITableViewCellEditingStyle)tableView:(UITableView *)tv editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
-
- return UITableViewCellEditingStyleDelete;
-
-
- }
- #pragma mark - Public
- - (void)setQueryParams:(NSMutableDictionary *)params {
- self.params = params;
- }
- #pragma mark - Private
- - (void)setupTableRefreshView {
-
- __weak typeof(self) weakSelf = self;
- self.tableview.jl_header = [[JLRefreshHeader alloc] init];
- self.tableview.jl_header.refreshDelegate = self;
- self.tableview.jl_header.clear = YES;
- self.tableview.jl_header.offsetBlock = ^(CGFloat offset) {
- if (offset <= 0) {
- weakSelf.header_top_constraint.constant = -offset;
- }
-
- };
- self.tableview.jl_header.stateChangeBlock = ^(JLRefreshState state) {
-
- NSString *title = [weakSelf.tableview.jl_header refreshTitleForState:state];
- weakSelf.refreshHeaderTitleLb.text = title;
- };
-
- self.tableview.jl_footer = [[JLRefreshFooter alloc] init];
- self.tableview.jl_footer.refreshDelegate = self;
- self.tableview.jl_footer.clear = YES;
- self.tableview.jl_footer.offsetBlock = ^(CGFloat offset) {
-
- if (offset <= 0) {
-
- weakSelf.footer_top_constraint.constant = offset;
- }
- };
- self.tableview.jl_footer.stateChangeBlock = ^(JLRefreshState state) {
-
- NSString *title = [weakSelf.tableview.jl_footer refreshTitleForState:state];
- weakSelf.refreshFooterTitleLb.text = title;
- };
- }
- - (void)configureTableView {
-
- [self.tableview registerNib:[UINib nibWithNibName:@"ResultCell" bundle:nil] forCellReuseIdentifier:@"tCell"];
- }
- - (void)setupNavigationBar {
-
- if(self.content_menu==nil)
- {
- self.navigationItem.rightBarButtonItem=nil;
- return;
- }
-
- UIBarButtonItem *menuItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ic_menu"] style:UIBarButtonItemStylePlain target:self action:@selector(MenuClick:)];
- self.navigationItem.rightBarButtonItem = menuItem;
-
- UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
- backItem.title = @"Back";
- self.navigationItem.backBarButtonItem = backItem;
- }
- - (NSInteger)resultItemCount {
- return [[self.content_data objectForKey:@"count"] integerValue];
- }
- - (void)loadContent {
- [self loadContentWithOption:0 Complete:nil];
- }
- - (void)updateTableFrame {
- // auto resizing
- // int width=[self.content_layout[@"header"][@"width"] intValue];
- // if(width<self.tableview.frame.size.width)
- // width=self.tableview.frame.size.width;
- //
- // CGRect frame = CGRectMake(self.tableview.frame.origin.x, self.tableview.frame.origin.y, width, self.tableview.frame.size.height);
- // self.tableview.frame=frame;
- // self.scrollview.contentSize=self.tableview.frame.size;
-
- // auto layout
- int width=[self.content_layout[@"header"][@"width"] intValue];
- if(width<self.view.frame.size.width)
- width=self.view.frame.size.width;
- self.w_constraint.constant = width - CGRectGetWidth(self.view.bounds);
- self.h_constraint.constant = 0;
-
- // 约束修改后立即重新布局
- [self.view layoutIfNeeded];
-
- if (@available(iOS 11.0,*)) {
- UIEdgeInsets edgeInsets = [self.view safeAreaInsets];
- CGFloat left = edgeInsets.left;
- CGFloat right = edgeInsets.right;
-
- self.lead_constraint.constant = left;
- self.trail_constraint.constant = right;
- /*
- * lead 和 trail改变之前
- * scrollview.size.width = self.view.size.width;
- * 改变后
- * scrollview.size.width = self.view.size.width - left - right;
- * 由于w_contraint本质上是根据scrolliew.size.width决定,实际上使用self.view.size.width计算得到
- * 所以w_contraint需要 +left +right补偿偏差。
- */
- self.w_constraint.constant += left + right;
- // 约束修改后立即重新布局
- [self.view layoutIfNeeded];
-
- }
-
- }
- #pragma mark - RefreshDelegate
- - (void)jl_pullRefresh:(JLRefreshBasis *)refresh state:(JLRefreshState)state percentage:(float)percentage {
-
- // NSString *title = [refresh refreshTitleForState:state];
- // CGFloat offset = refresh.jl_height * percentage;
-
- if ([refresh isEqual:self.tableview.jl_header]) {
- // self.refreshHeaderTitleLb.text = title;
- // self.header_top_constraint.constant = offset;
- }
-
- if (refresh == self.tableview.jl_footer) {
- // self.refreshFooterTitleLb.text = title;
- // self.footer_top_constraint.constant = -offset;
- }
-
- }
- - (void)jl_endRefresh:(JLRefreshBasis *)refresh {
- // state == idle
-
- // refresh UI
- [self.tableview reloadData];
- if (refresh == self.tableview.jl_footer && refresh.state == JLRefreshStateNoMore) {
-
- }
- }
- - (void)jl_beginRefresh:(JLRefreshBasis *)refresh {
- // state == refreshing
- // load data
-
- // finish loading data
- int option = 0;
- if ([refresh isEqual:self.tableview.jl_header]) {
- option = 1;
-
-
-
-
-
- }
- if (refresh == self.tableview.jl_footer) {
- if(refresh.state==JLRefreshStateNoMore) //数据取完不再加载
- return;
- option = 2;
- }
- self.tableview.userInteractionEnabled = NO;
- __weak typeof(self) weakSelf = self;
- [self loadContentWithOption:option Complete:^(int result, int count) {
- weakSelf.tableview.userInteractionEnabled = YES;
- if ([refresh isEqual:weakSelf.tableview.jl_header]) {
- [weakSelf.tableview.jl_header performSelector:@selector(endRefresh)];
- }
-
- if (refresh == weakSelf.tableview.jl_footer) {
- [weakSelf.tableview.jl_footer performSelector:@selector(endRefresh)];
- if (result == 2 && count < delta) {
- [weakSelf.tableview.jl_footer performSelector:@selector(noMoreData)];
- }
- }
- }];
- }
- #pragma mark - Quick Look
- - (MyQLPreviewController *)quickLook {
- if (!_quickLook)
- {
- _quickLook = [[MyQLPreviewController alloc] init];
- _quickLook.delegate = self;
- _quickLook.dataSource = self;
- }
- else
- {
- [_quickLook reloadData];
- }
- return _quickLook;
- }
- #pragma mark - QuickLook Data Source
- - (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller {
- return 1;
- }
- - (id <QLPreviewItem>) previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index {
-
- if(self.documentPath==nil)
- return nil;
- return [NSURL fileURLWithPath:self.documentPath];
- }
- #pragma mark - QuickLook Delegate
- - (void) previewControllerDidDismiss:(QLPreviewController *)controller {
-
- }
- /**
- * 文件内部链接点击不进行外部跳转
- */
- - (BOOL) previewController:(QLPreviewController *)controller shouldOpenURL:(NSURL *)url forPreviewItem:(id<QLPreviewItem>)item {
- return NO;
- }
- #pragma mark - customize editor
- - (UIView*)get_tableHeader
- {
-
- UILabel * headerview = [UILabel new];
- headerview.frame = CGRectMake(0, 0, self.tableview.frame.size.width, 44);
- headerview.numberOfLines = 0;
- headerview.textAlignment = NSTextAlignmentCenter;
- headerview.text = @"";
- return headerview;
- }
- -(void) resize_tableHeader
- {
- //利用systemLayoutSizeFittingSize:计算出真实高度
- CGFloat height = [self.tableview.tableHeaderView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
- CGRect headerFrame = self.tableview.tableHeaderView.frame;
- headerFrame.size.height = height+20;//20是留的上下边距
- //修改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];
- }
- #pragma mark - Cell Touch Delegate
- - (void)touchedCell:(ResultCell *)cell withForce:(float)force {
-
- if (force > 4.0f) {
- // 1519: 普通短震,3D Touch 中 Peek 震动反馈
- // 1520: 普通短震,3D Touch 中 Pop 震动反馈
- // 1521: 连续三次短震
- // kSystemSoundID_Vibrate: 震动很暴力,不适合震动反馈
- AudioServicesPlaySystemSound(1519); // 支持震动的设备上会震动,不支持就什么都不做 kSystemSoundID_Vibrate
- NSIndexPath *indexPath = [self.tableview indexPathForCell:cell];
- [self presses3DTouchForIndexPath:indexPath];
- }
- NSLog(@"force %f",force);
- }
- #pragma mark - Child View Controller Override
- /**
- * 0: init load
- * 1: refresh
- * 2: load more
- */
- - (void)loadContentWithOption:(int)option Complete:(void (^)(int result,int count))finish {
- NSAssert(true, ([NSString stringWithFormat:@"%s loadContentWithOption not impl",object_getClassName([self class])]));
- // if (self.params) {
- //
- // NSMutableDictionary *dic = self.params.mutableCopy;
- // switch (option) {
- // case 0:
- // case 1: {
- // self.offset = 0;
- // self.content_layout =nil;
- // self.content_action = nil;
- // self.content_menu = nil;
- // self.content_data = nil;
- // }
- // break;
- // case 2: {
- // self.offset = [self resultItemCount];
- // }
- // break;
- // }
- //
- //// dic[@"criteria"] = self.params;
- //
- // [dic setObject:@(self.offset) forKey:@"offset"];
- // [dic setObject:@(delta) forKey:@"limit"];
- //// dic[@"criteria"] = [NSArray arrayWithObjects:@"aaa",@"bbb", nil];
- //
- // __weak typeof(self) weakSelf = self;
- // dispatch_async(dispatch_get_global_queue(0, 0), ^{
- // NSDictionary *contentDic = [RANetwork query:dic];
- // NSInteger result = [[contentDic objectForKey:@"result"] integerValue];
- // dispatch_async(dispatch_get_main_queue(), ^{
- // if (weakSelf) {
- // __strong typeof(weakSelf) strongSelf = weakSelf;
- // if (result == RESULT_TRUE) {
- // strongSelf.content_layout = [contentDic objectForKey:@"layout"];
- // strongSelf.content_action = [contentDic objectForKey:@"row_action"];
- // strongSelf.content_menu = [[contentDic objectForKey:@"menu"] mutableCopy];
- // [strongSelf setupNavigationBar];
- //
- // UILabel * headerview=(UILabel *)self.tableview.tableHeaderView;
- // headerview.text = contentDic[@"table_title"];
- // [self resize_tableHeader];
- //
- // if(strongSelf.content_data==nil)
- // strongSelf.content_data = [NSMutableDictionary new];
- // NSMutableDictionary* newdata = [[contentDic objectForKey:@"data"] mutableCopy];
- // for(int dc = 0;dc<[newdata[@"count"] intValue];dc++)
- // {
- // NSMutableDictionary * newdata_item = newdata[[NSString stringWithFormat:@"item_%d",dc]];
- //
- // strongSelf.content_data[[NSString stringWithFormat:@"item_%d",[strongSelf.content_data[@"count"] intValue] ]] = newdata_item;
- // strongSelf.content_data[@"count"] = @([strongSelf.content_data[@"count"] intValue]+1);
- // }
- //
- //// strongSelf.content_data = [contentDic objectForKey:@"data"];
- // [strongSelf updateTableFrame];
- // [strongSelf.tableview reloadData];
- // } else {
- // [RAUtils message_alert:[contentDic objectForKey:@"err_msg"] title:@"Warning" controller:strongSelf];
- // }
- //
- // if (finish) {
- // finish((int)result,(int)[self resultItemCount]);
- // }
- //
- // }
- //
- // });
- // });
- // }
- }
- - (void)MenuClick:(UIBarButtonItem *)sender {
-
- // UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
- // //block代码块取代了delegate
- //
- // __weak typeof(self) weakSelf = self;
- // for(int i=0;i<self.content_menu.count;i++)
- // {
- // NSMutableDictionary* json = self.content_menu[i];
- // NSString* title =json[@"title"];
- // NSString* actiontype = json[@"action"];
- // NSString* url = json[@"url"];
- //// NSMutableDictionary* add_params = json[@"params"];
- // UIAlertAction *actioni = [UIAlertAction actionWithTitle:title style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
- // // DebugLog(@"Cancel");
- // if([actiontype isEqualToString:@"download"])
- // {
- // [weakSelf Export:url];
- // }
- // else if([actiontype isEqualToString:@"save"])
- // {
- // [weakSelf save];
- // }
- // }];
- // [alertControl addAction:actioni];
- // }
- //
- // UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
- // // DebugLog(@"Cancel");
- //
- // }];
- // [alertControl addAction:actionCancel];
- //
- //
- //
- //
- //
- // [self presentViewController:alertControl animated:NO completion:nil];
- }
- //- (void)save {
- //
- //}
- //
- //-(void)Export:(NSString*) url
- //{
- //
- // NSAssert(true, ([NSString stringWithFormat:@"%s Export not impl",object_getClassName([self class])]));
- //// if(self.download_query )
- //// {
- //// self.documentPath = self.download_query;
- //// [self.navigationController pushViewController:self.quickLook animated:NO];
- //// return;
- //// }
- ////
- //// __weak typeof(self) weakSelf = self;
- //// dispatch_async(dispatch_get_global_queue(0, 0), ^{
- ////
- ////// NSMutableDictionary *params = self.params.mutableCopy;
- ////// if(add_params!=nil)
- ////// [params addEntriesFromDictionary:add_params];
- //// NSString *path = [RANetwork download_query:url];
- //// weakSelf.download_query = path;
- //// weakSelf.documentPath = path;
- ////
- //// if (path) {
- //// dispatch_async(dispatch_get_main_queue(), ^{
- //// [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
- //// });
- //// }
- ////
- //// });
- //}
- //- (void)downloadItemClick:(UIBarButtonItem *)sender {
- // NSAssert(true, ([NSString stringWithFormat:@"%s downloadItemClick not impl",object_getClassName([self class])]));
- ////
- ////
- //// if(self.download_query )
- //// {
- //// self.documentPath = self.download_query;
- //// [self.navigationController pushViewController:self.quickLook animated:NO];
- //// return;
- //// }
- ////
- //// __weak typeof(self) weakSelf = self;
- //// dispatch_async(dispatch_get_global_queue(0, 0), ^{
- ////
- //// NSMutableDictionary *params = self.params.mutableCopy;
- //// NSString *path = [RANetwork download_query:params];
- //// weakSelf.download_query = path;
- //// weakSelf.documentPath = path;
- ////
- //// if (path) {
- //// dispatch_async(dispatch_get_main_queue(), ^{
- //// [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
- //// });
- //// }
- ////
- //// });
- ////
- //}
- - (void)presses3DTouchForIndexPath:(NSIndexPath *)indexPath {
-
- }
- -(void)cellDoubleTapAction:(UIGestureRecognizer*)gestureRecognizer
- {
-
- NSAssert(true, ([NSString stringWithFormat:@"%s cellDoubleTapAction not impl",object_getClassName([self class])]));
- }
- //{
- // NSLog(@"cell double tap");
- // UITableViewCell* cell = (UITableViewCell*)[gestureRecognizer view];
- // NSIndexPath* indexPath=[self.tableview indexPathForCell:cell];
- // //strongSelf.content_action
- // if(self.content_action!=nil)
- // {
- //
- // if(self.content_action.count==1)
- // {
- // NSDictionary* action =self.content_action.firstObject;
- // NSString * module = action[@"module"];
- // if([module isEqualToString:@"quick_look"])
- // {
- //
- // // +(NSString*)download_file : (NSMutableDictionary*) params url:(NSString*) url
- // NSMutableDictionary *params = action[@"params"];
- // NSString* URL =action[@"url"];
- // __weak typeof(self) weakSelf = self;
- // dispatch_async(dispatch_get_global_queue(0, 0), ^{
- //
- //
- // NSString *path = [RANetwork download_file:params url:URL];
- // weakSelf.documentPath = path;
- //
- // if (path) {
- // dispatch_async(dispatch_get_main_queue(), ^{
- // [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
- // });
- // }
- //
- // });
- // }
- // else if([module isEqualToString:@"kv_detail"])
- // {
- // NSMutableDictionary *params = [NSMutableDictionary new];
- // params[@"query_id"] = self.params[@"query_id"];
- //
- // NSMutableDictionary *criteria =[NSMutableDictionary new];
- // for(NSString* key in [action[@"params"] allKeys] )
- // {
- // NSArray* item =self.content_data[[NSString stringWithFormat:@"item_%ld",indexPath.row]];
- // int idx =[action[@"params"][key] intValue];
- // criteria[key]=item[ idx];
- // }
- //
- //
- // params[@"criteria"]=[RAConvertor dict2string:criteria] ;
- //
- //
- //
- // UIAlertView * waitalert = [RAUtils waiting_alert:@"Loading..." title:@"Please wait"];
- //
- //
- // __weak typeof(self) weakself = self;
- // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- //
- //
- //
- // NSDictionary* json =[RANetwork kv_detail:params];
- //
- // dispatch_async(dispatch_get_main_queue(), ^{
- // [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
- //
- //
- // if([[json valueForKey:@"result"] intValue]==2)
- // {
- // KVViewController *vc = [[UIStoryboard storyboardWithName:@"Detail" bundle:nil] instantiateViewControllerWithIdentifier:@"KVViewController"];
- // vc.content = [json mutableCopy];
- // [weakself.navigationController pushViewController:vc animated:NO];
- //
- // // weakself.content_data_download = [weakself CopyDirty:weakself.content_data_download to:[editor_json mutableCopy]];//[editor_json mutableCopy];
- // //
- // // weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
- // //
- // //
- // // [weakself download_success];
- // // [weakself.editorTable reloadData];
- //
- // }
- // else
- // {
- // [RAUtils message_alert:json[@"msg"] title:nil controller:weakself] ;
- // }
- //
- //
- //
- //
- // });
- // });
- // }
- // else if([module isEqualToString:@"order_detail"])
- // {
- //
- // OrderDetailViewController *vc = [[UIStoryboard storyboardWithName:@"Detail" bundle:nil] instantiateViewControllerWithIdentifier:@"OrderDetailViewController"];
- //
- //
- // vc.url_type = URL_REMOTE;
- // vc.request_url=URL_ORDER_DETAIL;
- //
- //
- // vc.params = [NSMutableDictionary dictionary];
- // // NSString *path = [[NSBundle mainBundle] pathForResource:@"search_ui.json" ofType:nil];
- // // NSData *data = [NSData dataWithContentsOfFile:path];
- // // vc.content_data_download = [[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil] mutableCopy];
- // [self.navigationController pushViewController:vc animated:NO];
- // return;
- // }
- // }
- // else
- // {
- //
- // UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"" message:nil preferredStyle:UIAlertControllerStyleAlert];
- // //block代码块取代了delegate
- //
- // __weak typeof(self) weakSelf = self;
- // for(int i=0;i<self.content_action.count;i++)
- // {
- // NSMutableDictionary* json = self.content_action[i];
- // NSString* title =json[@"title"];
- // NSString* module = json[@"module"];
- // NSMutableDictionary* add_params = json[@"params"];
- // UIAlertAction *actioni = [UIAlertAction actionWithTitle:title style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
- //
- //
- // if([module isEqualToString:@"quick_look"])
- // {
- //
- // // +(NSString*)download_file : (NSMutableDictionary*) params url:(NSString*) url
- // NSMutableDictionary *params = json[@"params"];
- // NSString* URL =json[@"url"];
- // __weak typeof(self) weakSelf = self;
- // dispatch_async(dispatch_get_global_queue(0, 0), ^{
- //
- //
- // NSString *path = [RANetwork download_file:params url:URL];
- // weakSelf.documentPath = path;
- //
- // if (path) {
- // dispatch_async(dispatch_get_main_queue(), ^{
- // [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
- // });
- // }
- //
- // });
- // }
- // else if([module isEqualToString:@"kv_detail"])
- // {
- // NSMutableDictionary *params = json[@"params"];
- //
- //
- // UIAlertView * waitalert = [RAUtils waiting_alert:@"Loading..." title:@"Please wait"];
- //
- //
- // __weak typeof(self) weakself = self;
- // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- //
- //
- //
- // NSDictionary* json =[RANetwork kv_detail:params];
- //
- // dispatch_async(dispatch_get_main_queue(), ^{
- // [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
- //
- //
- // if([[json valueForKey:@"result"] intValue]==2)
- // {
- // KVViewController *vc = [[UIStoryboard storyboardWithName:@"Detail" bundle:nil] instantiateViewControllerWithIdentifier:@"KVViewController"];
- // vc.content = [json mutableCopy];
- // [weakself.navigationController pushViewController:vc animated:NO];
- //
- // // weakself.content_data_download = [weakself CopyDirty:weakself.content_data_download to:[editor_json mutableCopy]];//[editor_json mutableCopy];
- // //
- // // weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
- // //
- // //
- // // [weakself download_success];
- // // [weakself.editorTable reloadData];
- //
- // }
- // else
- // {
- // [RAUtils message_alert:json[@"msg"] title:nil controller:weakself] ;
- // }
- //
- //
- //
- //
- // });
- // });
- // }
- // else if([module isEqualToString:@"order_detail"])
- // {
- //
- // OrderDetailViewController *vc = [[UIStoryboard storyboardWithName:@"Detail" bundle:nil] instantiateViewControllerWithIdentifier:@"OrderDetailViewController"];
- //
- //
- // vc.url_type = URL_REMOTE;
- // vc.request_url=URL_ORDER_DETAIL;
- //
- //
- // vc.params = [NSMutableDictionary dictionary];
- // // NSString *path = [[NSBundle mainBundle] pathForResource:@"search_ui.json" ofType:nil];
- // // NSData *data = [NSData dataWithContentsOfFile:path];
- // // vc.content_data_download = [[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil] mutableCopy];
- // [self.navigationController pushViewController:vc animated:NO];
- // return;
- // }
- // // DebugLog(@"Cancel");
- //// if([actiontype isEqualToString:@"download"])
- //// {
- //// [weakSelf Export:add_params];
- //// }
- //// else if([actiontype isEqualToString:@"save"])
- //// {
- //// }
- // }];
- // [alertControl addAction:actioni];
- // }
- //
- // UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
- // // DebugLog(@"Cancel");
- //
- // }];
- // [alertControl addAction:actionCancel];
- //
- //
- //
- //
- //
- // [self presentViewController:alertControl animated:NO completion:nil];
- //
- // }
- //
- // }
- //
- //
- //
- //}
- @end
|