Răsfoiți Sursa

NEW PROJECT ANTS CONTRACT 1.0

Ray Zhang 9 ani în urmă
părinte
comite
47046bf47c
44 a modificat fișierele cu 2496 adăugiri și 0 ștergeri
  1. 433 0
      Ants Contract/AntsContract/AntsContract.xcodeproj/project.pbxproj
  2. 7 0
      Ants Contract/AntsContract/AntsContract.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  3. 17 0
      Ants Contract/AntsContract/AntsContract/AppDelegate.h
  4. 51 0
      Ants Contract/AntsContract/AntsContract/AppDelegate.m
  5. 53 0
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/AppIcon.appiconset/Contents.json
  6. 6 0
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/Contents.json
  7. 23 0
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/back.imageset/Contents.json
  8. BIN
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/back.imageset/appicon-1.png
  9. BIN
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/back.imageset/appicon-2.png
  10. BIN
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/back.imageset/appicon.png
  11. 23 0
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/clear.imageset/Contents.json
  12. BIN
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/clear.imageset/appicon-1.png
  13. BIN
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/clear.imageset/appicon-2.png
  14. BIN
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/clear.imageset/appicon.png
  15. 23 0
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/save.imageset/Contents.json
  16. BIN
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/save.imageset/appicon-1.png
  17. BIN
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/save.imageset/appicon-2.png
  18. BIN
      Ants Contract/AntsContract/AntsContract/Assets.xcassets/save.imageset/appicon.png
  19. 32 0
      Ants Contract/AntsContract/AntsContract/Base.lproj/LaunchScreen.storyboard
  20. 147 0
      Ants Contract/AntsContract/AntsContract/Base.lproj/Main.storyboard
  21. 18 0
      Ants Contract/AntsContract/AntsContract/DocumentPageViewController.h
  22. 384 0
      Ants Contract/AntsContract/AntsContract/DocumentPageViewController.m
  23. 13 0
      Ants Contract/AntsContract/AntsContract/EditControlView.h
  24. 21 0
      Ants Contract/AntsContract/AntsContract/EditControlView.m
  25. BIN
      Ants Contract/AntsContract/AntsContract/GEIC - Home Improvement Contract 2016.pdf
  26. 39 0
      Ants Contract/AntsContract/AntsContract/Info.plist
  27. 14 0
      Ants Contract/AntsContract/AntsContract/PDFPageView.h
  28. 57 0
      Ants Contract/AntsContract/AntsContract/PDFPageView.m
  29. 13 0
      Ants Contract/AntsContract/AntsContract/PDFScrollView.h
  30. 21 0
      Ants Contract/AntsContract/AntsContract/PDFScrollView.m
  31. 14 0
      Ants Contract/AntsContract/AntsContract/PDFUtils.h
  32. 57 0
      Ants Contract/AntsContract/AntsContract/PDFUtils.m
  33. 28 0
      Ants Contract/AntsContract/AntsContract/PageViewController.h
  34. 422 0
      Ants Contract/AntsContract/AntsContract/PageViewController.m
  35. 15 0
      Ants Contract/AntsContract/AntsContract/RootViewController.h
  36. 51 0
      Ants Contract/AntsContract/AntsContract/RootViewController.m
  37. BIN
      Ants Contract/AntsContract/AntsContract/SUBCONTRACTORS REFERRAL LIST.pdf
  38. 20 0
      Ants Contract/AntsContract/AntsContract/SignatureListViewController.h
  39. 392 0
      Ants Contract/AntsContract/AntsContract/SignatureListViewController.m
  40. 14 0
      Ants Contract/AntsContract/AntsContract/SignatureTableViewCell.h
  41. 24 0
      Ants Contract/AntsContract/AntsContract/SignatureTableViewCell.m
  42. 14 0
      Ants Contract/AntsContract/AntsContract/config.h
  43. 16 0
      Ants Contract/AntsContract/AntsContract/main.m
  44. 34 0
      Ants Contract/AntsContract/AntsContract/testcontrol.json

+ 433 - 0
Ants Contract/AntsContract/AntsContract.xcodeproj/project.pbxproj

