| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307 |
- //
- // DocumentPageViewController.m
- // AntsContract
- //
- // Created by Ray on 12/16/16.
- // Copyright © 2016 United Software Applications, Inc. All rights reserved.
- //
- #import "DocumentPageViewController.h"
- #import "PageViewController.h"
- #import "SignatureListViewController.h"
- #import "SignatureViewController.h"
- #import "PDFUtils.h"
- #import "RANetwork.h"
- #import "dbgPageVC.h"
- //#import "AFHTTPSessionManager.h"
- #import "AppDelegate.h"
- #import "RANetwork.h"
- #import "RAUtils.h"
- //#import "PDFViewController.h"
- #import "config.h"
- #import "AESCrypt.h"
- #import "CustomIOSAlertView.h"
- #import "ImageUtils.h"
- //#import "RAPDFPage.h"
- #import "TextDrawable.h"
- #import "ImageDrawable.h"
- #import "RectDrawable.h"
- @interface DocumentPageViewController ()
- @end
- @implementation DocumentPageViewController
- - (IBAction)onLeftButtonClick:(id)sender {
-
- // if(true)
- // {
- // self.pdfPath = [[NSBundle mainBundle] pathForResource:@"ZINC_3D_Printing_Guide[1.2].pdf" ofType:nil];
- //// [self indexOfViewController:(PageViewController *)viewController]
- // [self setupDocument];
- // PageViewController* pvc= self.pageViewController.viewControllers[0] ;
- // NSUInteger index=[self indexOfViewController:pvc];
- // pvc.pageRef = CGPDFDocumentGetPage (self.document , index+1);
- // [pvc refreshPage];
- // return;
- //
- // }
-
- // - (NSUInteger) indexOfViewController:(PageViewController *)viewController
-
- UIViewController* pvc = [self pageViewController:self.pageViewController viewControllerBeforeViewController:self.pageViewController.viewControllers[0]];
-
- if(pvc==nil)
- return;
- __weak typeof(self) weakSelf = self;
- [self.pageViewController setViewControllers:@[pvc] direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:^(BOOL finished){
-
- long index=[weakSelf indexOfViewController:(PageViewController*)pvc];
- if(index==0)
- weakSelf.left_button.hidden=true;
- else
- weakSelf.left_button.hidden=false;
-
- if(index==weakSelf.total_page-1)
- weakSelf.right_button.hidden=true;
- else
- weakSelf.right_button.hidden=false;
- }];
-
- // self.pageViewController
- }
- - (IBAction)onRightButtonClick:(id)sender {
-
- UIViewController* pvc = [self pageViewController:self.pageViewController viewControllerAfterViewController:self.pageViewController.viewControllers[0]];
-
- if(pvc==nil)
- return;
-
-
- __weak typeof(self) weakSelf = self;
- [self.pageViewController setViewControllers:@[pvc] direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:^(BOOL finished){
-
- long index=[weakSelf indexOfViewController:(PageViewController*)pvc];
- if(index==0)
- weakSelf.left_button.hidden=true;
- else
- weakSelf.left_button.hidden=false;
-
- if(index==weakSelf.total_page-1)
- weakSelf.right_button.hidden=true;
- else
- weakSelf.right_button.hidden=false;
- }];
- }
- -(NSMutableDictionary*) templateInit:(NSMutableDictionary*) template
- {
- AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-
- NSString* temp = NSTemporaryDirectory();
- NSString* filename =[NSString stringWithFormat:@"%@.png", [[NSUUID UUID] UUIDString]];
- NSString* qrpath=[temp stringByAppendingPathComponent:filename];
- UIImage* qrimg=[ImageUtils generateBarCode:self.docment_id width:300 height:44];//[QRCodeGenerator qrImageForString:order_code imageSize:240];
-
- bool bwrite=[UIImagePNGRepresentation(qrimg)writeToFile: qrpath atomically:YES];
-
-
-
- for(int i=0;i<[template[@"count"] intValue];i++)
- {
- NSMutableDictionary* page =template[[NSString stringWithFormat:@"page_%d",i]];
- for(int j=0;j<[page[@"count"] intValue];j++)
- {
- NSMutableDictionary* control =page[[NSString stringWithFormat:@"control_%d",j]];
- NSString* type = control[@"type"];
- NSString* field =control[@"field"];
- bool disable = [control[@"disable"] boolValue];
- control[@"dirty"]=[NSNumber numberWithBool:false];
- if([type isEqualToString:@"Label"])
- {
- if([field isEqualToString:@"doc_number"])
- {
- control[@"value"]= self.docment_id;
- }
- }
- else if([type isEqualToString:@"Image"])
- {
- NSString* name =control[@"name"];
- if([name isEqualToString:@"BarCode"])
- {
- if(bwrite)
- control[@"value"]= qrpath;
- }
- }
- else if([type isEqualToString:@"DatePicker"])
- {
- NSString* name =control[@"aname"];
- if([name isEqualToString:@"Today's Date"]/*||[name isEqualToString:@"Handwrite date"]*/)
- {
- NSDateFormatter * formatter = [[NSDateFormatter alloc]init];
- [formatter setDateFormat:@"MM/dd/yyyy"];
- NSString* date = [formatter stringFromDate:[NSDate date]] ;
- // NSString* cval = control[@"value"];
- // if(cval==nil)
- control[@"value"]= date;
- }
- }
- else if([type isEqualToString:@"Signature"]&&disable)
- {
- control[@"value"]= appDelegate.na_path;
- }
- else if([type isEqualToString:@"TextView"])
- {
- NSString* name =control[@"aname"];
- if([name isEqualToString:@"Agent Name"]||[name isEqualToString:@"Sales Person"])
- {
- // NSString* cval = control[@"value"];
- // if(cval==nil)
- control[@"value"]= appDelegate.agentName;
-
-
- }
-
-
-
- }
- }
- }
- return template;
- }
- -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
- {
- }
- -(void) setupDocument
- {
- self.signatureData= [[NSMutableDictionary alloc] init];
-
-
- if(self.document!=nil)
- {
- CFRelease(self.document);
- }
- self.document = [PDFUtils OpenPDF:self.pdfPath];
- self.total_page = CGPDFDocumentGetNumberOfPages (self.document);
- if(self.action==PDFEditActionNew)
- self.controlTemplate = [self templateInit:[PDFUtils loadControl:self.templatePath]];
- else
- self.controlTemplate =[PDFUtils loadControl:self.templatePath];
-
-
-
- // self.pageViewController rel
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.title = self.docment_id;
- if(self.hide_control)
- [self.ibSave setTitle:@"Upload"];
- else
- [self.ibSave setTitle:@"Save"];
-
-
- // self.delegate = self;
- // self.dataSource = self;
-
- // 修复初始化时视图向下偏移64点
- UIView *v = [[UIView alloc] init];
- [self.view insertSubview:v atIndex:0];
-
- [self setupDocument];
- // self.signatureData= [[NSMutableDictionary alloc] init];
- //
- //
- // self.document = [PDFUtils OpenPDF:self.pdfPath];
- // self.total_page = CGPDFDocumentGetNumberOfPages (self.document);
- // if(self.action==PDFEditActionNew)
- // self.controlTemplate = [self templateInit:[PDFUtils loadControl:self.templatePath]];
- // else
- // self.controlTemplate =[PDFUtils loadControl:self.templatePath];
-
-
- // self.title = [NSString stringWithFormat:@"%@ [%d/%ld]", self.docment_id,1, self.total_page ];
-
-
- PageViewController* startingViewController=[self viewControllerAtIndex:0];
-
- // NSArray* viewControllers =[NSArray arrayWithObjects:page_0,nil];
-
- self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil];
- self.pageViewController.delegate = self;
-
- // PageViewController *startingViewController = [self viewControllerAtIndex:0 storyboard:self.storyboard];
- NSArray *viewControllers = @[startingViewController];
-
-
- // dbgPageVC* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"dbgPageVC"];
-
-
- [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
-
- self.pageViewController.dataSource = self;
-
- [self addChildViewController:self.pageViewController];
- [self.view addSubview:self.pageViewController.view];
-
- // Set the page view controller's bounds using an inset rect so that self's view is visible around the edges of the pages.
- CGRect pageViewRect = self.view.bounds;
- if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
- pageViewRect = pageViewRect;//CGRectInset(pageViewRect, 40.0, 40.0);
- }
- self.pageViewController.view.frame = pageViewRect;
-
- [self.pageViewController didMoveToParentViewController:self];
-
- self.left_button.hidden=true;
- self.right_button.hidden=false;
-
-
- [self.view bringSubviewToFront:self.left_button];
- [self.view bringSubviewToFront:self.right_button];
- // Do any additional setup after loading the view.
- }
- -(void) dealloc
- {
- CFRelease(self.document);
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- - (IBAction)OnCancelClicked:(id)sender {
-
-
- if(self.no_save|| self.hide_control)
- {
- [self.navigationController popViewControllerAnimated:false];
- return;
- }
- UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Are you sure to cancel the customer ? You will loose all the information you entered." message:nil preferredStyle:UIAlertControllerStyleAlert];
-
- UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
- [self.navigationController popViewControllerAnimated:false];
- }];
- // [alertControl addAction:actionOne];
-
- [alertControl addAction:alertthree];
-
-
- UIAlertAction *alertcancel = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
- }];
- [alertControl addAction:alertcancel];
- //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
-
-
-
-
- [self presentViewController:alertControl animated:YES completion:nil];
- }
- - (IBAction)onSignatureClicked:(id)sender {
-
- // CGRect cellrect_screen = [RAUtils relativeFrameForScreenWithView:trigger];
- //
- //
- // CGRect rect1=[self.view convertRect:cellrect_screen fromView:[[[UIApplication sharedApplication] delegate] window]];
- //
- // DebugLog(@"convert1 %@",NSStringFromCGRect(rect1));
- SignatureListViewController *signatureVC = [ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SignatureListViewController"];
- signatureVC.title=@"Signatures";
- signatureVC.signatureData = self.signatureData;
-
-
- signatureVC.blk_Add = ^()
- {
-
- __block UIImage* signimg=nil;
- SignatureViewController * vc =[ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SignatureViewController"];
-
- vc.onReturnImg = ^(UIImage* img)
- {
-
-
- signimg = img;
-
- // if(signimg!=nil)
- // [PDFUtils addSignature:signimg to:self.signatureData];
-
-
-
-
- };
-
- // orderinfoVC.url_type = URL_REMOTE;
- // orderinfoVC.request_url=URL_CARTDELIVERY;
- //
- // orderinfoVC.params = params;
- //
- // orderinfoVC.delegate=self;
- //
- // if(checked.count==count)
- // {
- // orderinfoVC.have_tail = true
- // }
-
- [self.navigationController pushViewController:vc animated:true];
-
-
-
- };
-
- // signatureVC.blk_Fill =^(NSString* file, bool fillFullDoc)
- // {
- //
- //
- // for(int i=0;i<[self.controlTemplate[@"count"] intValue];i++)
- // {
- // NSMutableDictionary* page =self.controlTemplate[[NSString stringWithFormat:@"page_%d",i]];
- // if(!fillFullDoc && i!=self.current_page)
- // continue;
- // for(int j=0;j<[page[@"count"] intValue];j++)
- // {
- // NSMutableDictionary* control =page[[NSString stringWithFormat:@"control_%d",j]];
- // NSString* type = control[@"type"];
- // if(![type isEqualToString:@"Signature"])
- // continue;
- //
- // control[@"value"]=file;
- //
- //// NSString* name = control[@"aname"];
- //// bool required = [control[@"required"] boolValue];
- ////
- //// if(required==false)
- //// continue;
- //// if([type isEqualToString:@"Check"])
- //// {
- //// NSArray* arr = control[@"value"];
- //// if(arr.count==0)
- //// {
- //// ret=false;
- ////
- //// NSString* msg=[NSString stringWithFormat:@"%u Page %d %@ is missing.",fields.count+1,i+1,name];
- //// if(fields.count<15)
- //// [fields addObject:msg];
- //// else
- //// more++;
- //// }
- ////
- //// }
- //// else if(/*[type isEqualToString:@"Signature"]||*/[type isEqualToString:@"Image"]||[type isEqualToString:@"Label"])
- //// {
- //// continue;
- //// }
- //// else
- //// {
- //// NSString* str = control[@"value"];
- //// if(str.length==0)
- //// {
- //// ret=false;
- //// NSString* msg=[NSString stringWithFormat:@"%lu Page %d %@ is missing.",fields.count+1,i+1,name];
- //// if(fields.count<15)
- //// [fields addObject:msg];
- //// else
- //// more++;
- //// }
- //// }
- // }
- // }
- //
- //
- // // NSString* file_name=[file lastPathComponent];
- ////
- //// NSData* img_data=[ImageUtils load_img:file];
- ////
- //// if(img_data!=nil)
- //// {
- ////
- //// UIImage* image=[UIImage imageWithData:img_data];
- //// touchImageView.image = image;
- ////
- //// long index = touchImageView.tag - CONTROL_BASE;
- //// self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = file;
- ////
- //// }
- //
- // };
-
- UINavigationController * navi = [[UINavigationController alloc] initWithRootViewController:signatureVC];
- navi.modalPresentationStyle=UIModalPresentationPopover;
-
- UIPopoverPresentationController* popPc = navi.popoverPresentationController;
- popPc.permittedArrowDirections = UIPopoverArrowDirectionUp;
- popPc.barButtonItem = sender;
- popPc.delegate = nil;
-
-
-
- [self presentViewController:navi animated:true completion:nil];
-
- //// menu.selector = self.selector;
- ////
- //// menu.selectordelegate = self;
- //
- // // 1.创建一个UIPopover
- // UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:[[UINavigationController alloc] initWithRootViewController:menu]];
- //
- //
- //
- // UIPopoverPresentationController
- // // 2.设置尺寸
- // // popover.popoverContentSize = CGSizeMake(320, 44 * 5);
- //
- // // 3.从哪里显示出来 --> 指向item
- //
- // [popover presentPopoverFromRect:self.view.frame inView:self.view permittedArrowDirections:0 animated:YES];
- // // [popover presentPopoverFromBarButtonItem:item permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
- //
- //// self.popover = popover;
- // popover pop
- //
- // [self performSegueWithIdentifier:@"selector_popover" sender:self];
-
- }
- -(CGRect)WindowRect2PDFRect:(CGRect)rect pdf_rect:(CGRect)pdf_rect window_size:(CGSize)window_size
- {
- CGRect pdf_expand;
- float offset_x = 0;
- float offset_y = 0;
- float scale =1;
- if(pdf_rect.size.height>=pdf_rect.size.width)
- {
- pdf_expand = CGRectMake(0, 0, pdf_rect.size.height*window_size.width/window_size.height, pdf_rect.size.height);
- offset_x = (pdf_expand.size.width-pdf_rect.size.width)/2;
- scale = pdf_rect.size.height/window_size.height;
-
- }
- else
- {
- pdf_expand = CGRectMake(0, 0, pdf_rect.size.width, pdf_rect.size.width*window_size.height/window_size.width);
- offset_y = (pdf_expand.size.height-pdf_rect.size.height)/2;
- scale = pdf_rect.size.width/window_size.width;
- }
- float x=rect.origin.x*scale-offset_x;
- float y=rect.origin.y*scale-offset_y;
- float width = rect.size.width*scale;
- float height = rect.size.height*scale;
-
- return CGRectMake(x, y, width, height);
-
- }
- -(void) EndEditing
- {
-
-
- NSArray* arr =self.pageViewController.viewControllers;
-
- PageViewController *currentViewController = (PageViewController*)self.pageViewController.viewControllers[0];
- // PageViewController *currentViewController = (PageViewController*)self.pageViewController.viewControllers[self.current_page];
- [currentViewController EndEditing];
- }
- - (IBAction)onSaveClicked:(id)sender {
-
- [self EndEditing];
- if(self.no_save)
- {
- [RAUtils message_alert:@"Can not save pending document under offline mode." title:@"Save document" controller:self] ;
- return;
- }
-
- if([self verifyData]==false)
- return;
-
- NSString* pdffile = nil;
- NSString* zipfile = nil;
- NSString* jsonfile = nil;
- // for(int l=0;l<1;l++)
- {
-
- if(self.hide_control)
- {
- pdffile = self.pdfPath;
- }
- else
- {
- pdffile = [PDFUtils SavePDF:self.controlTemplate source:self.document window_rect:CGRectMake(0, 0, 768, 960) name:self.docment_id isnew:self.action==PDFEditActionNew];
- }
-
- zipfile=[RANetwork prepareUploadFile:pdffile json:self.controlTemplate];
-
- //jsonfile = [ACNetwork getjsonPath:zip];
-
- }
-
- __weak typeof(self) weakSelf = self;
- AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
- if(appDelegate.accessMode == AppAccessModeOffline)
- {
-
- NSMutableDictionary * json = [[NSMutableDictionary alloc]init];
-
- json[@"json"]=@"json.json";
- json[@"pdf"]=pdffile.lastPathComponent;
- json[@"zip"]=zipfile.lastPathComponent;
- json[@"serial"]=[json[@"zip"] stringByDeletingPathExtension];
-
-
-
- json[@"create_by"]=appDelegate.user;
-
- json[@"agent_name"]=[self extract_data:@"agent_name"];
- json[@"doc_number"]=[self extract_data:@"doc_number"];
- json[@"job_date"]=[self extract_data:@"job_date"];
- json[@"customer_name"]=[self extract_data:@"customer_name"];
- json[@"signed_date"]=[self extract_data:@"signed_date"];
-
-
-
- NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
- NSMutableArray * arr_pending = [[defaults arrayForKey:@"pending_doc"] mutableCopy];
- if(arr_pending==nil)
- arr_pending = [[NSMutableArray alloc]init];
- [arr_pending addObject:json];
- [defaults setObject:arr_pending forKey:@"pending_doc"];
- [defaults synchronize];
-
-
- [weakSelf.navigationController popViewControllerAnimated:false];
- if(weakSelf.OnSave)
- weakSelf.OnSave(pdffile,@"");
-
- }
- else
- {
- // UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Saving"];
- __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Saving" completion:^{
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-
- NSDictionary* json = nil;
-
-
-
- json = [RANetwork save_document:zipfile isnew:self.action==PDFEditActionNew];
-
- dispatch_async(dispatch_get_main_queue(), ^{
-
-
- // [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
- [waitalert dismissViewControllerAnimated:YES completion:^{
- if([[json valueForKey:@"result"] intValue]==2)
- {
-
-
- [weakSelf.navigationController popViewControllerAnimated:false];
- if(weakSelf.OnSave)
- weakSelf.OnSave(pdffile,json[@"subject"]);
-
-
- }
- else
- {
- // [RAUtils message_alert:[json valueForKey:@"err_msg"] title:@"Save document" controller:self] ;
-
- if(self.hide_control)
- {
- //提交离线合同
- [RAUtils message_alert:@"Can not upload pending documents please try again later." title:@"Save document" controller:self] ;
- return;
- }
-
- UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Create Customer" message:@"Can not create new customer on server, do you want to create an offline document?" preferredStyle:UIAlertControllerStyleAlert];
-
-
- UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
- __block NSString* offline_docnumber =[RANetwork offline_docnumber];
- if(offline_docnumber==nil)
- {
- [RAUtils message_alert:@"Offline document number prefix not found, Please check your user name and make sure you had signed in at least once." title:@"Create Customer" controller:self] ;
- return;
- }
- [appDelegate SwitchToOffline:appDelegate.user];
-
-
- NSMutableDictionary * json = [[NSMutableDictionary alloc]init];
-
- json[@"json"]=@"json.json";
- json[@"pdf"]=pdffile.lastPathComponent;
- json[@"zip"]=zipfile.lastPathComponent;
- json[@"serial"]=[json[@"zip"] stringByDeletingPathExtension];
-
-
-
- json[@"create_by"]=appDelegate.user;
-
-
- json[@"agent_name"]=[self extract_data:@"agent_name"];
- json[@"doc_number"]=[self extract_data:@"doc_number"];
- json[@"job_date"]=[self extract_data:@"job_date"];
- json[@"customer_name"]=[self extract_data:@"customer_name"];
- json[@"signed_date"]=[self extract_data:@"signed_date"];
-
-
-
- NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
- NSMutableArray * arr_pending = [[defaults arrayForKey:@"pending_doc"] mutableCopy];
- if(arr_pending==nil)
- arr_pending = [[NSMutableArray alloc]init];
- [arr_pending addObject:json];
- [defaults setObject:arr_pending forKey:@"pending_doc"];
- [defaults synchronize];
-
-
- [weakSelf.navigationController popViewControllerAnimated:false];
- if(weakSelf.OnSave)
- weakSelf.OnSave(pdffile,@"");
-
-
- }];
-
- UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
- DebugLog(@"Cancel");
- }];
- [alertControl addAction:actionOne];
-
- [alertControl addAction:alertthree];
-
- //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
-
-
- [self presentViewController:alertControl animated:YES completion:nil];
-
- }
- }];
- // if([[logout_json valueForKey:@"result"] intValue]==2)
- // {
- // self.welcomeLabel.text=@"Not sign in";
- // // [sender setTitle:@"Sign in" forState:UIControlStateNormal];
- // [bbitem setTitle:@"Sign in"];
- //
- // self.buttonHIC.enabled = false;
- // self.buttonSRL.enabled = false;
- // self.coverView.hidden = false;
- // }
- // else
- // {
- // [RAUtils message_alert:[logout_json valueForKey:@"err_msg"] title:@"Sign out" controller:self] ;
- // }
-
-
-
-
- });
- });
- }];
-
- }
-
-
-
-
-
-
-
-
- // return;
-
- // {
- //
- //
- // UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Saving"];
- //
- //
- //// self.uploadProgress.progress = 0;
- //
- // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
- //
- //
- // {
- //
- // // UIAlertView * waitalert = [[UIAlertView alloc] initWithTitle:@"wait" message:@"uploading" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil, nil];
- // // [waitalert show];
- //
- //// NSData *imageData = UIImagePNGRepresentation(self.imgview.image);
- //
- // AFHTTPRequestSerializer* serializer=[AFHTTPRequestSerializer serializer] ;
- //
- //
- //
- // NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
- //
- //// if(appDelegate.user!=nil)
- //// [params setValue:appDelegate.user forKey:@"user"];
- //// // if(appDelegate.contact_id!=nil)
- //// // [params setValue:appDelegate.contact_id forKey:@"contactId"];
- //// if(appDelegate.password!=nil)
- //// [params setValue:appDelegate.password forKey:@"password"];
- //
- //
- // [params setValue:[AESCrypt AES128Encrypt:appDelegate.user key:@"usai2010"] forKey:@"user"];
- // [params setValue:[AESCrypt AES128Encrypt:appDelegate.password key:@"usai2010"] forKey:@"password"];
- //
- // [params setValue:@"deviceMain" forKey:@"_operate"];
- //
- //
- // UIDevice * dev = [UIDevice currentDevice];
- // NSUUID* uuid =dev.identifierForVendor;
- //#if TARGET_IPHONE_SIMULATOR//模拟器
- // [params setValue:@"simulator_uuid" forKey:@"deviceid"];
- //#elif TARGET_OS_IPHONE//真机
- // [params setValue:uuid.UUIDString forKey:@"deviceid"];
- //#endif
- //
- //
- //
- // NSMutableString *body=[[NSMutableString alloc]init];
- // //参数的集合的所有key的集合
- // NSArray *keys= [params allKeys];
- // DebugLog(@"================parms==================");
- // //遍历keys
- // for(int i=0;i<[keys count];i++)
- // {
- // //得到当前key
- // NSString *key=[keys objectAtIndex:i];
- // //如果key不是pic,说明value是字符类型,比如name:Boris
- // if(![key isEqualToString:@"pic"])
- // {
- //// //添加分界线,换行
- //// [body appendFormat:@"%@\r\n",MPboundary];
- // //添加字段名称,换2行
- // [body appendFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n",key];
- // //添加字段的值
- // [body appendFormat:@"%@\r\n",[params objectForKey:key]];
- // DebugLog(@"parameter: key=%@ value=%@",key,[params objectForKey:key]);
- // }
- // }
- // DebugLog(@"================parms==================");
- //
- // NSData* data = [NSData dataWithContentsOfFile: zipfile];
- //
- // NSMutableURLRequest *request = [serializer multipartFormRequestWithMethod:@"POST" URLString:URL_UPLOAD_PDF parameters:params constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
- // [formData appendPartWithFileData:data name:@"upfile" fileName:[zipfile lastPathComponent] mimeType:@"application/zip"];
- // } error:nil];
- //
- //
- // // NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:WEBSERVICE_URL parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
- // // [formData appendPartWithFileData:imageData name:@"upfile" fileName:@"test" mimeType:@"image/png"];
- // // } error:nil];
- // //
- // AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
- //
- //
- //
- // //manager.responseSerializer.acceptableContentTypes = [self.operationManager.responseSerializer.acceptableContentTypes setByAddingObject:@"text/html"];
- //
- // //manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
- //
- // //
- // NSProgress *progress = nil;
- //
- // NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithStreamedRequest:request progress:&progress completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
- //
- // // [progress removeObserver:self forKeyPath:@"fractionCompleted"];
- //
- //
- // [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
- //
- // if (error) {
- //
- // NSString* err_msg = [error localizedDescription];
- // DebugLog(@"%@",err_msg);// [self.view updateWithMessage:[NSString stringWithFormat:@"Error : %@!", error.debugDescription]];
- //
- //
- // NSMutableString *str = [[NSMutableString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
- //
- // DebugLog(@"data string: %@",str);
- // [RAUtils message_alert:@"Can not connect to server please try again." title:@"Save document" controller:weakSelf] ;
- //
- // } else {
- // DebugLog(@"response ");
- //
- //
- //
- // NSData *data = [NSJSONSerialization dataWithJSONObject:(NSDictionary*)responseObject options:kNilOptions error:nil];
- //
- // // 再将NSData转为字符串
- // NSString *jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- //
- // // NSMutableString *str = [[NSMutableString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
- //
- // DebugLog(@"data string: %@",jsonStr);
- //
- // NSDictionary* json = responseObject;
- //
- //
- //
- //
- // if([[json valueForKey:@"result"] intValue]==2)
- // {
- //
- // [weakSelf.navigationController popToRootViewControllerAnimated:false];
- ////
- ////
- // if(weakSelf.OnSave)
- // weakSelf.OnSave(pdffile);
- //
- //
- // }
- // else
- // {
- // [RAUtils message_alert:[json valueForKey:@"err_msg"] title:@"Save document" controller:self] ;
- // }
- //
- //
- // }
- // // [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
- // }];
- //
- //
- //
- //
- // // [self.uploadProgress setProgressWithUploadProgressOfTask:uploadTask animated:true];
- // //
- //
- //
- //
- //
- //
- //
- // [uploadTask resume];
- //
- // }
- // }
-
- // [PDFUtils savep
- }
- -(void) addSignature :(UIImage*) img to:(NSMutableDictionary*)signatureData
- {
-
-
- if(true)
- {
- NSString* newfile=[self saveTempSignature:UIImagePNGRepresentation(img)];
-
- int newidx = [self.signatureData[@"count"] intValue];
-
- // [@"file"]= newfile;
-
- NSMutableDictionary* item = [[NSMutableDictionary alloc] init];
- item[@"file"]=newfile;
- signatureData[[NSString stringWithFormat:@"item_%d",newidx]] = item;
- signatureData[@"count"]=[NSNumber numberWithInt:newidx+1];
-
-
-
- }
-
-
-
- }
- -(NSString *) saveTempSignature:(NSData *) image
- {
- NSString* tempDir = NSTemporaryDirectory();
-
- NSString *saveFileName=[NSString stringWithFormat:@"%@.png",[[NSUUID UUID ] UUIDString] ] ;
-
- NSString *newFilePath=[tempDir stringByAppendingPathComponent:saveFileName];
-
-
- bool bsuccess=[image writeToFile:newFilePath atomically:YES];
- if(bsuccess)
- {
- return newFilePath;
- }
- else
- {
- return nil;
- }
- }
- /*
- #pragma mark - Navigation
-
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- - (PageViewController *)viewControllerAtIndex:(NSUInteger)index
- {
- //Return the RAPDFViewController for the given index.
- if ((self.total_page == 0 )|| (index > self.total_page) ) {
- return nil;
- }
-
- //Create a new view controller and pass suitable data.
- // PageViewController *PageViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PageViewController"];
- PageViewController *PageViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"PageViewController"];
-
- PageViewController.pageRef = CGPDFDocumentGetPage (self.document , index+1);
- PageViewController.pageIndex = index;
- PageViewController.hide_control = self.hide_control;
-
- __weak typeof(self) weakSelf = self;
-
- __weak typeof(PageViewController) weakpage = PageViewController;
- PageViewController.chg_Contract =^(NSString* file)
- {
- self.pdfPath = [[NSBundle mainBundle] pathForResource:file ofType:nil];
- // [self indexOfViewController:(PageViewController *)viewController]
- [self setupDocument];
- // PageViewController* pvc= self.pageViewController.viewControllers[0] ;
- NSUInteger index=[self indexOfViewController:weakpage];
- weakpage.pageRef = CGPDFDocumentGetPage (self.document , index+1);
- [weakpage refreshPage];
- return;
-
- };
- PageViewController.blk_Fill = ^(NSString* file,NSString* subtype,bool fillFullDoc)
- {
-
-
- for(int i=0;i<[weakSelf.controlTemplate[@"count"] intValue];i++)
- {
- NSMutableDictionary* page =weakSelf.controlTemplate[[NSString stringWithFormat:@"page_%d",i]];
- if(!fillFullDoc && i!=weakSelf.current_page)
- continue;
- for(int j=0;j<[page[@"count"] intValue];j++)
- {
- NSMutableDictionary* dest =page[[NSString stringWithFormat:@"control_%d",j]];
- NSString* type = dest[@"type"];
- if(![type isEqualToString:@"Signature"])
- continue;
-
- if([dest[@"disable"] boolValue])
- continue;
- if([dest[@"name"] isEqualToString:subtype])
- {
- dest[@"value"]=file;
- }
- }
- }
-
-
- // NSString* file_name=[file lastPathComponent];
- //
- // NSData* img_data=[ImageUtils load_img:file];
- //
- // if(img_data!=nil)
- // {
- //
- // UIImage* image=[UIImage imageWithData:img_data];
- // touchImageView.image = image;
- //
- // long index = touchImageView.tag - CONTROL_BASE;
- // self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = file;
- //
- // }
-
- };
- PageViewController.page_controlTemplate = self.controlTemplate[[NSString stringWithFormat:@"page_%lu",(unsigned long)index]];
- PageViewController.doc_controlTemplate = self.controlTemplate;
- PageViewController.signatureData = self.signatureData;
- //PageViewController.pdfview = [self.pagePDF objectAtIndex:index];
-
- /*
- PageViewController.pdfview = [[PDFView alloc]initWithFrame:self.view.frame atPage:index];
- [PageViewController.view addSubview:PageViewController.pdfview];
- NSLog(@"index = %d",index);
-
-
- */
- return PageViewController;
- }
- - (NSUInteger) indexOfViewController:(PageViewController *)viewController
- {
- return viewController.pageIndex;//[self.pagePDF indexOfObject:viewController.pdfview];
- }
- - (NSString*) extract_data:(NSString*)field_name
- {
- for(int p=0;p<[self.controlTemplate[@"count"] intValue];p++)
- {
- NSDictionary* page=self.controlTemplate[[NSString stringWithFormat:@"page_%d",p]];
- for(int c=0;c<[page[@"count"] intValue];c++)
- {
- NSDictionary* control=page[[NSString stringWithFormat:@"control_%d",c]];
- if([control[@"field"] isEqualToString:field_name])
- {
- return control[@"value"]==nil?@"":control[@"value"];
- }
- }
- }
- return @"";
- }
- #pragma mark verify data
- - (UIView *)createDemoView:(NSString*) msg
- {
- UIView *demoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 290, 200)];
-
- // UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 270, 180)];
- // [imageView setImage:[UIImage imageNamed:@"demo"]];
-
- UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 270, 10)];
- titleLabel.font = [UIFont boldSystemFontOfSize:20];
- titleLabel.text=@"Missing fields:";
- titleLabel.numberOfLines = 0;
- titleLabel.lineBreakMode =NSLineBreakByWordWrapping;
- // titleLabel.textAlignment = NSTextAlignmentRight;
- titleLabel.textAlignment = NSTextAlignmentCenter;
- CGSize constraintkey = CGSizeMake(270, 20000.0f);//key label width is 40% cell width;
- CGSize sizetitle = [@"Missing fields:" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
-
- //[titleLabel sizeToFit];
- // titleLabel.center.x = demoView.center.x;
- titleLabel.frame = CGRectMake(10, 10, 270, sizetitle.height);
- [demoView addSubview:titleLabel];
-
- UILabel *lineLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, titleLabel.frame.origin.y+ titleLabel.frame.size.height+20, 260, 10)];
- lineLabel.font = [UIFont boldSystemFontOfSize:17];
- lineLabel.text=msg;
- lineLabel.numberOfLines = 0;
- lineLabel.lineBreakMode =NSLineBreakByWordWrapping;
-
-
- constraintkey = CGSizeMake(260, 20000.0f);
- CGSize sizemsg = [msg sizeWithFont:[UIFont boldSystemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
-
- lineLabel.frame = CGRectMake(15, titleLabel.frame.origin.y+ titleLabel.frame.size.height+20, 260, sizemsg.height);
- //[lineLabel sizeToFit];
-
- [demoView addSubview:lineLabel];
- demoView.frame = CGRectMake(0, 0, 290, lineLabel.frame.origin.y+lineLabel.frame.size.height+25);
- return demoView;
- }
- -(bool) verifyData
- {
-
- if(NO_SAVE_VERIFY)
- return true;
- // return true;
- bool ret=true;
- int more=0;
- NSMutableArray* fields=[[NSMutableArray alloc] init];
-
- for(int i=0;i<[self.controlTemplate[@"count"] intValue];i++)
- {
- NSMutableDictionary* page =self.controlTemplate[[NSString stringWithFormat:@"page_%d",i]];
- for(int j=0;j<[page[@"count"] intValue];j++)
- {
- NSMutableDictionary* control =page[[NSString stringWithFormat:@"control_%d",j]];
- NSString* type = control[@"type"];
- NSString* name = control[@"aname"];
- bool required = [control[@"required"] boolValue];
-
- if(required==false || [type.lowercaseString isEqualToString:@"ignor"])
- continue;
- if([type isEqualToString:@"Check"])
- {
- NSArray* arr = control[@"value"];
- if(arr.count==0)
- {
- ret=false;
-
- NSString* msg=[NSString stringWithFormat:@"%u. Page %d: %@",fields.count+1,i+1,name];
- if(fields.count<15)
- [fields addObject:msg];
- else
- more++;
- }
-
- }
- else if(/*[type isEqualToString:@"Signature"]||*/[type isEqualToString:@"Image"]||[type isEqualToString:@"Label"])
- {
- continue;
- }
- else
- {
- NSString* str = control[@"value"];
- if(str.length==0)
- {
- ret=false;
- NSString* msg=[NSString stringWithFormat:@"%lu. Page %d: %@",fields.count+1,i+1,name];
- if(fields.count<15)
- [fields addObject:msg];
- else
- more++;
- }
- }
- }
- }
- if(ret==false)
- {
- if(more>0)
- {
- NSString* msg=[NSString stringWithFormat:@"And %d more missing fields.",more];
-
- [fields addObject:@"......"];
- [fields addObject:msg];
- }
- NSString* missfields=[fields componentsJoinedByString:@"\n"];
- NSString* msg = [NSString stringWithFormat:@"%@",missfields];
-
- CustomIOSAlertView *alertView = [[CustomIOSAlertView alloc] init];
-
-
-
-
- // Add some custom content to the alert view
- [alertView setContainerView:[self createDemoView:msg]];
-
- // Modify the parameters
-
-
-
- [alertView setButtonTitles:[NSMutableArray arrayWithObjects:@"OK", nil]];
- //[alertView setDelegate:self];
-
- // You may use a Block, rather than a delegate.
- [alertView setOnButtonTouchUpInside:^(CustomIOSAlertView *alertView, int buttonIndex) {
- // DebugLog(@"Block: Button at position %d is clicked on alertView %d.", buttonIndex, (int)[alertView tag]);
- [alertView close];
- }];
-
- // [alertView setUseMotionEffects:true];
-
- // And launch the dialog
-
- [alertView sizeToFit];
- [alertView show];
-
-
- }
- return ret;
- }
- #pragma mark - Page View Controller Data Source
- - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
- {
- NSUInteger index = [self indexOfViewController:(PageViewController *)viewController];
- if ((index == 0 ) || (index == NSNotFound)){
- return nil;
- }
- // self.current_page= index;
-
- index--;
- return [self viewControllerAtIndex:index];
- }
- - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
- {
- NSUInteger index = [self indexOfViewController:(PageViewController *)viewController];
- if (index == NSNotFound)
- {
- return nil;
- }
- // self.current_page= index;
-
- index++;
-
- if (index == self.total_page){
- return nil;
- }
- return [self viewControllerAtIndex:index];
- }
- #pragma mark - UIPageViewController delegate methods
- - (void)pageViewController:(UIPageViewController *)pageViewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray<UIViewController *> *)previousViewControllers transitionCompleted:(BOOL)completed
- {
- NSLog(@"didFinishAnimating");
-
-
-
- long index=[self indexOfViewController:pageViewController.viewControllers[0]];
- if(index==0)
- self.left_button.hidden=true;
- else
- self.left_button.hidden=false;
-
- if(index==self.total_page-1)
- self.right_button.hidden=true;
- else
- self.right_button.hidden=false;
- // self.title = [NSString stringWithFormat:@"%@ [%ld/%ld]", self.docment_id,((PageViewController*)self.pageViewController.viewControllers[0]).pageIndex+1, self.total_page ];
- }
- - (UIPageViewControllerSpineLocation)pageViewController:(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation:(UIInterfaceOrientation)orientation {
- if (true||UIInterfaceOrientationIsPortrait(orientation) || ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)) {
- // In portrait orientation or on iPhone: Set the spine position to "min" and the page view controller's view controllers array to contain just one view controller. Setting the spine position to 'UIPageViewControllerSpineLocationMid' in landscape orientation sets the doubleSided property to YES, so set it to NO here.
-
- UIViewController *currentViewController = self.pageViewController.viewControllers[0];
- NSArray *viewControllers = @[currentViewController];
-
- __weak typeof(self) weakSelf = self;
- [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:^(BOOL finished){
-
- long index=[weakSelf indexOfViewController:(PageViewController*)currentViewController];
- if(index==0)
- weakSelf.left_button.hidden=true;
- else
- weakSelf.left_button.hidden=false;
-
- if(index==weakSelf.total_page-1)
- weakSelf.right_button.hidden=true;
- else
- weakSelf.right_button.hidden=false;
- }];
-
- self.pageViewController.doubleSided = NO;
- return UIPageViewControllerSpineLocationMin;
- }
-
- // // In landscape orientation: Set set the spine location to "mid" and the page view controller's view controllers array to contain two view controllers. If the current page is even, set it to contain the current and next view controllers; if it is odd, set the array to contain the previous and current view controllers.
- // PageViewController *currentViewController = self.pageViewController.viewControllers[0];
- // NSArray *viewControllers = nil;
- //
- // NSUInteger indexOfCurrentViewController = [self indexOfViewController:currentViewController];
- // if (indexOfCurrentViewController == 0 || indexOfCurrentViewController % 2 == 0) {
- // UIViewController *nextViewController = [self pageViewController:self.pageViewController viewControllerAfterViewController:currentViewController];
- // viewControllers = @[currentViewController, nextViewController];
- // } else {
- // UIViewController *previousViewController = [self pageViewController:self.pageViewController viewControllerBeforeViewController:currentViewController];
- // viewControllers = @[previousViewController, currentViewController];
- // }
- // [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:nil];
- //
- //
- // return UIPageViewControllerSpineLocationMid;
- }
- @end
|