Prechádzať zdrojové kódy

esign 1.80 compatible fix

Ray Zhang 9 mesiacov pred
rodič
commit
6021cb4875

+ 8 - 6
Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj

@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 53;
+	objectVersion = 54;
 	objects = {
 
 /* Begin PBXBuildFile section */
@@ -675,7 +675,7 @@
 			isa = PBXProject;
 			attributes = {
 				BuildIndependentTargetsInParallel = YES;
-				LastUpgradeCheck = 1430;
+				LastUpgradeCheck = 1630;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					7128C23A1E124F4500FF635B = {
@@ -869,8 +869,10 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
 				DEBUG_INFORMATION_FORMAT = dwarf;
+				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
+				ENABLE_USER_SCRIPT_SANDBOXING = YES;
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_NO_COMMON_BLOCKS = YES;
@@ -927,8 +929,10 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				ENABLE_NS_ASSERTIONS = NO;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				ENABLE_USER_SCRIPT_SANDBOXING = YES;
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_NO_COMMON_BLOCKS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -950,14 +954,13 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CURRENT_PROJECT_VERSION = 54100;
-				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "Granite Expo eSign/Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.76;
+				MARKETING_VERSION = 1.80;
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.Granite-Expo-eSign";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
@@ -968,14 +971,13 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CURRENT_PROJECT_VERSION = 54100;
-				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "Granite Expo eSign/Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.76;
+				MARKETING_VERSION = 1.80;
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.Granite-Expo-eSign";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};

+ 158 - 139
Ants Contract/Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m

@@ -722,145 +722,164 @@
 
 
 #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;
-}
+//- (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 sizetitle1 = [@"Missing fields:" sizeWithFont:[UIFont systemFontOfSize:20.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//    
+//    
+//    
+//
+//    CGSize sizetitle = [@"Missing fields:" boundingRectWithSize:constraintkey
+//                             options:NSStringDrawingUsesLineFragmentOrigin| NSStringDrawingUsesFontLeading
+//                             attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20.0]}
+//                             context:nil].size;
+//    
+//    
+//    
+//    //[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 sizemsg1 = [msg sizeWithFont:[UIFont boldSystemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+//    
+//    
+//    
+//    
+//    CGSize sizemsg = [msg boundingRectWithSize:constraintkey
+//                             options:NSStringDrawingUsesLineFragmentOrigin| NSStringDrawingUsesFontLeading
+//                             attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17.0]}
+//                             context:nil].size;
+//    
+//    
+//    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