@@ -0,0 +1,433 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 46;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		713E83B71E037C2000C4F12A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 713E83B61E037C2000C4F12A /* main.m */; };
+		713E83BA1E037C2000C4F12A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 713E83B91E037C2000C4F12A /* AppDelegate.m */; };
+		713E83BD1E037C2000C4F12A /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 713E83BC1E037C2000C4F12A /* RootViewController.m */; };
+		713E83C01E037C2000C4F12A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 713E83BE1E037C2000C4F12A /* Main.storyboard */; };
+		713E83C21E037C2000C4F12A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 713E83C11E037C2000C4F12A /* Assets.xcassets */; };
+		713E83C51E037C2000C4F12A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 713E83C31E037C2000C4F12A /* LaunchScreen.storyboard */; };
+		713E83CE1E03831C00C4F12A /* PageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 713E83CD1E03831C00C4F12A /* PageViewController.m */; };
+		713E83D11E038C7400C4F12A /* GEIC - Home Improvement Contract 2016.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 713E83D01E038C7400C4F12A /* GEIC - Home Improvement Contract 2016.pdf */; };
+		713E83D41E03926A00C4F12A /* PDFPageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 713E83D31E03926A00C4F12A /* PDFPageView.m */; };
+		713E83D71E03BF8C00C4F12A /* DocumentPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 713E83D61E03BF8C00C4F12A /* DocumentPageViewController.m */; };
+		71D01AC61E0783BD006620CE /* PDFScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AC51E0783BD006620CE /* PDFScrollView.m */; };
+		71D01AC91E07AAB1006620CE /* EditControlView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AC81E07AAB1006620CE /* EditControlView.m */; };
+		71D01ACB1E07AE34006620CE /* testcontrol.json in Resources */ = {isa = PBXBuildFile; fileRef = 71D01ACA1E07AE34006620CE /* testcontrol.json */; };
+		71D01ACD1E07AF10006620CE /* SUBCONTRACTORS REFERRAL LIST.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 71D01ACC1E07AF10006620CE /* SUBCONTRACTORS REFERRAL LIST.pdf */; };
+		71D01AD11E07D1EA006620CE /* SignatureListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AD01E07D1EA006620CE /* SignatureListViewController.m */; };
+		71D01AD41E07D699006620CE /* SignatureTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AD31E07D699006620CE /* SignatureTableViewCell.m */; };
+		71D01ADA1E08CA53006620CE /* SignatureView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AD71E08CA53006620CE /* SignatureView.m */; };
+		71D01ADB1E08CA53006620CE /* SignatureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AD91E08CA53006620CE /* SignatureViewController.m */; };
+		71D01ADF1E08CC81006620CE /* signature.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71D01ADE1E08CC81006620CE /* signature.storyboard */; };
+		71D01AE31E08F5D2006620CE /* TouchImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AE21E08F5D2006620CE /* TouchImageView.m */; };
+		71D01AE61E08FA32006620CE /* PDFUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D01AE51E08FA32006620CE /* PDFUtils.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		713E83B21E037C2000C4F12A /* AntsContract.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AntsContract.app; sourceTree = BUILT_PRODUCTS_DIR; };
+		713E83B61E037C2000C4F12A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+		713E83B81E037C2000C4F12A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+		713E83B91E037C2000C4F12A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+		713E83BB1E037C2000C4F12A /* RootViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = "<group>"; };
+		713E83BC1E037C2000C4F12A /* RootViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = "<group>"; };
+		713E83BF1E037C2000C4F12A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
+		713E83C11E037C2000C4F12A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
+		713E83C41E037C2000C4F12A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
+		713E83C61E037C2000C4F12A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		713E83CC1E03831C00C4F12A /* PageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageViewController.h; sourceTree = "<group>"; };
+		713E83CD1E03831C00C4F12A /* PageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PageViewController.m; sourceTree = "<group>"; };
+		713E83D01E038C7400C4F12A /* GEIC - Home Improvement Contract 2016.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "GEIC - Home Improvement Contract 2016.pdf"; sourceTree = "<group>"; };
+		713E83D21E03926A00C4F12A /* PDFPageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PDFPageView.h; sourceTree = "<group>"; };
+		713E83D31E03926A00C4F12A /* PDFPageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFPageView.m; sourceTree = "<group>"; };
+		713E83D51E03BF8C00C4F12A /* DocumentPageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentPageViewController.h; sourceTree = "<group>"; };
+		713E83D61E03BF8C00C4F12A /* DocumentPageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DocumentPageViewController.m; sourceTree = "<group>"; };
+		71D01AC41E0783BD006620CE /* PDFScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PDFScrollView.h; sourceTree = "<group>"; };
+		71D01AC51E0783BD006620CE /* PDFScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFScrollView.m; sourceTree = "<group>"; };
+		71D01AC71E07AAB1006620CE /* EditControlView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditControlView.h; sourceTree = "<group>"; };
+		71D01AC81E07AAB1006620CE /* EditControlView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditControlView.m; sourceTree = "<group>"; };
+		71D01ACA1E07AE34006620CE /* testcontrol.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = testcontrol.json; sourceTree = "<group>"; };
+		71D01ACC1E07AF10006620CE /* SUBCONTRACTORS REFERRAL LIST.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "SUBCONTRACTORS REFERRAL LIST.pdf"; sourceTree = "<group>"; };
+		71D01ACE1E07B71B006620CE /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
+		71D01ACF1E07D1EA006620CE /* SignatureListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignatureListViewController.h; sourceTree = "<group>"; };
+		71D01AD01E07D1EA006620CE /* SignatureListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignatureListViewController.m; sourceTree = "<group>"; };
+		71D01AD21E07D699006620CE /* SignatureTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignatureTableViewCell.h; sourceTree = "<group>"; };
+		71D01AD31E07D699006620CE /* SignatureTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignatureTableViewCell.m; sourceTree = "<group>"; };
+		71D01AD61E08CA53006620CE /* SignatureView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SignatureView.h; path = "../../../RedAnt ERP Mobile/common/Functions/signature/SignatureView.h"; sourceTree = "<group>"; };
+		71D01AD71E08CA53006620CE /* SignatureView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignatureView.m; path = "../../../RedAnt ERP Mobile/common/Functions/signature/SignatureView.m"; sourceTree = "<group>"; };
+		71D01AD81E08CA53006620CE /* SignatureViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SignatureViewController.h; path = "../../../RedAnt ERP Mobile/common/Functions/signature/SignatureViewController.h"; sourceTree = "<group>"; };
+		71D01AD91E08CA53006620CE /* SignatureViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignatureViewController.m; path = "../../../RedAnt ERP Mobile/common/Functions/signature/SignatureViewController.m"; sourceTree = "<group>"; };
+		71D01ADE1E08CC81006620CE /* signature.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = signature.storyboard; path = "../../../RedAnt ERP Mobile/common/Functions/signature/signature.storyboard"; sourceTree = "<group>"; };
+		71D01AE11E08F5D2006620CE /* TouchImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TouchImageView.h; path = "../../../RedAnt ERP Mobile/common/customUI/TouchImageView.h"; sourceTree = "<group>"; };
+		71D01AE21E08F5D2006620CE /* TouchImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TouchImageView.m; path = "../../../RedAnt ERP Mobile/common/customUI/TouchImageView.m"; sourceTree = "<group>"; };
+		71D01AE41E08FA32006620CE /* PDFUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PDFUtils.h; sourceTree = "<group>"; };
+		71D01AE51E08FA32006620CE /* PDFUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PDFUtils.m; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		713E83AF1E037C2000C4F12A /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		713E83A91E037C2000C4F12A = {
+			isa = PBXGroup;
+			children = (
+				713E83CF1E038C4300C4F12A /* pdf resource */,
+				713E83B41E037C2000C4F12A /* AntsContract */,
+				713E83B31E037C2000C4F12A /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		713E83B31E037C2000C4F12A /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				713E83B21E037C2000C4F12A /* AntsContract.app */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		713E83B41E037C2000C4F12A /* AntsContract */ = {
+			isa = PBXGroup;
+			children = (
+				71D01AE01E08E093006620CE /* pdfEdit */,
+				71D01AD51E08CA35006620CE /* signature */,
+				713E83B81E037C2000C4F12A /* AppDelegate.h */,
+				713E83B91E037C2000C4F12A /* AppDelegate.m */,
+				713E83BB1E037C2000C4F12A /* RootViewController.h */,
+				713E83BC1E037C2000C4F12A /* RootViewController.m */,
+				713E83BE1E037C2000C4F12A /* Main.storyboard */,
+				713E83C11E037C2000C4F12A /* Assets.xcassets */,
+				713E83C31E037C2000C4F12A /* LaunchScreen.storyboard */,
+				713E83C61E037C2000C4F12A /* Info.plist */,
+				713E83B51E037C2000C4F12A /* Supporting Files */,
+				71D01ACE1E07B71B006620CE /* config.h */,
+			);
+			path = AntsContract;
+			sourceTree = "<group>";
+		};
+		713E83B51E037C2000C4F12A /* Supporting Files */ = {
+			isa = PBXGroup;
+			children = (
+				713E83B61E037C2000C4F12A /* main.m */,
+			);
+			name = "Supporting Files";
+			sourceTree = "<group>";
+		};
+		713E83CF1E038C4300C4F12A /* pdf resource */ = {
+			isa = PBXGroup;
+			children = (
+				713E83D01E038C7400C4F12A /* GEIC - Home Improvement Contract 2016.pdf */,
+				71D01ACC1E07AF10006620CE /* SUBCONTRACTORS REFERRAL LIST.pdf */,
+				71D01ACA1E07AE34006620CE /* testcontrol.json */,
+			);
+			name = "pdf resource";
+			path = AntsContract;
+			sourceTree = "<group>";
+		};
+		71D01AD51E08CA35006620CE /* signature */ = {
+			isa = PBXGroup;
+			children = (
+				71D01AD61E08CA53006620CE /* SignatureView.h */,
+				71D01AD71E08CA53006620CE /* SignatureView.m */,
+				71D01AD81E08CA53006620CE /* SignatureViewController.h */,
+				71D01AD91E08CA53006620CE /* SignatureViewController.m */,
+				71D01ADE1E08CC81006620CE /* signature.storyboard */,
+				71D01ACF1E07D1EA006620CE /* SignatureListViewController.h */,
+				71D01AD01E07D1EA006620CE /* SignatureListViewController.m */,
+				71D01AD21E07D699006620CE /* SignatureTableViewCell.h */,
+				71D01AD31E07D699006620CE /* SignatureTableViewCell.m */,
+			);
+			name = signature;
+			sourceTree = "<group>";
+		};
+		71D01AE01E08E093006620CE /* pdfEdit */ = {
+			isa = PBXGroup;
+			children = (
+				71D01AE11E08F5D2006620CE /* TouchImageView.h */,
+				71D01AE21E08F5D2006620CE /* TouchImageView.m */,
+				713E83CC1E03831C00C4F12A /* PageViewController.h */,
+				713E83CD1E03831C00C4F12A /* PageViewController.m */,
+				713E83D51E03BF8C00C4F12A /* DocumentPageViewController.h */,
+				713E83D61E03BF8C00C4F12A /* DocumentPageViewController.m */,
+				71D01AC71E07AAB1006620CE /* EditControlView.h */,
+				71D01AC81E07AAB1006620CE /* EditControlView.m */,
+				713E83D21E03926A00C4F12A /* PDFPageView.h */,
+				713E83D31E03926A00C4F12A /* PDFPageView.m */,
+				71D01AC41E0783BD006620CE /* PDFScrollView.h */,
+				71D01AC51E0783BD006620CE /* PDFScrollView.m */,
+				71D01AE41E08FA32006620CE /* PDFUtils.h */,
+				71D01AE51E08FA32006620CE /* PDFUtils.m */,
+			);
+			name = pdfEdit;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		713E83B11E037C2000C4F12A /* AntsContract */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 713E83C91E037C2000C4F12A /* Build configuration list for PBXNativeTarget "AntsContract" */;
+			buildPhases = (
+				713E83AE1E037C2000C4F12A /* Sources */,
+				713E83AF1E037C2000C4F12A /* Frameworks */,
+				713E83B01E037C2000C4F12A /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = AntsContract;
+			productName = AntsContract;
+			productReference = 713E83B21E037C2000C4F12A /* AntsContract.app */;
+			productType = "com.apple.product-type.application";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		713E83AA1E037C2000C4F12A /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				LastUpgradeCheck = 0820;
+				ORGANIZATIONNAME = "United Software Applications, Inc";
+				TargetAttributes = {
+					713E83B11E037C2000C4F12A = {
+						CreatedOnToolsVersion = 8.1;
+						DevelopmentTeam = HXWLAA5YN5;
+						ProvisioningStyle = Automatic;
+					};
+				};
+			};
+			buildConfigurationList = 713E83AD1E037C2000C4F12A /* Build configuration list for PBXProject "AntsContract" */;
+			compatibilityVersion = "Xcode 3.2";
+			developmentRegion = English;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+				Base,
+			);
+			mainGroup = 713E83A91E037C2000C4F12A;
+			productRefGroup = 713E83B31E037C2000C4F12A /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				713E83B11E037C2000C4F12A /* AntsContract */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		713E83B01E037C2000C4F12A /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				713E83D11E038C7400C4F12A /* GEIC - Home Improvement Contract 2016.pdf in Resources */,
+				713E83C51E037C2000C4F12A /* LaunchScreen.storyboard in Resources */,
+				713E83C21E037C2000C4F12A /* Assets.xcassets in Resources */,
+				71D01ACB1E07AE34006620CE /* testcontrol.json in Resources */,
+				71D01ACD1E07AF10006620CE /* SUBCONTRACTORS REFERRAL LIST.pdf in Resources */,
+				71D01ADF1E08CC81006620CE /* signature.storyboard in Resources */,
+				713E83C01E037C2000C4F12A /* Main.storyboard in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		713E83AE1E037C2000C4F12A /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				713E83BD1E037C2000C4F12A /* RootViewController.m in Sources */,
+				71D01ADB1E08CA53006620CE /* SignatureViewController.m in Sources */,
+				71D01AC61E0783BD006620CE /* PDFScrollView.m in Sources */,
+				71D01AD41E07D699006620CE /* SignatureTableViewCell.m in Sources */,
+				71D01ADA1E08CA53006620CE /* SignatureView.m in Sources */,
+				713E83CE1E03831C00C4F12A /* PageViewController.m in Sources */,
+				71D01AE31E08F5D2006620CE /* TouchImageView.m in Sources */,
+				713E83BA1E037C2000C4F12A /* AppDelegate.m in Sources */,
+				713E83D41E03926A00C4F12A /* PDFPageView.m in Sources */,
+				713E83D71E03BF8C00C4F12A /* DocumentPageViewController.m in Sources */,
+				71D01AE61E08FA32006620CE /* PDFUtils.m in Sources */,
+				71D01AC91E07AAB1006620CE /* EditControlView.m in Sources */,
+				71D01AD11E07D1EA006620CE /* SignatureListViewController.m in Sources */,
+				713E83B71E037C2000C4F12A /* main.m in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+		713E83BE1E037C2000C4F12A /* Main.storyboard */ = {
+			isa = PBXVariantGroup;
+			children = (
+				713E83BF1E037C2000C4F12A /* Base */,
+			);
+			name = Main.storyboard;
+			sourceTree = "<group>";
+		};
+		713E83C31E037C2000C4F12A /* LaunchScreen.storyboard */ = {
+			isa = PBXVariantGroup;
+			children = (
+				713E83C41E037C2000C4F12A /* Base */,
+			);
+			name = LaunchScreen.storyboard;
+			sourceTree = "<group>";
+		};
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+		713E83C71E037C2000C4F12A /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_SUSPICIOUS_MOVES = YES;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				COPY_PHASE_STRIP = NO;
+				DEBUG_INFORMATION_FORMAT = dwarf;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				ENABLE_TESTABILITY = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 10.1;
+				MTL_ENABLE_DEBUG_INFO = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				SDKROOT = iphoneos;
+				TARGETED_DEVICE_FAMILY = 2;
+			};
+			name = Debug;
+		};
+		713E83C81E037C2000C4F12A /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_SUSPICIOUS_MOVES = YES;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				COPY_PHASE_STRIP = NO;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				ENABLE_NS_ASSERTIONS = NO;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 10.1;
+				MTL_ENABLE_DEBUG_INFO = NO;
+				SDKROOT = iphoneos;
+				TARGETED_DEVICE_FAMILY = 2;
+				VALIDATE_PRODUCT = YES;
+			};
+			name = Release;
+		};
+		713E83CA1E037C2000C4F12A /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				DEVELOPMENT_TEAM = HXWLAA5YN5;
+				INFOPLIST_FILE = AntsContract/Info.plist;
+				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+				PRODUCT_BUNDLE_IDENTIFIER = usai.redant.AntsContract;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Debug;
+		};
+		713E83CB1E037C2000C4F12A /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				DEVELOPMENT_TEAM = HXWLAA5YN5;
+				INFOPLIST_FILE = AntsContract/Info.plist;
+				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+				PRODUCT_BUNDLE_IDENTIFIER = usai.redant.AntsContract;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		713E83AD1E037C2000C4F12A /* Build configuration list for PBXProject "AntsContract" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				713E83C71E037C2000C4F12A /* Debug */,
+				713E83C81E037C2000C4F12A /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		713E83C91E037C2000C4F12A /* Build configuration list for PBXNativeTarget "AntsContract" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				713E83CA1E037C2000C4F12A /* Debug */,
+				713E83CB1E037C2000C4F12A /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 713E83AA1E037C2000C4F12A /* Project object */;
+}

+ 7 - 0
Ants Contract/AntsContract/AntsContract.xcodeproj/project.xcworkspace/contents.xcworkspacedata

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:AntsContract.xcodeproj">
+   </FileRef>
+</Workspace>

+ 17 - 0
Ants Contract/AntsContract/AntsContract/AppDelegate.h

@@ -0,0 +1,17 @@
+//
+//  AppDelegate.h
+//  AntsContract
+//
+//  Created by Ray on 12/16/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+
+@end
+

+ 51 - 0
Ants Contract/AntsContract/AntsContract/AppDelegate.m

@@ -0,0 +1,51 @@
+//
+//  AppDelegate.m
+//  AntsContract
+//
+//  Created by Ray on 12/16/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+@interface AppDelegate ()
+
+@end
+
+@implementation AppDelegate
+
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+    // Override point for customization after application launch.
+    return YES;
+}
+
+
+- (void)applicationWillResignActive:(UIApplication *)application {
+    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+    // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
+}
+
+
+- (void)applicationDidEnterBackground:(UIApplication *)application {
+    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+
+- (void)applicationWillEnterForeground:(UIApplication *)application {
+    // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
+}
+
+
+- (void)applicationDidBecomeActive:(UIApplication *)application {
+    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+
+- (void)applicationWillTerminate:(UIApplication *)application {
+    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+
+@end

+ 53 - 0
Ants Contract/AntsContract/AntsContract/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -0,0 +1,53 @@
+{
+  "images" : [
+    {
+      "idiom" : "ipad",
+      "size" : "20x20",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "20x20",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "29x29",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "29x29",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "40x40",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "40x40",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "76x76",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "76x76",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "83.5x83.5",
+      "scale" : "2x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 6 - 0
Ants Contract/AntsContract/AntsContract/Assets.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 23 - 0
Ants Contract/AntsContract/AntsContract/Assets.xcassets/back.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "appicon.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "appicon-1.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "appicon-2.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
Ants Contract/AntsContract/AntsContract/Assets.xcassets/back.imageset/appicon-1.png


BIN
Ants Contract/AntsContract/AntsContract/Assets.xcassets/back.imageset/appicon-2.png


BIN
Ants Contract/AntsContract/AntsContract/Assets.xcassets/back.imageset/appicon.png


+ 23 - 0
Ants Contract/AntsContract/AntsContract/Assets.xcassets/clear.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "appicon.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "appicon-1.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "appicon-2.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
Ants Contract/AntsContract/AntsContract/Assets.xcassets/clear.imageset/appicon-1.png


BIN
Ants Contract/AntsContract/AntsContract/Assets.xcassets/clear.imageset/appicon-2.png


BIN
Ants Contract/AntsContract/AntsContract/Assets.xcassets/clear.imageset/appicon.png


+ 23 - 0
Ants Contract/AntsContract/AntsContract/Assets.xcassets/save.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "appicon.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "appicon-1.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "appicon-2.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
Ants Contract/AntsContract/AntsContract/Assets.xcassets/save.imageset/appicon-1.png


BIN
Ants Contract/AntsContract/AntsContract/Assets.xcassets/save.imageset/appicon-2.png


BIN
Ants Contract/AntsContract/AntsContract/Assets.xcassets/save.imageset/appicon.png


+ 32 - 0
Ants Contract/AntsContract/AntsContract/Base.lproj/LaunchScreen.storyboard

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1212" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
+    <device id="ipad9_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--View Controller-->
+        <scene sceneID="EHf-IW-A2E">
+            <objects>
+                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
+                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="67.840000000000003" y="640"/>
+        </scene>
+    </scenes>
+    <simulatedMetricsContainer key="defaultSimulatedMetrics">
+        <simulatedStatusBarMetrics key="statusBar"/>
+        <simulatedOrientationMetrics key="orientation"/>
+        <simulatedScreenMetrics key="destination"/>
+    </simulatedMetricsContainer>
+</document>

+ 147 - 0
Ants Contract/AntsContract/AntsContract/Base.lproj/Main.storyboard

@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1212" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" colorMatched="YES" initialViewController="UmP-Fl-ZUI">
+    <device id="ipad9_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <capability name="Navigation items with more than one left or right bar item" minToolsVersion="7.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--Root View Controller-->
+        <scene sceneID="tne-QT-ifu">
+            <objects>
+                <viewController storyboardIdentifier="RootViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="RootViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
+                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="eWa-Ek-92w">
+                                <rect key="frame" x="330" y="277" width="108" height="108"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+                                <state key="normal" title="New Contract"/>
+                                <connections>
+                                    <action selector="OnNewDocumentClick:" destination="BYZ-38-t0r" eventType="touchUpInside" id="0iM-XN-hZ5"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </view>
+                    <toolbarItems/>
+                    <navigationItem key="navigationItem" id="jyF-zF-Kd8">
+                        <leftBarButtonItems>
+                            <barButtonItem title="My Profile" id="MBI-XO-CWe"/>
+                            <barButtonItem title="My signature" id="k1N-Xx-pxQ"/>
+                        </leftBarButtonItems>
+                        <barButtonItem key="rightBarButtonItem" title="Sign in" id="A9f-vj-ZDF"/>
+                    </navigationItem>
+                    <simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="432" y="-62.000000000000007"/>
+        </scene>
+        <!--Navigation Controller-->
+        <scene sceneID="SA2-sQ-7bL">
+            <objects>
+                <navigationController id="UmP-Fl-ZUI" sceneMemberID="viewController">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="LkL-0D-hsA">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </navigationBar>
+                    <connections>
+                        <segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="zcA-GR-eLk"/>
+                    </connections>
+                </navigationController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="Uec-R7-eKD" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-576" y="-61.440000000000005"/>
+        </scene>
+        <!--Page View Controller-->
+        <scene sceneID="9YD-lb-QfP">
+            <objects>
+                <viewController storyboardIdentifier="PageViewController" id="e1o-QP-z2F" customClass="PageViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="BEc-Ba-Mzk">
+                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" maximumZoomScale="3" id="UZY-AP-7MO" customClass="PDFScrollView">
+                                <rect key="frame" x="0.0" y="64" width="768" height="960"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
+                                <subviews>
+                                    <view tag="1024" contentMode="scaleToFill" misplaced="YES" id="Iyx-2L-Lrz">
+                                        <rect key="frame" x="0.0" y="0.0" width="768" height="960"/>
+                                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
+                                        <subviews>
+                                            <view contentMode="scaleToFill" id="8Hw-OZ-rsH" customClass="PDFPageView">
+                                                <rect key="frame" x="0.0" y="0.0" width="768" height="960"/>
+                                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
+                                                <color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                                            </view>
+                                            <view contentMode="scaleToFill" id="wPo-qh-F4Q" customClass="EditControlView">
+                                                <rect key="frame" x="0.0" y="0.0" width="768" height="960"/>
+                                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
+                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+                                            </view>
+                                        </subviews>
+                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                    </view>
+                                </subviews>
+                                <color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <connections>
+                                    <outlet property="delegate" destination="e1o-QP-z2F" id="CgE-j3-5MJ"/>
+                                </connections>
+                            </scrollView>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    </view>
+                    <toolbarItems/>
+                    <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
+                    <connections>
+                        <outlet property="editControlView" destination="wPo-qh-F4Q" id="7Pl-zR-eDR"/>
+                        <outlet property="pdfPageView" destination="8Hw-OZ-rsH" id="xWX-ds-e1V"/>
+                        <outlet property="pdfScrollView" destination="UZY-AP-7MO" id="Xi7-dU-KwC"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="BVq-qN-ZJg" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="2373" y="-62"/>
+        </scene>
+        <!--Title-->
+        <scene sceneID="8dr-IV-sOm">
+            <objects>
+                <viewController storyboardIdentifier="DocumentPageViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="UPd-uT-cg4" customClass="DocumentPageViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="L77-lK-1UM">
+                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    </view>
+                    <navigationItem key="navigationItem" title="Title" id="ToF-qy-nGL">
+                        <rightBarButtonItems>
+                            <barButtonItem systemItem="save" id="HzA-Fa-ToQ">
+                                <connections>
+                                    <action selector="onSaveClicked:" destination="UPd-uT-cg4" id="pM2-zX-RdY"/>
+                                </connections>
+                            </barButtonItem>
+                            <barButtonItem systemItem="compose" id="ucD-3L-oIm">
+                                <connections>
+                                    <action selector="onSignatureClicked:" destination="UPd-uT-cg4" id="4H2-S3-gQB"/>
+                                </connections>
+                            </barButtonItem>
+                        </rightBarButtonItems>
+                    </navigationItem>
+                    <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="8TC-Iz-v3r" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="1456.6400000000001" y="-61.440000000000005"/>
+        </scene>
+    </scenes>
+    <simulatedMetricsContainer key="defaultSimulatedMetrics">
+        <simulatedStatusBarMetrics key="statusBar"/>
+        <simulatedOrientationMetrics key="orientation"/>
+        <simulatedScreenMetrics key="destination"/>
+    </simulatedMetricsContainer>
+</document>

+ 18 - 0
Ants Contract/AntsContract/AntsContract/DocumentPageViewController.h

@@ -0,0 +1,18 @@
+//
+//  DocumentPageViewController.h
+//  AntsContract
+//
+//  Created by Ray on 12/16/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface DocumentPageViewController : UIViewController <UIPageViewControllerDelegate , UIPageViewControllerDataSource>
+
+@property (strong, nonatomic) UIPageViewController *pageViewController;
+@property (strong, nonatomic) NSMutableDictionary * controlTemplate;
+@property size_t total_page;
+@property CGPDFDocumentRef document;
+@property (strong, nonatomic) NSMutableDictionary* signatureData;
+@end

+ 384 - 0
Ants Contract/AntsContract/AntsContract/DocumentPageViewController.m

@@ -0,0 +1,384 @@
+//
+//  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"
+
+@interface DocumentPageViewController ()
+
+@end
+
+@implementation DocumentPageViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    
+    //    self.delegate = self;
+    //    self.dataSource = self;
+    
+    
+    self.signatureData= [[NSMutableDictionary alloc] init];
+    
+    
+    self.document = [self OpenPDF:@"SUBCONTRACTORS REFERRAL LIST.pdf"];
+    
+    self.controlTemplate = [self loadControl];
+    
+    
+    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];
+    [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];
+    
+    // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+- (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];
+                //[self addSignature:signimg];
+                
+            
+            
+        };
+        //    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];
+        
+        
+        
+    };
+    
+    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];
+    
+}
+- (IBAction)onSaveClicked:(id)sender {
+}
+
+-(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 PDFViewController 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.pageRef =  CGPDFDocumentGetPage (self.document , index+1);
+    PageViewController.pageIndex = index;
+    
+    ;
+    PageViewController.controlTemplate = self.controlTemplate[[NSString stringWithFormat:@"page_%lu",(unsigned long)index]];
+    
+    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];
+}
+-(NSMutableDictionary*) loadControl{
+    NSString *path = [[NSBundle mainBundle] pathForResource:@"testcontrol.json" ofType:nil];
+    NSData *data = [NSData dataWithContentsOfFile:path];
+    NSMutableDictionary *ret = [[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+    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;
+    }
+    
+    index--;
+    return  [self viewControllerAtIndex:index];
+}
+
+- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
+{
+    NSUInteger index = [self indexOfViewController:(PageViewController *)viewController];
+    if (index == NSNotFound)
+    {
+        return nil;
+    }
+    
+    index++;
+    
+    if (index == self.total_page){
+        return  nil;
+    }
+    
+    return [self viewControllerAtIndex:index];
+}
+
+
+#pragma mark - UIPageViewController delegate methods
+- (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];
+        [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:nil];
+        
+        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;
+}
+#pragma mark pdf utils
+
+-(CGPDFDocumentRef)OpenPDF:(NSString*) template
+{
+    //获取路径
+    /*
+     NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);//坐标
+     
+     NSString *saveDirectory=[paths objectAtIndex:0];
+     
+     NSString *saveFileName=@"myPDF.pdf";
+     
+     NSString *newFilePath=[saveDirectory stringByAppendingPathComponent:saveFileName];
+     */
+    
+    NSString *default_path = [[NSBundle mainBundle] pathForResource:template ofType:nil];
+    const char *filename=[default_path UTF8String];
+    
+    NSLog(@"%@",default_path);
+    
+    //关联上下文的对象
+    
+    //   CGContextRef pdfContext;
+    
+    CFStringRef path;
+    
+    CFURLRef url;
+    
+    path=CFStringCreateWithCString(NULL, filename, kCFStringEncodingUTF8);
+    
+    url=CFURLCreateWithFileSystemPath(NULL, path, kCFURLPOSIXPathStyle, 0);
+    
+    CGPDFDocumentRef document;
+    document = CGPDFDocumentCreateWithURL (url);
+    CFRelease(url);
+    self.total_page = CGPDFDocumentGetNumberOfPages (document);
+    
+    if (self.total_page == 0) {
+        printf("[%s] needs at least one page!\n", [@"myPDF.pdf" UTF8String] );
+        return NULL;
+    } else {
+        printf("[%ld] pages loaded in this PDF!\n", self.total_page);
+        
+        
+        /*8
+         for (NSInteger pageNumber = 1; pageNumber <= count; pageNumber++)
+         {
+         CGPDFPageRef pageRef = CGPDFDocumentGetPage(document, pageNumber);
+         
+         CGPDFDictionaryRef pageDictionaryFromPage = CGPDFPageGetDictionary(pageRef);
+         
+         if (pageDictionaryFromPage == pageDictionaryFromDestArray) // Found it
+         {
+         targetPageNumber = pageNumber; break;
+         }
+         
+         
+         }*/
+    }
+    
+    //    CGPDFPageRef page= CGPDFDocumentGetPage(document, 0);
+    //    CGContextDrawPDFPage(<#CGContextRef  _Nullable c#>, <#CGPDFPageRef  _Nullable page#>)
+    
+    return document;
+    
+    
+    
+}
+@end

+ 13 - 0
Ants Contract/AntsContract/AntsContract/EditControlView.h

@@ -0,0 +1,13 @@
+//
+//  EditControlView.h
+//  AntsContract
+//
+//  Created by Ray on 12/19/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface EditControlView : UIView
+
+@end

+ 21 - 0
Ants Contract/AntsContract/AntsContract/EditControlView.m

@@ -0,0 +1,21 @@
+//
+//  EditControlView.m
+//  AntsContract
+//
+//  Created by Ray on 12/19/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "EditControlView.h"
+
+@implementation EditControlView
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

BIN
Ants Contract/AntsContract/AntsContract/GEIC - Home Improvement Contract 2016.pdf


+ 39 - 0
Ants Contract/AntsContract/AntsContract/Info.plist

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>$(PRODUCT_NAME)</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+	<key>LSRequiresIPhoneOS</key>
+	<true/>
+	<key>UILaunchStoryboardName</key>
+	<string>LaunchScreen</string>
+	<key>UIMainStoryboardFile</key>
+	<string>Main</string>
+	<key>UIRequiredDeviceCapabilities</key>
+	<array>
+		<string>armv7</string>
+	</array>
+	<key>UISupportedInterfaceOrientations~ipad</key>
+	<array>
+		<string>UIInterfaceOrientationPortrait</string>
+		<string>UIInterfaceOrientationPortraitUpsideDown</string>
+		<string>UIInterfaceOrientationLandscapeLeft</string>
+		<string>UIInterfaceOrientationLandscapeRight</string>
+	</array>
+</dict>
+</plist>

+ 14 - 0
Ants Contract/AntsContract/AntsContract/PDFPageView.h

@@ -0,0 +1,14 @@
+//
+//  PDFPageView.h
+//  AntsContract
+//
+//  Created by Ray on 12/16/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface PDFPageView : UIView
+@property size_t pageIndex;
+@property CGPDFPageRef pageRef;
+@end

+ 57 - 0
Ants Contract/AntsContract/AntsContract/PDFPageView.m

@@ -0,0 +1,57 @@
+//
+//  PDFPageView.m
+//  AntsContract
+//
+//  Created by Ray on 12/16/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "PDFPageView.h"
+
+@implementation PDFPageView
+
+
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+    
+            //CGPDFDocumentRef document = [self OpenPDF:@"GEIC - Home Improvement Contract 2016.pdf"];
+    
+    
+    
+
+
+    
+        CGContextRef context = UIGraphicsGetCurrentContext();
+    
+    [self MyDisplayPDFPage:context index:self.pageIndex file:@"GEIC - Home Improvement Contract 2016.pdf"];
+}
+
+
+
+-(void) MyDisplayPDFPage:(CGContextRef) myContext index:(size_t)pageNumber file:(NSString*) filename//(,  , const char *filename)
+{
+   // CGPDFDocumentRef document;
+    CGPDFPageRef page = self.pageRef;
+ //   document = [self OpenPDF:filename];                                   // 1 创建PDFDocument对象
+  //  page = CGPDFDocumentGetPage (document, pageNumber);           // 2 获取指定页的PDF文档
+    
+    
+    CGAffineTransform m;
+    m = CGPDFPageGetDrawingTransform (page, kCGPDFCropBox, self.bounds, -180, true);
+    CGContextSaveGState (myContext);
+    
+    CGContextTranslateCTM(myContext, 80, self.frame.size.height);
+    CGContextScaleCTM(myContext, 1, -1);
+    
+ //   CGContextConcatCTM (myContext, m);
+  //  CGContextClipToRect (myContext,CGPDFPageGetBoxRect (page, kCGPDFCropBox));
+    CGContextDrawPDFPage (myContext, page);
+    CGContextRestoreGState (myContext);
+    
+    
+  //  CGContextDrawPDFPage (myContext, page);                                       // 3 将PDF绘制到图形上下文中
+//    CGPDFDocumentRelease (document);
+}
+@end

+ 13 - 0
Ants Contract/AntsContract/AntsContract/PDFScrollView.h

@@ -0,0 +1,13 @@
+//
+//  PDFScrollView.h
+//  AntsContract
+//
+//  Created by Ray on 12/19/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface PDFScrollView : UIScrollView
+
+@end

+ 21 - 0
Ants Contract/AntsContract/AntsContract/PDFScrollView.m

@@ -0,0 +1,21 @@
+//
+//  PDFScrollView.m
+//  AntsContract
+//
+//  Created by Ray on 12/19/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "PDFScrollView.h"
+
+@implementation PDFScrollView
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 14 - 0
Ants Contract/AntsContract/AntsContract/PDFUtils.h

@@ -0,0 +1,14 @@
+//
+//  PDFUtils.h
+//  AntsContract
+//
+//  Created by Ray on 12/20/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+@interface PDFUtils : NSObject
++(void) addSignature :(UIImage*) img to:(NSMutableDictionary*)signatureData;
++(NSString *) saveTempSignature:(NSData *) image;
+@end

+ 57 - 0
Ants Contract/AntsContract/AntsContract/PDFUtils.m

@@ -0,0 +1,57 @@
+//
+//  PDFUtils.m
+//  AntsContract
+//
+//  Created by Ray on 12/20/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "PDFUtils.h"
+
+@implementation PDFUtils
++(void) addSignature :(UIImage*) img to:(NSMutableDictionary*)signatureData
+{
+    
+    
+    if(true)
+    {
+        NSString* newfile=[self saveTempSignature:UIImagePNGRepresentation(img)];
+        
+        int newidx = [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;
+    }
+    
+}
+@end

+ 28 - 0
Ants Contract/AntsContract/AntsContract/PageViewController.h

@@ -0,0 +1,28 @@
+//
+//  DocumentViewController.h
+//  AntsContract
+//
+//  Created by Ray on 12/16/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "PDFPageView.h"
+#import "PDFScrollView.h"
+#import "EditControlView.h"
+#import "TouchImageView.h"
+
+@interface PageViewController : UIViewController<UITextViewDelegate,TouchImageViewDelegate>
+
+@property (strong, nonatomic) IBOutlet PDFPageView *pdfPageView;
+@property (strong, nonatomic) IBOutlet EditControlView *editControlView;
+@property size_t pageIndex;
+@property CGPDFPageRef pageRef;
+@property (strong, nonatomic) IBOutlet PDFScrollView *pdfScrollView;
+
+
+
+@property (strong, nonatomic) NSMutableDictionary * controlTemplate;
+
+@property (strong, nonatomic) NSMutableDictionary * signatureData;
+@end

+ 422 - 0
Ants Contract/AntsContract/AntsContract/PageViewController.m

@@ -0,0 +1,422 @@
+//
+//  DocumentViewController.m
+//  AntsContract
+//
+//  Created by Ray on 12/16/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "PageViewController.h"
+
+#import "config.h"
+
+#import "SignatureListViewController.h"
+#import "SignatureViewController.h"
+#import "PDFUtils.h"
+
+//#import "TouchImageView.h"
+@interface PageViewController ()
+
+@end
+
+@implementation PageViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    //   self.pageIndex=1;
+    
+    // self.pdfPageView.pageIndex=self.pageIndex;
+    self.pdfPageView.pageRef= self.pageRef;
+    
+    [self initControl];
+    
+    //    UIPinchGestureRecognizer *pinchGestureRecognizer = [[UIPinchGestureRecognizer alloc]
+    //                                                        initWithTarget:self
+    //                                                        action:@selector(handlePinch:)];
+    //
+    //    [self.view addGestureRecognizer:pinchGestureRecognizer];
+    
+    // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+//- (void) handlePinch:(UIPinchGestureRecognizer*) recognizer
+//{
+////    recognizer.view.transform = CGAffineTransformScale(recognizer.view.transform, recognizer.scale, recognizer.scale);
+////    recognizer.scale = 1;
+//
+//    CGSize contentsize =self.pdfScrollView.contentSize;
+//
+//    self.pdfScrollView.contentSize = CGSizeMake(contentsize.width*recognizer.scale, contentsize.height*recognizer.scale);
+//}
+
+
+-(void) initControl
+{
+    int count = [self.controlTemplate[@"count"] intValue];
+    for(int i=0;i<count;i++)
+    {
+        NSMutableDictionary * control =self.controlTemplate [[NSString stringWithFormat:@"control_%d",i] ];
+        if([control[@"type"] isEqualToString:@"TextView"])
+        {
+            [self addTextView:control destView:self.editControlView];
+        }
+        else if([control[@"type"] isEqualToString:@"Button"])
+        {
+            [self addButton:control destView:self.editControlView];
+            
+        }
+        else if([control[@"type"] isEqualToString:@"Signature"])
+        {
+            [self addSignatureButton:control destView:self.editControlView];
+            
+        }
+    }
+    
+}
+#pragma mark add controls
+-(void) addTextView:(NSMutableDictionary*) template destView:(UIView*)destView
+{
+    UITextView* tv = [[UITextView alloc] initWithFrame:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue])];
+    [tv setFont:[UIFont boldSystemFontOfSize:20.0f]];
+    //    tv.place
+    //    [btn setTitle:template[@"title"] forState:UIControlStateNormal];
+    //    ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged
+    
+    
+    tv.delegate = self;
+    //    [btn addTarget:self action:@selector(ControlButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
+    if(DEBUG_PDFSIG)
+    {
+        tv.backgroundColor = [UIColor lightGrayColor];
+        
+        // [btn setBackgroundImage:[UIColor grayColor] forState:UIControlStateNormal];
+    }
+    [destView addSubview:tv];
+}
+-(void) addButton:(NSMutableDictionary*) template destView:(UIView*)destView
+{
+    UIButton* btn = [[UIButton alloc] initWithFrame:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue])];
+    [btn setTitle:template[@"title"] forState:UIControlStateNormal];
+    //    ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged
+    
+    [btn addTarget:self action:@selector(ControlButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
+    if(DEBUG_PDFSIG)
+    {
+        btn.backgroundColor = [UIColor lightGrayColor];
+        
+        // [btn setBackgroundImage:[UIColor grayColor] forState:UIControlStateNormal];
+    }
+    [destView addSubview:btn];
+}
+-(void) addSignatureButton:(NSMutableDictionary*) template destView:(UIView*)destView
+{
+    TouchImageView* btn = [[TouchImageView alloc] initWithFrame:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue])];
+    
+    btn.contentMode = UIViewContentModeScaleAspectFit;
+    btn.delegate = self;
+    btn.layer.borderColor = [UIColor clearColor].CGColor;
+    btn.layer.borderWidth = 0;
+    
+    if(DEBUG_PDFSIG)
+    {
+        btn.backgroundColor = [UIColor lightGrayColor];
+        
+        // [btn setBackgroundImage:[UIColor grayColor] forState:UIControlStateNormal];
+    }
+    [destView addSubview:btn];
+}
+
+#pragma mark UIScrollView delegate
+
+- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
+    
+    
+    UIView *subView = [scrollView viewWithTag:1024];
+    return subView;
+    
+}
+//- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
+//
+//
+//
+//}
+#pragma mark Button Click
+- (void)ControlButtonClicked:(UIButton *)sender {
+    //    DebugLog(@"cart sort button clicked");
+    
+    NSLog(@"button clicked;");
+    //    [self.view addSubview:self.sortItemController.view];
+}
+//- (void)SignatureButtonClicked:(UIButton *)sender {
+//    //    DebugLog(@"cart sort button clicked");
+//
+//    NSLog(@"signature button clicked;");
+//
+//
+//    {
+//
+//        //    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)
+////                    [self addSignature:signimg];
+//
+//
+//            };
+//            //    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];
+//
+//
+//
+//        };
+//
+//        UINavigationController * navi = [[UINavigationController alloc] initWithRootViewController:signatureVC];
+//        navi.modalPresentationStyle=UIModalPresentationPopover;
+//
+//        UIPopoverPresentationController* popPc = navi.popoverPresentationController;
+//        popPc.permittedArrowDirections = UIPopoverArrowDirectionAny;
+//        popPc.sourceView = 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];
+//
+//    }
+//    //    [self.view addSubview:self.sortItemController.view];
+//}
+#pragma mark TextViewDelegate
+- (void)textViewDidEndEditing:(UITextView *)textView
+{
+    //[self update_newprice];
+}
+/*
+ #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.
+ }
+ */
+#pragma mark signature clicked 
+//touchimageview Delegate
+- (void)TouchImageViewOnTouche:(TouchImageView *)touchImageView
+{
+    
+    NSLog(@"signature button clicked;");
+    
+    
+    {
+        
+        //    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.imageView = touchImageView;
+        
+        signatureVC.blk_Select =^(UIImage* img)
+        {
+            touchImageView.image = img;
+        };
+        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];
+                    touchImageView.image = signimg;
+                }
+                
+                
+            };
+            //    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];
+            
+            
+            
+        };
+        
+        UINavigationController * navi = [[UINavigationController alloc] initWithRootViewController:signatureVC];
+        navi.modalPresentationStyle=UIModalPresentationPopover;
+        
+        UIPopoverPresentationController* popPc = navi.popoverPresentationController;
+        popPc.permittedArrowDirections = UIPopoverArrowDirectionAny;
+        popPc.sourceView = touchImageView;
+        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];
+        
+    }
+    //    __block int tag = touchImageView.tag;
+    //    UIViewController* vc=[RAUtils getViewController :touchImageView];
+    //
+    //    if(self.editable==true)
+    //    {
+    //
+    //
+    //        ImageUploadViewController * uploadvc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"ImageUploadViewController"];
+    //
+    //        //        UIImage* img =[self.buttonImg backgroundImageForState:UIControlStateNormal];;
+    //
+    //        if(self.img_validate)
+    //            uploadvc.img= touchImageView.image;
+    //
+    //        uploadvc.returnValue = ^(NSString* url_down,NSString* url_up,UIImage* img)
+    //        {
+    //
+    //            self.imgs[tag] = url_up;
+    //
+    //            NSString* newurl=[RAUtils arr2string:self.imgs separator:@"," trim:false];
+    //
+    //            touchImageView.image=img;
+    //
+    //            if(self.imgChanged)
+    //                self.imgChanged(url_down,newurl,tag,url_up);
+    //
+    //        };
+    //
+    //        [vc.navigationController pushViewController:uploadvc animated:false];
+    //    }
+    //    else
+    //    {
+    //        if(touchImageView.image==nil)
+    //            return ;
+    //        ImageViewController * imagevc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"ImageViewController"];
+    //
+    //
+    //        UIImage* img=touchImageView.image;
+    //
+    //        if(self.img_validate)
+    //            imagevc.image = img;//.imageView.image = [self.buttonImg backgroundImageForState:UIControlStateNormal];
+    //
+    //        //        uploadvc.returnValue = ^(NSString* url_down,NSString* url_up,UIImage* img)
+    //        //        {
+    //        //
+    //        //            [self.buttonImg setBackgroundImage:img forState:UIControlStateNormal];
+    //        //
+    //        //            if(self.imgChanged)
+    //        //                self.imgChanged(url_down,url_up);
+    //        //
+    //        //        };
+    //        
+    //        [vc.navigationController pushViewController:imagevc animated:false];
+    //    }
+    //    //    bundleVC.content_data = self.bundle_item;
+    //    
+    
+}
+
+
+
+@end

+ 15 - 0
Ants Contract/AntsContract/AntsContract/RootViewController.h

@@ -0,0 +1,15 @@
+//
+//  ViewController.h
+//  AntsContract
+//
+//  Created by Ray on 12/16/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface RootViewController : UIViewController
+
+
+@end
+

+ 51 - 0
Ants Contract/AntsContract/AntsContract/RootViewController.m

@@ -0,0 +1,51 @@
+//
+//  ViewController.m
+//  AntsContract
+//
+//  Created by Ray on 12/16/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "RootViewController.h"
+#import "DocumentPageViewController.h"
+
+@interface RootViewController ()
+
+@end
+
+@implementation RootViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view, typically from a nib.
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+- (IBAction)OnNewDocumentClick:(id)sender {
+    
+    
+    
+
+    
+    DocumentPageViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"DocumentPageViewController" ];
+    
+   // dvc.pageIndex=0;
+    //            dvc
+/*
+    dvc.product_id=product_id;
+    dvc.category_id=nil;
+    dvc.ispush=true;
+ 
+    
+    [dvc reload];*/
+    [self.navigationController pushViewController:dvc animated:true];
+}
+
+
+
+@end

BIN
Ants Contract/AntsContract/AntsContract/SUBCONTRACTORS REFERRAL LIST.pdf


+ 20 - 0
Ants Contract/AntsContract/AntsContract/SignatureListViewController.h

@@ -0,0 +1,20 @@
+//
+//  SignatureListViewController.h
+//  AntsContract
+//
+//  Created by Ray on 12/19/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface SignatureListViewController : UIViewController
+
+@property (strong, nonatomic) IBOutlet UITableView *tableView;
+
+@property (strong, nonatomic) NSMutableDictionary* signatureData;
+
+//@property (strong, nonatomic)  UIImageView *imageView;
+@property (nonatomic , copy) void (^blk_Add)();
+@property (nonatomic , copy) void (^blk_Select)(UIImage* image);
+@end

+ 392 - 0
Ants Contract/AntsContract/AntsContract/SignatureListViewController.m

@@ -0,0 +1,392 @@
+//
+//  SignatureListViewController.m
+//  AntsContract
+//
+//  Created by Ray on 12/19/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "SignatureListViewController.h"
+#import "SignatureTableViewCell.h"
+
+@interface SignatureListViewController ()
+
+@end
+
+@implementation SignatureListViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+- (IBAction)onAddClick:(id)sender {
+    
+    
+    [self dismissViewControllerAnimated:false completion:^{
+        
+        
+        if(self.blk_Add)
+            self.blk_Add();
+        
+     }];
+    
+
+    
+}
+
+/*
+#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.
+}
+*/
+
+
+#pragma mark - Table view data source
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
+{
+    //     NSDictionary * item_json = [self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]];
+    //    if([item_json objectForKey:@"combine"] == nil)
+    //    {
+    //        return 120;
+    //    }
+    //    else
+    //        return 150;
+    
+    
+    return 128;
+
+    
+}
+
+//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
+//{
+//    return 0;
+//}
+//- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
+//{
+//    return 0;
+//}
+//- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
+//{
+//        UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+//    return myView;
+//
+//}
+
+//- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
+//{
+//    UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+////    myView.backgroundColor = [UIColor colorWithRed:0.10 green:0.68 blue:0.94 alpha:0.7];
+////    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 90, 22)];
+////    titleLabel.textColor=[UIColor whiteColor];
+////    titleLabel.backgroundColor = [UIColor clearColor];
+////    if(section==0)
+////        titleLabel.text=NSLocalizedString(@"display_items", nil);
+////    else
+////        titleLabel.text=NSLocalizedString(@"hide_items", nil);
+////    [titleLabel sizeToFit];
+////    [myView addSubview:titleLabel];
+////
+//    return myView;
+//}
+//
+
+//- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
+//{
+//    
+//    
+//    NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
+//    
+//    if(value==nil)
+//        value=@"";
+//    unsigned long color = strtoul([value UTF8String],0,16);
+//    
+//    
+//    DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+//    //  myView.backgroundColor = UIColorFromRGB(0x996633);;
+//    
+//    
+//    myView.layer.shadowPath =[UIBezierPath bezierPathWithRect:myView.bounds].CGPath;
+//    //    myView.layer.masksToBounds = false;
+//    //添加四个边阴影
+//    
+//    myView.layer.shadowColor = [UIColor blackColor].CGColor;
+//    myView.layer.shadowOffset = CGSizeMake(0, 0);
+//    myView.layer.shadowOpacity = 0.5;
+//    myView.layer.shadowRadius = 2.0;
+//    
+//    
+//    NSString*labeltitle = nil;
+//    switch (section) {
+//        case 0:
+//            labeltitle= @"Order Info";
+//            break;
+//        case 1:
+//        {
+//            labeltitle= @"More Info";
+//            
+//            NSString* btntitle=nil ;
+//            if(self.showMore)
+//            {
+//                btntitle=@"Hide";
+//                //        [section setValue:@"false" forKey:@"hide"];
+//                //        [sender setTitle:@"Show" forState:UIControlStateNormal];
+//            }
+//            else{
+//                btntitle=@"Show";
+//            }
+//            
+//            
+//            UIButton * btn =[[UIButton alloc] initWithFrame:CGRectMake(tableView.bounds.size.width-50-15, 0, 50, 33)];
+//            btn.tag=section;
+//            [btn addTarget:self action:@selector(HideSction:) forControlEvents:UIControlEventTouchUpInside];
+//            [btn setTitle:btntitle forState:UIControlStateNormal];
+//            [myView addSubview:btn];
+//            
+//        }
+//            break;
+//        case 2:{
+//            labeltitle= @"Models";
+//            
+//            NSString* btntitle=nil ;
+//            if(self.showModels)
+//            {
+//                btntitle=@"Hide";
+//            }
+//            else{
+//                btntitle=@"Show";
+//            }
+//            
+//            
+//            UIButton * btn =[[UIButton alloc] initWithFrame:CGRectMake(tableView.bounds.size.width-50-15, 0, 50, 33)];
+//            btn.tag=section;
+//            
+//            [btn addTarget:self action:@selector(HideSction:) forControlEvents:UIControlEventTouchUpInside];
+//            
+//            [btn setTitle:btntitle forState:UIControlStateNormal];
+//            [myView addSubview:btn];
+//            
+//        }
+//            break;
+//        case 3:
+//            labeltitle= @"Price Info";
+//        default:
+//            break;
+//    }
+//    
+//    
+//    
+//    UILabel *titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 5.5, 200, 20)];
+//    titlelabel.textColor=UIColorFromRGB(color);;
+//    titlelabel.backgroundColor = [UIColor clearColor];
+//    titlelabel.text=NSLocalizedString(labeltitle, nil);
+//    [titlelabel sizeToFit];
+//    [myView addSubview:titlelabel];
+//    
+//    //
+//    return myView;
+//}
+
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
+    
+    return [NSString stringWithFormat:@"Signature%ld",(long)section];
+    
+}
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+    return [self.signatureData[@"count"] intValue];
+}
+//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
+//{
+//    return 33;
+//}
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    
+    return 1;
+    
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    
+    
+    NSString *CellIdentifier = @"SignatureTableViewCell";
+    SignatureTableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+    NSDictionary * item_json = self.signatureData[[NSString stringWithFormat:@"item_%ld",(long)indexPath.section]];
+    
+    UIImage* img = [UIImage imageWithContentsOfFile:item_json[@"file"]];
+    
+    cell.signatureImageView.image = img;
+//    
+//    
+//    cell.webview.tag = indexPath.section;
+//    
+//    cell.webview.delegate = self;
+//    //        cell.webView.scrollView.contentSize.height = 0;
+//    cell.webview.scrollView.bounces=NO;
+//    cell.webview.scrollView.directionalLockEnabled = true;
+//    CGSize size= cell.webview.scrollView.contentSize;
+//    size.height=10;
+//    cell.webview.scrollView.contentSize=size;
+//    
+//    [cell.webview loadHTMLString:[self.content_data valueForKey:@"order_info"] baseURL:nil];
+//    
+//    cell.backgroundColor = [UIColor whiteColor];
+    return cell;
+
+
+    //    if(tableView==self.itemListTable)
+    //    {
+    //    NSString *CellIdentifier = @"CartItemCell";
+    //    ModelItemCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+    //    NSDictionary * item_json = [self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]];
+    //    NSDictionary * combine_json =[item_json objectForKey:@"combine"];
+    //
+    //    cell.bundle_item=combine_json;
+    //    NSString* img_url = [item_json valueForKey:@"img_url"];
+    //    NSString* description = [item_json valueForKey:@"description"];
+    //    //    NSString* identifier = [item_json valueForKey:@"identifier"];
+    //    //    NSString* attribute = [item_json valueForKey:@"attribute"];
+    //    NSString* currency = [item_json valueForKey:@"currency"];
+    //    int count =[[item_json valueForKey:@"count"] intValue];
+    //
+    //    int stockUom =[[item_json valueForKey:@"stockUom"] intValue];
+    //
+    //    double totalprice =[[item_json valueForKey:@"subtotal_price"] doubleValue];
+    //
+    //    double unitprice=[[item_json valueForKey:@"unit_price"] doubleValue];
+    //    cell.unit_price = unitprice;
+    //    //    cell.labelAttribute.text = attribute;
+    //    //    cell.labelCurrency.text = currency;
+    //    cell.labelDescription.text = description;
+    //    //   cell.labelIdentifier.text = identifier;
+    //    cell.labelPrice.text = [NSString stringWithFormat:@"%.2f",totalprice];
+    //
+    //    cell.labelUnitPrice.text = [NSString stringWithFormat:@"%.2f",unitprice];
+    //
+    //
+    //
+    //    NSString* cart_item_id= [item_json valueForKey:@"cart_item_id"];
+    //    cell.cart_id = cart_item_id;
+    //    [cell init_Stepper:stockUom max:9999 min:stockUom value:count];
+    //
+    //
+    //
+    //    [cell set_Count:count];
+    //
+    //    NSString* file_name=[img_url lastPathComponent];
+    //    NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:img_url];
+    //    if(img_data!=nil)
+    //    {
+    //
+    //        UIImage * img =[UIImage imageWithData:img_data];
+    //        [cell.btnImage setBackgroundImage:img forState:UIControlStateNormal];
+    //    }
+    //    else
+    //    {
+    //
+    //        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+    //
+    //            NSData*  downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
+    //
+    //            dispatch_async(dispatch_get_main_queue(), ^{
+    //
+    //
+    //
+    //                if(downloadimg_data!=nil)
+    //                {
+    //                    [iSalesDB cache_img:downloadimg_data :file_name ];
+    //
+    //                    UIImage * img =[UIImage imageWithData:downloadimg_data];
+    //                    [cell.btnImage setBackgroundImage:img forState:UIControlStateNormal];
+    //                }
+    //
+    //            });
+    //        });
+    //
+    //
+    //    }
+    //    return cell;
+    //    }
+    //    else
+    //    {
+    //        NSString *CellIdentifier = @"OrderInfoListItem";
+    //        UITableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+    //        return cell;
+    //    }
+}
+#pragma mark tableview delegate
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    if(self.blk_Select)
+    {
+        
+        SignatureTableViewCell * cell= [tableView cellForRowAtIndexPath:indexPath];
+        
+        self.blk_Select(cell.signatureImageView.image);
+
+    }
+    
+    [self dismissViewControllerAnimated:false completion:nil];
+    
+//    if (tableView.isEditing) { // 编辑模式下不响应
+//        return;
+//    }
+//    //
+//    if(indexPath.row==self.content_data.count)
+//        return;
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    
+//    if(appDelegate.user_type==USER_ROLE_CUSTOMER) { // Customer
+//        if ([Singleton sharedInstance].global_lock) { // Order list 被锁
+//            [RAUtils message_alert:@"App is locked,You can't view the order Detail" title:@"Warning" controller:self];
+//            return;
+//        }
+//    }
+//    
+//    NSString* orderid= [self.content_data[indexPath.row] valueForKey:@"order_id"];
+//    OrderDetailViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailViewController" ];
+//    
+//    //    int i =[[self.content_data[indexPath.row] valueForKey:@"order_code"];
+//    dvc.selectOrder=^(NSMutableDictionary* order_detail){
+//        
+//        [self.navigationController popViewControllerAnimated:false];
+//        if(self.selectOrder)
+//            self.selectOrder(order_detail);
+//        
+//        
+//        
+//    };
+//    NSString* order_code =[self.content_data[indexPath.row] valueForKey:@"order_code"];
+//    
+//    dvc.is_shoporder=(self.orderType == 0);
+//    dvc.order_code = order_code;
+//    dvc.order_status =[[self.content_data[indexPath.row] valueForKey:@"orderStatus"] intValue];
+//    //    bool temp_order = false ;
+//    //    NSString* order_status=[self.content_data[indexPath.row] valueForKey:@"order_status"];
+//    //    if([order_status isEqualToString:@"Saved"]||[order_status isEqualToString:@"Quoted"])
+//    //        temp_order=true;
+//    //
+//    //    dvc.isTempOrder = temp_order;
+//    
+//    //            dvc
+//    
+//    dvc.orderid=orderid;
+//    //    dvc.category_id=nil;
+//    //    dvc.ispush=true;
+//    //    [dvc reload];
+//    [self.navigationController pushViewController:dvc animated:true];
+    
+    
+}
+@end

+ 14 - 0
Ants Contract/AntsContract/AntsContract/SignatureTableViewCell.h

@@ -0,0 +1,14 @@
+//
+//  SignatureTableViewCell.h
+//  AntsContract
+//
+//  Created by Ray on 12/19/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface SignatureTableViewCell : UITableViewCell
+@property (strong, nonatomic) IBOutlet UIImageView *signatureImageView;
+
+@end

+ 24 - 0
Ants Contract/AntsContract/AntsContract/SignatureTableViewCell.m

@@ -0,0 +1,24 @@
+//
+//  SignatureTableViewCell.m
+//  AntsContract
+//
+//  Created by Ray on 12/19/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "SignatureTableViewCell.h"
+
+@implementation SignatureTableViewCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+@end

+ 14 - 0
Ants Contract/AntsContract/AntsContract/config.h

@@ -0,0 +1,14 @@
+//
+//  config.h
+//  AntsContract
+//
+//  Created by Ray on 12/19/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#ifndef config_h
+#define config_h
+
+#define DEBUG_PDFSIG true
+
+#endif /* config_h */

+ 16 - 0
Ants Contract/AntsContract/AntsContract/main.m

@@ -0,0 +1,16 @@
+//
+//  main.m
+//  AntsContract
+//
+//  Created by Ray on 12/16/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[]) {
+    @autoreleasepool {
+        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+    }
+}

+ 34 - 0
Ants Contract/AntsContract/AntsContract/testcontrol.json

@@ -0,0 +1,34 @@
+{
+    "count": 1,
+    "page_0": {
+        "count": 3,
+        "control_0": {
+            "type": "TextView",
+            "pos_x": 460,
+            "pos_y": 610,
+            "width": 160,
+            "height": 40,
+            "field": "date",
+            "value": ""
+        },
+        "control_1": {
+            "type": "Button",
+            "pos_x": 240,
+            "pos_y": 240,
+            "width": 125,
+            "height": 125,
+            "field": "field2",
+            "title": "buttontitle",
+            "value": ""
+        },
+        "control_2": {
+            "type": "Signature",
+            "pos_x": 150,
+            "pos_y": 610,
+            "width": 160,
+            "height": 40,
+            "field": "customer signature",
+            "value": ""
+        }
+    }
+}