diff --git a/.swift-version b/.swift-version deleted file mode 100644 index f398a20..0000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -3.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index da5f7df..b60b52e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ # * https://github.com/supermarin/xcpretty#usage language: objective-c -osx_image: xcode8 +osx_image: xcode10.1 # cache: cocoapods # podfile: Example/Podfile before_install: diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100644 new mode 100755 diff --git a/Example/ISSUE_TEMPLATE.md b/Example/ISSUE_TEMPLATE.md old mode 100644 new mode 100755 diff --git a/Example/Podfile b/Example/Podfile old mode 100644 new mode 100755 index f7eb15f..f716a5f --- a/Example/Podfile +++ b/Example/Podfile @@ -1,4 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '9.3' use_frameworks! target 'UXMPDFKit_Example' do diff --git a/Example/Podfile.lock b/Example/Podfile.lock old mode 100644 new mode 100755 index 0311943..1d844f4 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - UXMPDFKit (0.4.7) + - UXMPDFKit (0.8.3) DEPENDENCIES: - UXMPDFKit (from `../`) @@ -9,8 +9,8 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - UXMPDFKit: fe7d8d6ae849b679a9eb61a4eb3b38851ee4ff09 + UXMPDFKit: 4cfdbdfe0460aed43a4080c056aa7af5b21102ab -PODFILE CHECKSUM: 46572415aec518e632bcccd6baa0dcc394d5ae6e +PODFILE CHECKSUM: 99f7e6a2df6f7352ce2866a0d466eb324e287eea -COCOAPODS: 1.1.1 +COCOAPODS: 1.6.0 diff --git a/Example/Pods/Local Podspecs/UXMPDFKit.podspec.json b/Example/Pods/Local Podspecs/UXMPDFKit.podspec.json old mode 100644 new mode 100755 index 3ffd12a..9fa95c6 --- a/Example/Pods/Local Podspecs/UXMPDFKit.podspec.json +++ b/Example/Pods/Local Podspecs/UXMPDFKit.podspec.json @@ -1,17 +1,18 @@ { "name": "UXMPDFKit", - "version": "0.5.1", + "version": "0.8.3", "summary": "A fully functioning PDF reader written completely in Swift", - "homepage": "https://github.com/uxmstudio/UXMPDFKit", + "homepage": "https://github.com/diegostamigni/UXMPDFKit", "license": "MIT", "authors": { "Chris Anderson": "chris@uxmstudio.com" }, "source": { - "git": "https://github.com/uxmstudio/UXMPDFKit.git", - "tag": "0.5.1" + "git": "https://github.com/diegostamigni/UXMPDFKit.git", + "tag": "0.8.3" }, "requires_arc": true, + "swift_version": "4.2", "platforms": { "ios": "9.0" }, diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock old mode 100644 new mode 100755 index 0311943..1d844f4 --- a/Example/Pods/Manifest.lock +++ b/Example/Pods/Manifest.lock @@ -1,5 +1,5 @@ PODS: - - UXMPDFKit (0.4.7) + - UXMPDFKit (0.8.3) DEPENDENCIES: - UXMPDFKit (from `../`) @@ -9,8 +9,8 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - UXMPDFKit: fe7d8d6ae849b679a9eb61a4eb3b38851ee4ff09 + UXMPDFKit: 4cfdbdfe0460aed43a4080c056aa7af5b21102ab -PODFILE CHECKSUM: 46572415aec518e632bcccd6baa0dcc394d5ae6e +PODFILE CHECKSUM: 99f7e6a2df6f7352ce2866a0d466eb324e287eea -COCOAPODS: 1.1.1 +COCOAPODS: 1.6.0 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 28222e8..dfd3734 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -3,649 +3,633 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXBuildFile section */ - 00703477D03E535E1BFA3A7169814C2C /* PDFAnnotationStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B68ECDBCA8C7CBFC7A4C746BEAA00756 /* PDFAnnotationStore.swift */; }; - 0168C787039F39EFC7CC717928780ECE /* PDFFormField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EC48780BD915E4D5ACCE82C88A1AB13 /* PDFFormField.swift */; }; - 026FEED112A93B09A02BE58F8F025312 /* PDFPageScrubberThumb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43266A476FB5C6ADDCCBECEB16E9D513 /* PDFPageScrubberThumb.swift */; }; - 02F91569195B82122C93CD73F89BF123 /* PDFDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E1B16E7B9A2A6B1300E0AE0B3DD0ED6 /* PDFDocument.swift */; }; - 075383BD36B769E863ED5F59FA08F555 /* PDFPathAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9875B88D900C485C9301E8616F19BC5 /* PDFPathAnnotation.swift */; }; - 14E3AEB11DD6ED3800CC9C60 /* PDFSinglePageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14E3AEB01DD6ED3800CC9C60 /* PDFSinglePageCell.swift */; }; - 14ED9AA74A5A2E807B36B928AAE04F32 /* PDFTextAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36255D8C8E8839365B8EB3FF153756B5 /* PDFTextAnnotation.swift */; }; - 1A6C84063FC233E27AEA75D7300DFD96 /* PDFFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E445E04379E4222CB9A066D36A01E7C /* PDFFormViewController.swift */; }; - 27F938F715132EBBE5F6903A0029CA2B /* PDFDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F0671AD3DB0F8A78F7FA1753FD4D804 /* PDFDictionary.swift */; }; - 298424542AE0A9D498FF405DFA338D75 /* PDFSnapshotCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9FE943FC9A290F6F65198FF53EF96E6 /* PDFSnapshotCache.swift */; }; - 3718081077F2A6A3CB9DB4259C52A9A6 /* UXMPDFKit.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 36816B3ABA7674FDDFE94F22C8EC3FAB /* UXMPDFKit.bundle */; }; - 37C1CD56A692371828740DFCEE4A9128 /* PDFViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C998B073AF0AE6121E63EFF482E2E251 /* PDFViewController.swift */; }; - 38629AF01DDA548700DF2B43 /* UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38629AEF1DDA548700DF2B43 /* UIColor.swift */; }; - 38629AF21DDA55DF00DF2B43 /* PDFToggleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38629AF11DDA55DF00DF2B43 /* PDFToggleButton.swift */; }; - 4226B8E079C7A46273F41F374F2D54EB /* PDFDocumentLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = E49FB5E98854EBDE8CCAB4C0137D1986 /* PDFDocumentLink.swift */; }; - 4431B8FC918BE6C9C21DCC72EDA860E6 /* Pods-UXMPDFKit_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 73B9DE7CB16631F30FAE38D53282A2FE /* Pods-UXMPDFKit_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4B1F57EBF4BECAEC47EEF57BD3CA1AD7 /* PDFAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69FD1010A27EE6442B7768D3B955DBF9 /* PDFAction.swift */; }; - 4DFC30C056451573A629F3EA2C9378B7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C22425B0A3F84BE18A46849E29C823A0 /* Images.xcassets */; }; - 536A83F7FA72186229EBF285914A5B78 /* PDFThumbnailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C164216F04F2C8E8102F383F660F44 /* PDFThumbnailView.swift */; }; - 610688731E3A52BD00A85AF0 /* UIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 610688711E3A4F9900A85AF0 /* UIViewController.swift */; }; - 612E003F1E424A9E00C42D3E /* CGPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 612E003D1E424A7200C42D3E /* CGPoint.swift */; }; - 612E00421E424F3E00C42D3E /* CGRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 612E00401E424EBF00C42D3E /* CGRect.swift */; }; - 61561CB41DDA7C6100C314EB /* PDFThumbnailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61561CB21DDA7B4E00C314EB /* PDFThumbnailViewController.swift */; }; - 61561CB61DDA7F6200C314EB /* PDFThumbnailViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61561CB51DDA7F6200C314EB /* PDFThumbnailViewCell.swift */; }; - 61C3A26E1EC2859A00807C4B /* ResizeableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61C3A26D1EC2859A00807C4B /* ResizeableView.swift */; }; - 61D72DBD1DDB705B003CE472 /* PDFActionURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61D72DBC1DDB705B003CE472 /* PDFActionURL.swift */; }; - 61D72DBE1DDB7062003CE472 /* PDFActionGoTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61D72DBA1DDB7039003CE472 /* PDFActionGoTo.swift */; }; - 61D72DC11DDB7C15003CE472 /* PDFTextParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61D72DC01DDB7C15003CE472 /* PDFTextParser.swift */; }; - 6CBA8437445A566C49E81E0FA15F8B89 /* Pods-UXMPDFKit_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = EF5680F0C21DEB74F7B47666298F36DB /* Pods-UXMPDFKit_Example-dummy.m */; }; - 75332EB7DF07634FEBA4DB30AED834DE /* PDFBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC1A9EB3AA234A93FFED5E5EC31C26C0 /* PDFBarButton.swift */; }; - 75EBCC5DA128D1197EE38C0D71ED2E61 /* PDFSinglePageViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F33BD08506077733D10565FD32AAE01D /* PDFSinglePageViewer.swift */; }; - A541F16F605856534EE1CB630D115E97 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; - AEBCD8510D17EB5BB1AF97C56DA3E0A4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; - B564F9589CA9317A04F24F9DC40AC5AA /* PDFAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46276AA25C0911175B06F6F426E499D5 /* PDFAnnotation.swift */; }; - B6610EC0BB6FC688BE01E6A0CEDAC1E8 /* PDFPageScrubber.swift in Sources */ = {isa = PBXBuildFile; fileRef = C690BCEDB59958B45834FDDEEF382E58 /* PDFPageScrubber.swift */; }; - C02189E300C9F94935CFF78ECD34CA3B /* PDFPageTileLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE1C7B951EC7E6CED0390CF07A023630 /* PDFPageTileLayer.swift */; }; - C1EDA6F9A885F21D2887845369237062 /* PDFArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64082BD427D609690F7BB6818051DE3D /* PDFArray.swift */; }; - C4E224C0D0BFCC63723ACA2EDB266CC6 /* PDFFormButtonField.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB4C067E14A9564492BD5FDF5871991B /* PDFFormButtonField.swift */; }; - C4ECF8B8556E26A1DF679C202AC9B641 /* PDFFormSignatureField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86698FA335844AF90C62A0038C5B4B9C /* PDFFormSignatureField.swift */; }; - CC2919A41AAA5F6BCC83D700E574345F /* PDFObjectParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71407B9D27B023DFC53AEEA70B040CB /* PDFObjectParser.swift */; }; - CE63E30770B2CDD35ED208AF2A284F5B /* PDFPageContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C363DF92B0BB7081898E123695AED3A2 /* PDFPageContent.swift */; }; - D09FB06765B5FCD7A81F58BE68B1BDED /* PDFRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D9346501AFA05A330677D39DB1650F /* PDFRenderer.swift */; }; - DD3034BF3EE6DA6D91BBF74EAEAC456E /* PDFFormPageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 315197F935F69EEBFF1F92849523A564 /* PDFFormPageView.swift */; }; - DE4A344370F68EA63CCA245BB42FF44A /* UXMPDFKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 38A6B7046D88F318BCDF67B75969CABF /* UXMPDFKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DEEE49CA145C9CAFCB54635C31D6F6E6 /* CGPDFDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76DA813643EF21961CF0953E75AD135F /* CGPDFDocument.swift */; }; - E2EE8D087924795726295ABA80B0079F /* PDFPageScrubberTrackControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC4678DC63259E1E556B22354639F826 /* PDFPageScrubberTrackControl.swift */; }; - E8C31B918E22C5EB41B659A64E076416 /* PDFAnnotationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9731359E2EA43A65C0297BACA691EFDC /* PDFAnnotationController.swift */; }; - EA02320D912547EAE5017330C7835B18 /* UXMPDFKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CC32D4C69A270C7F52DFE49BEE6E162 /* UXMPDFKit-dummy.m */; }; - EF0C3B060264BDE888EFCB98B2E95088 /* UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EF790A1D01AB3417430203D9D7EFB14 /* UIImage.swift */; }; - F77D80C31A9B9DBED9D3A258932F9922 /* PDFPageContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A494B21C53F5EAC8E75CE8E354CAF951 /* PDFPageContentView.swift */; }; - F9C1E676BBEAC0A22212CD00437C1073 /* PDFFormTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83C4D21E86A879510E1AA0F444C9882 /* PDFFormTextField.swift */; }; + 1250E6776356E100E9DC14FBCFF2B037 /* UXMFormButtonField.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83F4F2BB75B923121E4058C9B49E5C8 /* UXMFormButtonField.swift */; }; + 136BBDBE476024706CB69316C2AAA8E2 /* UXMPDFKit.bundle in Resources */ = {isa = PBXBuildFile; fileRef = F83CFB9C26AB5C4569E64E4CCE777047 /* UXMPDFKit.bundle */; }; + 169527322DA9731208A8D6D0F185783F /* UXMPDFDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEC9DA5610A4CFE8C0473F36F0595036 /* UXMPDFDocument.swift */; }; + 1C10A1135D687EB61CBD22095FA5395B /* UXMBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4412986261FBEDF7D9EF42E50B8D067B /* UXMBarButton.swift */; }; + 24DB87C576BECEF1750821B31F5F080A /* UXMObjectParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C5F30D4A264044EBAFA74B1548089CD /* UXMObjectParser.swift */; }; + 28F2C060F4EAB1D09B4A58C18AA7962C /* UXMFormSignatureField.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9CE9F623C23FC20A57E2B4868458F3C /* UXMFormSignatureField.swift */; }; + 356FE7A72B89DD070A15692ADEDDEAFF /* UXMActionURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7FE6A73A7B4DD26FE9D0FDDB940F6D7 /* UXMActionURL.swift */; }; + 37EB5C1ECB8FBF934C11E1E73F3C2022 /* UIScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51B6496B6BCA4EA629ACCB7D31662B51 /* UIScreen.swift */; }; + 3CEA23416ECE2712887613C6D3FA1407 /* UXMTextAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1295D8AC76D1852B8030D2943F7F7E4 /* UXMTextAnnotation.swift */; }; + 4067F8F4B76B08D5D240E52074D6F054 /* UXMPathAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C541D8CB9806406CE3BB959B87A230E8 /* UXMPathAnnotation.swift */; }; + 4251835297584B417189204D61E506D0 /* CGPDFDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D54DAFCC45AD7F9E59716F16C439162 /* CGPDFDocument.swift */; }; + 42B42F04D9F99F92FC1A935F1CB2BF86 /* UXMDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07D45D737FC8602D67AE935E9B78DC13 /* UXMDictionary.swift */; }; + 434F4BFFC909FD9FC9EC39D000EBEDAB /* UXMThumbnailViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 729A667064EA9936801DCFAF911C8E97 /* UXMThumbnailViewCell.swift */; }; + 43614C4545E0FF920984CD0D5AED409B /* UXMActionGoTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 998A32C83E9824F624F989D7EC6DC875 /* UXMActionGoTo.swift */; }; + 4804B2FAD1753BDAC0B997BA4FBA3414 /* UXMSinglePageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEEBFBA4B8C2D5F9902E0C6D68633ECA /* UXMSinglePageCell.swift */; }; + 56C65EAAB99CAB4F4F0807DF50FEA8F8 /* UXMPageTileLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F305666A53A9576919F9D8DDE71D3FE /* UXMPageTileLayer.swift */; }; + 571850ACFD31D49D6915D59AD046D6D0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */; }; + 5AB8A72CE7CD8AACF8F69B3533FD14C8 /* UXMAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08DBC90C86301A17AE53FD91C248C5AA /* UXMAnnotation.swift */; }; + 5C701F3E5503C9E45A02B11C71E0DA49 /* UXMSignAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77E351D50E497B2A5919537B7BB7A905 /* UXMSignAnnotation.swift */; }; + 638D81AA2C840054E120FFC48C446358 /* UXMFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 737C10965302DDAB8F8AC9A310ED6B38 /* UXMFormViewController.swift */; }; + 6462D115812637A01B2E17F07C8CFEDE /* UXMPageContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09593FE46C3115CEC2659E3064FDFD52 /* UXMPageContent.swift */; }; + 66C0AA9A006F6E003C58659FC92F13A2 /* Pods-UXMPDFKit_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 932974CCD2A444CB2EA4D524E45173AD /* Pods-UXMPDFKit_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6A9A15EE477E277A14FA288FC7B5E865 /* ResizeableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6E306F1F3E4010D2A1A2933D7B3C0F /* ResizeableView.swift */; }; + 6D36DD344B08FFEC67C14149926EDE80 /* UXMToggleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A15C24BE9B577CFE5B59F03560EF573 /* UXMToggleButton.swift */; }; + 73DB3164507CBDDA1B6D3F34D8463A56 /* UXMPageScrubber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379D16636EB184F38D53E912EF17BA64 /* UXMPageScrubber.swift */; }; + 7695D223316C5E49AA9B88E809BB4042 /* UXMTextParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDFFC61381241BF0A37B958E0C7E8CD7 /* UXMTextParser.swift */; }; + 841BE296A8ED59681137FDC0F4FC2E0D /* UIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7B027998FF3FEB5BF45CB2B41F0F620 /* UIView.swift */; }; + 882F787CA5CC4504E8909353CAB76F20 /* UXMPageScrubberTrackControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = C719C91AE845F5D2FD98C36B4BEDF7F2 /* UXMPageScrubberTrackControl.swift */; }; + 894A1B75AC4BAB454B94ADE62CC5E3EE /* UXMPageContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1CEE956C7C0183D61F5EAB2DCD1FC28 /* UXMPageContentView.swift */; }; + 9456E3E836B8E60BC7D4CC5DD0238A1A /* UXMRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 352E322B4492AC613FA7743DED214C01 /* UXMRenderer.swift */; }; + 96253ECC10010433A78ECA627018EBCC /* UXMPDFViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8006C2DFBCBB3C93CBFED2995373BF2B /* UXMPDFViewController.swift */; }; + 96D2109755C4E3EDB546A2FCC107051F /* UXMSinglePageViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4C626B8424EEEA55A8DEC6499CD83FA /* UXMSinglePageViewer.swift */; }; + 980D70AF6AEC797FB89CB8312D116645 /* UXMAnnotationStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57DAFFEFED84C6B613C919F6E11E90A2 /* UXMAnnotationStore.swift */; }; + A89F167626D70627BC97499C82BA1499 /* UXMPDFKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = A6E95B0D94B174CA4A7A5A379E507D29 /* UXMPDFKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A9458D69B4D46952862681919BE9DD1E /* UXMDocumentLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F5EBD76909971E83FAA2F0F77F1BC91 /* UXMDocumentLink.swift */; }; + AAEEC0221A86FE305C2CF959E05DFE2B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */; }; + B1BB02018B2C75CED34AAD08DE4AF15E /* UXMThumbnailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32CEDE3FB3A8F227776FA1A682D0024E /* UXMThumbnailViewController.swift */; }; + B6B55F1C62F772558F9F9D1199F3EA07 /* UXMFormTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = F563B4A933F29C0EB628AC25E1D034CF /* UXMFormTextField.swift */; }; + BCBC7D84131B9D49AB875A5B3F25B1C8 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3E83558981FDBEE74AE82607C0A7EF55 /* Images.xcassets */; }; + BF1C004F79B1DFDF40AB3C5CE7F5A3D5 /* UXMPDFKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A01E57E875087F54AA54F22CC28A2E1 /* UXMPDFKit-dummy.m */; }; + BF75A8BDA9F9AEDE8E233721EFC34E85 /* UXMFormPageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F25EBDE2DBA00B2EEEF22ED5BCE6AF1 /* UXMFormPageView.swift */; }; + CB0400B6986109E95202CF5E1026CD21 /* UXMArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 762D65A1ADB7C9E3D70280C4F34B4822 /* UXMArray.swift */; }; + D58A7C8DF74F6CE0CC1BC193B90F5E70 /* UIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96FD903479BD37A08EE400CF03185285 /* UIViewController.swift */; }; + D64728A53D6EE7BA9FA91026C335E719 /* UXMAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBB095FEC4FEDD501B41714C64A55EBC /* UXMAction.swift */; }; + D966C5918E9416C1A2BBE2D385B53ED5 /* UXMSnapshotCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 875F04A41E32AE4DB3742368E7004BBB /* UXMSnapshotCache.swift */; }; + DA448BB7BBEB6F6E08A50747B13E44FF /* UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A26699CB4A0ACE8BA952719833D636B /* UIColor.swift */; }; + DBA6419C16C0E2584BDEE934A86A7CAB /* CGPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F4646F7A314CA0A26F1ACDC47AB837A /* CGPoint.swift */; }; + DFA7C63060BDF746941C4B5E1E76A851 /* UXMPageScrubberThumb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49417F8A6C60B24EF4318CDF18941FEC /* UXMPageScrubberThumb.swift */; }; + E64BF6495808F9103FB45A5089B385FF /* UXMFormField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C02FAE7B5517778D27FC12DCE3C76AA /* UXMFormField.swift */; }; + EBFF37DCC8DAC16BEBC5233A47B8CCEE /* UXMThumbnailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F91DDBF53CAA8E4E28D13B1B70CECC31 /* UXMThumbnailView.swift */; }; + EF2BA6EFE1A9356E3BC925127C0E3FF0 /* UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E5BAA83AA300B662A40ED4283DBA847 /* UIImage.swift */; }; + F44032805350D1E1D301682DE8589503 /* Pods-UXMPDFKit_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A17D846FE0A9F7B9ECDE0CC3ECA2AA0A /* Pods-UXMPDFKit_Example-dummy.m */; }; + F4D10F3E222DDAD52354352E6515C032 /* CGRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7466E5849F06D225CCA4D645D6A93F0 /* CGRect.swift */; }; + FA438F8C35B70888B0518E2B4C22EE22 /* UXMAnnotationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD1E58B84E1DD5CAA8DA9C3AA7ACE4F /* UXMAnnotationController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1E1EE300810192D509C81620ADAD5F2A /* PBXContainerItemProxy */ = { + 459EAE1E3294B1297887E072F48FD575 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; - remoteGlobalIDString = 806AC9F20336348B8F1E6138E470491D; - remoteInfo = UXMPDFKit; + remoteGlobalIDString = B18081AD223E357F1772DD977B2B2622; + remoteInfo = "UXMPDFKit-UXMPDFKit"; }; - E19880B3709917456341F3D38E3AAC50 /* PBXContainerItemProxy */ = { + F98F184F8CA7BE07D558F77659AAD05A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; - remoteGlobalIDString = 9C492BC63E45F8B8D516D6487251ECE8; - remoteInfo = "UXMPDFKit-UXMPDFKit"; + remoteGlobalIDString = 8F9CC8B698EB7702368FB8BBDA601634; + remoteInfo = UXMPDFKit; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 0E25E22600004B87F1FD6DE65F353057 /* Pods_UXMPDFKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_UXMPDFKit_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0EF790A1D01AB3417430203D9D7EFB14 /* UIImage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UIImage.swift; sourceTree = ""; }; - 14E3AEB01DD6ED3800CC9C60 /* PDFSinglePageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFSinglePageCell.swift; sourceTree = ""; }; - 2E445E04379E4222CB9A066D36A01E7C /* PDFFormViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFFormViewController.swift; sourceTree = ""; }; - 315197F935F69EEBFF1F92849523A564 /* PDFFormPageView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFFormPageView.swift; sourceTree = ""; }; - 36255D8C8E8839365B8EB3FF153756B5 /* PDFTextAnnotation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFTextAnnotation.swift; sourceTree = ""; }; - 36816B3ABA7674FDDFE94F22C8EC3FAB /* UXMPDFKit.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UXMPDFKit.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; - 38629AEF1DDA548700DF2B43 /* UIColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIColor.swift; sourceTree = ""; }; - 38629AF11DDA55DF00DF2B43 /* PDFToggleButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFToggleButton.swift; sourceTree = ""; }; - 38A6B7046D88F318BCDF67B75969CABF /* UXMPDFKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UXMPDFKit-umbrella.h"; sourceTree = ""; }; - 3CC32D4C69A270C7F52DFE49BEE6E162 /* UXMPDFKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UXMPDFKit-dummy.m"; sourceTree = ""; }; - 43266A476FB5C6ADDCCBECEB16E9D513 /* PDFPageScrubberThumb.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFPageScrubberThumb.swift; sourceTree = ""; }; - 46276AA25C0911175B06F6F426E499D5 /* PDFAnnotation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFAnnotation.swift; sourceTree = ""; }; - 4E1B16E7B9A2A6B1300E0AE0B3DD0ED6 /* PDFDocument.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFDocument.swift; sourceTree = ""; }; - 610688711E3A4F9900A85AF0 /* UIViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIViewController.swift; sourceTree = ""; }; - 612E003D1E424A7200C42D3E /* CGPoint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CGPoint.swift; sourceTree = ""; }; - 612E00401E424EBF00C42D3E /* CGRect.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CGRect.swift; sourceTree = ""; }; - 614525CCFB2767D95FE12EEEC2FD622C /* UXMPDFKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UXMPDFKit-prefix.pch"; sourceTree = ""; }; - 61561CB21DDA7B4E00C314EB /* PDFThumbnailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFThumbnailViewController.swift; sourceTree = ""; }; - 61561CB51DDA7F6200C314EB /* PDFThumbnailViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFThumbnailViewCell.swift; sourceTree = ""; }; - 61C3A26D1EC2859A00807C4B /* ResizeableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResizeableView.swift; sourceTree = ""; }; - 61D72DBA1DDB7039003CE472 /* PDFActionGoTo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFActionGoTo.swift; sourceTree = ""; }; - 61D72DBC1DDB705B003CE472 /* PDFActionURL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFActionURL.swift; sourceTree = ""; }; - 61D72DC01DDB7C15003CE472 /* PDFTextParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFTextParser.swift; sourceTree = ""; }; - 64082BD427D609690F7BB6818051DE3D /* PDFArray.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFArray.swift; sourceTree = ""; }; - 69FD1010A27EE6442B7768D3B955DBF9 /* PDFAction.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFAction.swift; sourceTree = ""; }; - 6EC48780BD915E4D5ACCE82C88A1AB13 /* PDFFormField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFFormField.swift; sourceTree = ""; }; - 73B9DE7CB16631F30FAE38D53282A2FE /* Pods-UXMPDFKit_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-UXMPDFKit_Example-umbrella.h"; sourceTree = ""; }; - 75574BE886F738F3093CE3A2F50EDEC8 /* Pods-UXMPDFKit_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-UXMPDFKit_Example-acknowledgements.markdown"; sourceTree = ""; }; - 76DA813643EF21961CF0953E75AD135F /* CGPDFDocument.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CGPDFDocument.swift; sourceTree = ""; }; - 7F0671AD3DB0F8A78F7FA1753FD4D804 /* PDFDictionary.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFDictionary.swift; sourceTree = ""; }; - 84EF34252AF2C6686B91CF82C433AF97 /* Pods-UXMPDFKit_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-UXMPDFKit_Example-resources.sh"; sourceTree = ""; }; - 86698FA335844AF90C62A0038C5B4B9C /* PDFFormSignatureField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFFormSignatureField.swift; sourceTree = ""; }; - 923C8A6AA6EF26F1AFCE47B4B4307540 /* Pods-UXMPDFKit_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-UXMPDFKit_Example.modulemap"; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 9731359E2EA43A65C0297BACA691EFDC /* PDFAnnotationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFAnnotationController.swift; sourceTree = ""; }; - 98269C964ED3DBB303CBAA1006CEE6AC /* Pods-UXMPDFKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-UXMPDFKit_Example.debug.xcconfig"; sourceTree = ""; }; - A0181833A6A33E2F39D632638FA039C1 /* UXMPDFKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = UXMPDFKit.modulemap; sourceTree = ""; }; - A4813EE89CCCB14693E9B61A6CD6117F /* UXMPDFKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = UXMPDFKit.xcconfig; sourceTree = ""; }; - A494B21C53F5EAC8E75CE8E354CAF951 /* PDFPageContentView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFPageContentView.swift; sourceTree = ""; }; - A599D61A3B46FD09E6025DE6E91F8D66 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A83C4D21E86A879510E1AA0F444C9882 /* PDFFormTextField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFFormTextField.swift; sourceTree = ""; }; - A96B3532B35536E9DE978DE5DE13E668 /* ResourceBundle-UXMPDFKit-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-UXMPDFKit-Info.plist"; sourceTree = ""; }; - AE1C7B951EC7E6CED0390CF07A023630 /* PDFPageTileLayer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFPageTileLayer.swift; sourceTree = ""; }; - B68ECDBCA8C7CBFC7A4C746BEAA00756 /* PDFAnnotationStore.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFAnnotationStore.swift; sourceTree = ""; }; - B7D9346501AFA05A330677D39DB1650F /* PDFRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFRenderer.swift; sourceTree = ""; }; - B9875B88D900C485C9301E8616F19BC5 /* PDFPathAnnotation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFPathAnnotation.swift; sourceTree = ""; }; - BC1A9EB3AA234A93FFED5E5EC31C26C0 /* PDFBarButton.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFBarButton.swift; sourceTree = ""; }; - C22425B0A3F84BE18A46849E29C823A0 /* Images.xcassets */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - C363DF92B0BB7081898E123695AED3A2 /* PDFPageContent.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFPageContent.swift; sourceTree = ""; }; - C427B08E12D2A5801438BEBFC96520BD /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C690BCEDB59958B45834FDDEEF382E58 /* PDFPageScrubber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFPageScrubber.swift; sourceTree = ""; }; - C6C164216F04F2C8E8102F383F660F44 /* PDFThumbnailView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFThumbnailView.swift; sourceTree = ""; }; - C71407B9D27B023DFC53AEEA70B040CB /* PDFObjectParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFObjectParser.swift; sourceTree = ""; }; - C998B073AF0AE6121E63EFF482E2E251 /* PDFViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFViewController.swift; sourceTree = ""; }; - C9FE943FC9A290F6F65198FF53EF96E6 /* PDFSnapshotCache.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFSnapshotCache.swift; sourceTree = ""; }; - CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - CF95F142877C93B0BAB858F7187F7D1C /* Pods-UXMPDFKit_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-UXMPDFKit_Example.release.xcconfig"; sourceTree = ""; }; - D7B61F1F28653D99DFE37D252E1BD160 /* Pods-UXMPDFKit_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-UXMPDFKit_Example-acknowledgements.plist"; sourceTree = ""; }; - E49FB5E98854EBDE8CCAB4C0137D1986 /* PDFDocumentLink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFDocumentLink.swift; sourceTree = ""; }; - EC338060A25E46404C16949C136E122D /* UXMPDFKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = UXMPDFKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - EC4678DC63259E1E556B22354639F826 /* PDFPageScrubberTrackControl.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFPageScrubberTrackControl.swift; sourceTree = ""; }; - EF5680F0C21DEB74F7B47666298F36DB /* Pods-UXMPDFKit_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-UXMPDFKit_Example-dummy.m"; sourceTree = ""; }; - F33BD08506077733D10565FD32AAE01D /* PDFSinglePageViewer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFSinglePageViewer.swift; sourceTree = ""; }; - F5E1EF2045F8CAE079FBBD1B47009647 /* Pods-UXMPDFKit_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-UXMPDFKit_Example-frameworks.sh"; sourceTree = ""; }; - FB4C067E14A9564492BD5FDF5871991B /* PDFFormButtonField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PDFFormButtonField.swift; sourceTree = ""; }; + 00E3209739A597A9528C7DDF2BC2180B /* UXMPDFKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = UXMPDFKit.modulemap; sourceTree = ""; }; + 07D45D737FC8602D67AE935E9B78DC13 /* UXMDictionary.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMDictionary.swift; sourceTree = ""; }; + 08DBC90C86301A17AE53FD91C248C5AA /* UXMAnnotation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMAnnotation.swift; sourceTree = ""; }; + 09593FE46C3115CEC2659E3064FDFD52 /* UXMPageContent.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageContent.swift; sourceTree = ""; }; + 1C02FAE7B5517778D27FC12DCE3C76AA /* UXMFormField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormField.swift; sourceTree = ""; }; + 25DED061B5E7463EF124C75C2AD629FE /* Pods-UXMPDFKit_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-UXMPDFKit_Example.modulemap"; sourceTree = ""; }; + 2A01E57E875087F54AA54F22CC28A2E1 /* UXMPDFKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UXMPDFKit-dummy.m"; sourceTree = ""; }; + 2C5F30D4A264044EBAFA74B1548089CD /* UXMObjectParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMObjectParser.swift; sourceTree = ""; }; + 32CEDE3FB3A8F227776FA1A682D0024E /* UXMThumbnailViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMThumbnailViewController.swift; sourceTree = ""; }; + 352E322B4492AC613FA7743DED214C01 /* UXMRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMRenderer.swift; sourceTree = ""; }; + 379D16636EB184F38D53E912EF17BA64 /* UXMPageScrubber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageScrubber.swift; sourceTree = ""; }; + 3E83558981FDBEE74AE82607C0A7EF55 /* Images.xcassets */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Pod/Assets/Images.xcassets; sourceTree = ""; }; + 4412986261FBEDF7D9EF42E50B8D067B /* UXMBarButton.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMBarButton.swift; sourceTree = ""; }; + 49417F8A6C60B24EF4318CDF18941FEC /* UXMPageScrubberThumb.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageScrubberThumb.swift; sourceTree = ""; }; + 4C0444CC4E010F8A63E5F44DE7875296 /* ResourceBundle-UXMPDFKit-UXMPDFKit-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-UXMPDFKit-UXMPDFKit-Info.plist"; sourceTree = ""; }; + 4F5EBD76909971E83FAA2F0F77F1BC91 /* UXMDocumentLink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMDocumentLink.swift; sourceTree = ""; }; + 51B6496B6BCA4EA629ACCB7D31662B51 /* UIScreen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UIScreen.swift; sourceTree = ""; }; + 52EED9C6DFEB791138FDDC8910DFEAEC /* UXMPDFKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = UXMPDFKit.framework; path = UXMPDFKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 57DAFFEFED84C6B613C919F6E11E90A2 /* UXMAnnotationStore.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMAnnotationStore.swift; sourceTree = ""; }; + 6649F6B893EFD6A7FB6A6D6E36E52C57 /* UXMPDFKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UXMPDFKit-prefix.pch"; sourceTree = ""; }; + 6A15C24BE9B577CFE5B59F03560EF573 /* UXMToggleButton.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMToggleButton.swift; sourceTree = ""; }; + 6F25EBDE2DBA00B2EEEF22ED5BCE6AF1 /* UXMFormPageView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormPageView.swift; sourceTree = ""; }; + 6F4646F7A314CA0A26F1ACDC47AB837A /* CGPoint.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CGPoint.swift; sourceTree = ""; }; + 729A667064EA9936801DCFAF911C8E97 /* UXMThumbnailViewCell.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMThumbnailViewCell.swift; sourceTree = ""; }; + 737C10965302DDAB8F8AC9A310ED6B38 /* UXMFormViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormViewController.swift; sourceTree = ""; }; + 762D65A1ADB7C9E3D70280C4F34B4822 /* UXMArray.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMArray.swift; sourceTree = ""; }; + 77E351D50E497B2A5919537B7BB7A905 /* UXMSignAnnotation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMSignAnnotation.swift; sourceTree = ""; }; + 7A26699CB4A0ACE8BA952719833D636B /* UIColor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UIColor.swift; sourceTree = ""; }; + 7D54DAFCC45AD7F9E59716F16C439162 /* CGPDFDocument.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CGPDFDocument.swift; sourceTree = ""; }; + 7E5BAA83AA300B662A40ED4283DBA847 /* UIImage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UIImage.swift; sourceTree = ""; }; + 7E6E306F1F3E4010D2A1A2933D7B3C0F /* ResizeableView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ResizeableView.swift; sourceTree = ""; }; + 7F305666A53A9576919F9D8DDE71D3FE /* UXMPageTileLayer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageTileLayer.swift; sourceTree = ""; }; + 8006C2DFBCBB3C93CBFED2995373BF2B /* UXMPDFViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPDFViewController.swift; sourceTree = ""; }; + 875F04A41E32AE4DB3742368E7004BBB /* UXMSnapshotCache.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMSnapshotCache.swift; sourceTree = ""; }; + 932974CCD2A444CB2EA4D524E45173AD /* Pods-UXMPDFKit_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-UXMPDFKit_Example-umbrella.h"; sourceTree = ""; }; + 93B18DCBE501EE2CA3AB512802929B45 /* UXMPDFKit.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = UXMPDFKit.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 953F5F2EA710FEF04EA2714303BDB1B8 /* Pods-UXMPDFKit_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-UXMPDFKit_Example.release.xcconfig"; sourceTree = ""; }; + 96FD903479BD37A08EE400CF03185285 /* UIViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UIViewController.swift; sourceTree = ""; }; + 998A32C83E9824F624F989D7EC6DC875 /* UXMActionGoTo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMActionGoTo.swift; sourceTree = ""; }; + 9AD1E58B84E1DD5CAA8DA9C3AA7ACE4F /* UXMAnnotationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMAnnotationController.swift; sourceTree = ""; }; + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + A0664E0B108D49FD61C28400B5E1045F /* UXMPDFKit-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "UXMPDFKit-Info.plist"; sourceTree = ""; }; + A17D846FE0A9F7B9ECDE0CC3ECA2AA0A /* Pods-UXMPDFKit_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-UXMPDFKit_Example-dummy.m"; sourceTree = ""; }; + A4C626B8424EEEA55A8DEC6499CD83FA /* UXMSinglePageViewer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMSinglePageViewer.swift; sourceTree = ""; }; + A6E95B0D94B174CA4A7A5A379E507D29 /* UXMPDFKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UXMPDFKit-umbrella.h"; sourceTree = ""; }; + A83F4F2BB75B923121E4058C9B49E5C8 /* UXMFormButtonField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormButtonField.swift; sourceTree = ""; }; + B1CEE956C7C0183D61F5EAB2DCD1FC28 /* UXMPageContentView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageContentView.swift; sourceTree = ""; }; + BBFA3CDB790241873E42276174E22D5D /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; + C541D8CB9806406CE3BB959B87A230E8 /* UXMPathAnnotation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPathAnnotation.swift; sourceTree = ""; }; + C719C91AE845F5D2FD98C36B4BEDF7F2 /* UXMPageScrubberTrackControl.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageScrubberTrackControl.swift; sourceTree = ""; }; + C7466E5849F06D225CCA4D645D6A93F0 /* CGRect.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CGRect.swift; sourceTree = ""; }; + C7B027998FF3FEB5BF45CB2B41F0F620 /* UIView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UIView.swift; sourceTree = ""; }; + CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + DBBE17E8FE26B58E6EBF1ABC71A2CD74 /* Pods-UXMPDFKit_Example-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-UXMPDFKit_Example-Info.plist"; sourceTree = ""; }; + DC88BB6E3274477C6FC30923BC5DFB98 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; + DEEBFBA4B8C2D5F9902E0C6D68633ECA /* UXMSinglePageCell.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMSinglePageCell.swift; sourceTree = ""; }; + DF315C998D5E4A0AA3B52E81C470D1FE /* Pods_UXMPDFKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_UXMPDFKit_Example.framework; path = "Pods-UXMPDFKit_Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + E1AAD6C20A06D2FDAD515937D22CA1AC /* Pods-UXMPDFKit_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-UXMPDFKit_Example-frameworks.sh"; sourceTree = ""; }; + E9CE9F623C23FC20A57E2B4868458F3C /* UXMFormSignatureField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormSignatureField.swift; sourceTree = ""; }; + EA450F176B754F388F5F502B355BD12C /* Pods-UXMPDFKit_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-UXMPDFKit_Example-acknowledgements.markdown"; sourceTree = ""; }; + EB2AB31F50EE9C5F90DABF7E1F93DCF7 /* Pods-UXMPDFKit_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-UXMPDFKit_Example-acknowledgements.plist"; sourceTree = ""; }; + ED92938D073F3CBF339E581A6F042A15 /* Pods-UXMPDFKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-UXMPDFKit_Example.debug.xcconfig"; sourceTree = ""; }; + EDFFC61381241BF0A37B958E0C7E8CD7 /* UXMTextParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMTextParser.swift; sourceTree = ""; }; + EEC9DA5610A4CFE8C0473F36F0595036 /* UXMPDFDocument.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPDFDocument.swift; sourceTree = ""; }; + F11AA7CF079743F72E84484332A1526D /* UXMPDFKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = UXMPDFKit.xcconfig; sourceTree = ""; }; + F1295D8AC76D1852B8030D2943F7F7E4 /* UXMTextAnnotation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMTextAnnotation.swift; sourceTree = ""; }; + F563B4A933F29C0EB628AC25E1D034CF /* UXMFormTextField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormTextField.swift; sourceTree = ""; }; + F7FE6A73A7B4DD26FE9D0FDDB940F6D7 /* UXMActionURL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMActionURL.swift; sourceTree = ""; }; + F83CFB9C26AB5C4569E64E4CCE777047 /* UXMPDFKit.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = UXMPDFKit.bundle; path = "UXMPDFKit-UXMPDFKit.bundle"; sourceTree = BUILT_PRODUCTS_DIR; }; + F91DDBF53CAA8E4E28D13B1B70CECC31 /* UXMThumbnailView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMThumbnailView.swift; sourceTree = ""; }; + FBB095FEC4FEDD501B41714C64A55EBC /* UXMAction.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMAction.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 1D9AB7D6437976EB5224E6F01B05E400 /* Frameworks */ = { + 5527D6FA5B2A372C4B2DD227E7B02769 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - AEBCD8510D17EB5BB1AF97C56DA3E0A4 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 4CF0BB5202264D8B9A75BF1A4424E192 /* Frameworks */ = { + 925C58307F2CC497977A2DE97458D558 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 571850ACFD31D49D6915D59AD046D6D0 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 849C03B3857198A4F0552B45D927C18B /* Frameworks */ = { + CB21F7A2F502E5BBA6C01ACF2D0A040C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A541F16F605856534EE1CB630D115E97 /* Foundation.framework in Frameworks */, + AAEEC0221A86FE305C2CF959E05DFE2B /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 00138C775C9CCC4143EBE26A0F9D141F /* UXMPDFKit */ = { + 21A2A9A2C13C97E0A00B0456081738B9 /* TextParser */ = { isa = PBXGroup; children = ( - A083585FF5599659E2041632E7C5F5C4 /* Pod */, - 979A0E9CA81EA780D9E508F7D7F685F3 /* Resources */, - 08E11616A3BF33064960AD15033FFA4E /* Support Files */, + EDFFC61381241BF0A37B958E0C7E8CD7 /* UXMTextParser.swift */, ); - name = UXMPDFKit; - path = ../..; + name = TextParser; + path = Pod/Classes/TextParser; sourceTree = ""; }; - 08E11616A3BF33064960AD15033FFA4E /* Support Files */ = { + 3503DFDE984D50C742C87AC263C4F3D3 /* View */ = { isa = PBXGroup; children = ( - C427B08E12D2A5801438BEBFC96520BD /* Info.plist */, - A96B3532B35536E9DE978DE5DE13E668 /* ResourceBundle-UXMPDFKit-Info.plist */, - A0181833A6A33E2F39D632638FA039C1 /* UXMPDFKit.modulemap */, - A4813EE89CCCB14693E9B61A6CD6117F /* UXMPDFKit.xcconfig */, - 3CC32D4C69A270C7F52DFE49BEE6E162 /* UXMPDFKit-dummy.m */, - 614525CCFB2767D95FE12EEEC2FD622C /* UXMPDFKit-prefix.pch */, - 38A6B7046D88F318BCDF67B75969CABF /* UXMPDFKit-umbrella.h */, + 7E6E306F1F3E4010D2A1A2933D7B3C0F /* ResizeableView.swift */, + 4412986261FBEDF7D9EF42E50B8D067B /* UXMBarButton.swift */, ); - name = "Support Files"; - path = "Example/Pods/Target Support Files/UXMPDFKit"; + name = View; + path = Pod/Classes/View; sourceTree = ""; }; - 0D5534176FDA413966A2FA057AB7673C /* Annotations */ = { + 4FE10B3BB3D1B14EF29D554836735AD0 /* Products */ = { isa = PBXGroup; children = ( - 46276AA25C0911175B06F6F426E499D5 /* PDFAnnotation.swift */, - 9731359E2EA43A65C0297BACA691EFDC /* PDFAnnotationController.swift */, - B68ECDBCA8C7CBFC7A4C746BEAA00756 /* PDFAnnotationStore.swift */, - B9875B88D900C485C9301E8616F19BC5 /* PDFPathAnnotation.swift */, - 36255D8C8E8839365B8EB3FF153756B5 /* PDFTextAnnotation.swift */, + DF315C998D5E4A0AA3B52E81C470D1FE /* Pods_UXMPDFKit_Example.framework */, + F83CFB9C26AB5C4569E64E4CCE777047 /* UXMPDFKit.bundle */, + 52EED9C6DFEB791138FDDC8910DFEAEC /* UXMPDFKit.framework */, ); - path = Annotations; + name = Products; sourceTree = ""; }; - 0F2EF4198B8CF05B867C8F5A18697809 /* Extensions */ = { + 56485CFAD8696111B177F54A5D2F9424 /* Targets Support Files */ = { isa = PBXGroup; children = ( - 0EF790A1D01AB3417430203D9D7EFB14 /* UIImage.swift */, - 612E003D1E424A7200C42D3E /* CGPoint.swift */, - 612E00401E424EBF00C42D3E /* CGRect.swift */, - 38629AEF1DDA548700DF2B43 /* UIColor.swift */, - 610688711E3A4F9900A85AF0 /* UIViewController.swift */, + 67EFBC233F493BF0C61341A1403C17B8 /* Pods-UXMPDFKit_Example */, ); - path = Extensions; + name = "Targets Support Files"; sourceTree = ""; }; - 2267295D4FF13F19ED68658643D87819 /* Form */ = { + 5A759173F9ADEB396033C85558C44DA2 /* Extensions */ = { isa = PBXGroup; children = ( - 64082BD427D609690F7BB6818051DE3D /* PDFArray.swift */, - 7F0671AD3DB0F8A78F7FA1753FD4D804 /* PDFDictionary.swift */, - FB4C067E14A9564492BD5FDF5871991B /* PDFFormButtonField.swift */, - 6EC48780BD915E4D5ACCE82C88A1AB13 /* PDFFormField.swift */, - 315197F935F69EEBFF1F92849523A564 /* PDFFormPageView.swift */, - 86698FA335844AF90C62A0038C5B4B9C /* PDFFormSignatureField.swift */, - A83C4D21E86A879510E1AA0F444C9882 /* PDFFormTextField.swift */, - 2E445E04379E4222CB9A066D36A01E7C /* PDFFormViewController.swift */, - C71407B9D27B023DFC53AEEA70B040CB /* PDFObjectParser.swift */, - 38629AF11DDA55DF00DF2B43 /* PDFToggleButton.swift */, - ); - path = Form; + 6F4646F7A314CA0A26F1ACDC47AB837A /* CGPoint.swift */, + C7466E5849F06D225CCA4D645D6A93F0 /* CGRect.swift */, + 7A26699CB4A0ACE8BA952719833D636B /* UIColor.swift */, + 7E5BAA83AA300B662A40ED4283DBA847 /* UIImage.swift */, + 51B6496B6BCA4EA629ACCB7D31662B51 /* UIScreen.swift */, + C7B027998FF3FEB5BF45CB2B41F0F620 /* UIView.swift */, + 96FD903479BD37A08EE400CF03185285 /* UIViewController.swift */, + ); + name = Extensions; + path = Pod/Classes/Extensions; sourceTree = ""; }; - 318E3AFCB1B7A601FCFD36A1F1E2D215 /* Development Pods */ = { + 67EFBC233F493BF0C61341A1403C17B8 /* Pods-UXMPDFKit_Example */ = { isa = PBXGroup; children = ( - 00138C775C9CCC4143EBE26A0F9D141F /* UXMPDFKit */, + 25DED061B5E7463EF124C75C2AD629FE /* Pods-UXMPDFKit_Example.modulemap */, + EA450F176B754F388F5F502B355BD12C /* Pods-UXMPDFKit_Example-acknowledgements.markdown */, + EB2AB31F50EE9C5F90DABF7E1F93DCF7 /* Pods-UXMPDFKit_Example-acknowledgements.plist */, + A17D846FE0A9F7B9ECDE0CC3ECA2AA0A /* Pods-UXMPDFKit_Example-dummy.m */, + E1AAD6C20A06D2FDAD515937D22CA1AC /* Pods-UXMPDFKit_Example-frameworks.sh */, + DBBE17E8FE26B58E6EBF1ABC71A2CD74 /* Pods-UXMPDFKit_Example-Info.plist */, + 932974CCD2A444CB2EA4D524E45173AD /* Pods-UXMPDFKit_Example-umbrella.h */, + ED92938D073F3CBF339E581A6F042A15 /* Pods-UXMPDFKit_Example.debug.xcconfig */, + 953F5F2EA710FEF04EA2714303BDB1B8 /* Pods-UXMPDFKit_Example.release.xcconfig */, ); - name = "Development Pods"; + name = "Pods-UXMPDFKit_Example"; + path = "Target Support Files/Pods-UXMPDFKit_Example"; sourceTree = ""; }; - 324D8889BBF1842A8967F51028F0D554 /* Pod */ = { + 9B055D0CFEA43187E72B03DED11F5662 /* iOS */ = { isa = PBXGroup; children = ( - AC09AA8151ECC4D8DF379AC7A4DE44F3 /* Assets */, + CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */, ); - path = Pod; + name = iOS; sourceTree = ""; }; - 459AC960074E2604A104023B48ECFF7C /* Renderer */ = { + B06D7E9724442DF99985B9F154070B8F /* Renderer */ = { isa = PBXGroup; children = ( - 76DA813643EF21961CF0953E75AD135F /* CGPDFDocument.swift */, - 4E1B16E7B9A2A6B1300E0AE0B3DD0ED6 /* PDFDocument.swift */, - E49FB5E98854EBDE8CCAB4C0137D1986 /* PDFDocumentLink.swift */, - C363DF92B0BB7081898E123695AED3A2 /* PDFPageContent.swift */, - A494B21C53F5EAC8E75CE8E354CAF951 /* PDFPageContentView.swift */, - C690BCEDB59958B45834FDDEEF382E58 /* PDFPageScrubber.swift */, - 43266A476FB5C6ADDCCBECEB16E9D513 /* PDFPageScrubberThumb.swift */, - EC4678DC63259E1E556B22354639F826 /* PDFPageScrubberTrackControl.swift */, - AE1C7B951EC7E6CED0390CF07A023630 /* PDFPageTileLayer.swift */, - B7D9346501AFA05A330677D39DB1650F /* PDFRenderer.swift */, - 14E3AEB01DD6ED3800CC9C60 /* PDFSinglePageCell.swift */, - F33BD08506077733D10565FD32AAE01D /* PDFSinglePageViewer.swift */, - C9FE943FC9A290F6F65198FF53EF96E6 /* PDFSnapshotCache.swift */, - C6C164216F04F2C8E8102F383F660F44 /* PDFThumbnailView.swift */, - 61561CB21DDA7B4E00C314EB /* PDFThumbnailViewController.swift */, - 61561CB51DDA7F6200C314EB /* PDFThumbnailViewCell.swift */, - C998B073AF0AE6121E63EFF482E2E251 /* PDFViewController.swift */, - ); - path = Renderer; + 7D54DAFCC45AD7F9E59716F16C439162 /* CGPDFDocument.swift */, + 4F5EBD76909971E83FAA2F0F77F1BC91 /* UXMDocumentLink.swift */, + 09593FE46C3115CEC2659E3064FDFD52 /* UXMPageContent.swift */, + B1CEE956C7C0183D61F5EAB2DCD1FC28 /* UXMPageContentView.swift */, + 379D16636EB184F38D53E912EF17BA64 /* UXMPageScrubber.swift */, + 49417F8A6C60B24EF4318CDF18941FEC /* UXMPageScrubberThumb.swift */, + C719C91AE845F5D2FD98C36B4BEDF7F2 /* UXMPageScrubberTrackControl.swift */, + 7F305666A53A9576919F9D8DDE71D3FE /* UXMPageTileLayer.swift */, + EEC9DA5610A4CFE8C0473F36F0595036 /* UXMPDFDocument.swift */, + 8006C2DFBCBB3C93CBFED2995373BF2B /* UXMPDFViewController.swift */, + 352E322B4492AC613FA7743DED214C01 /* UXMRenderer.swift */, + DEEBFBA4B8C2D5F9902E0C6D68633ECA /* UXMSinglePageCell.swift */, + A4C626B8424EEEA55A8DEC6499CD83FA /* UXMSinglePageViewer.swift */, + 875F04A41E32AE4DB3742368E7004BBB /* UXMSnapshotCache.swift */, + F91DDBF53CAA8E4E28D13B1B70CECC31 /* UXMThumbnailView.swift */, + 729A667064EA9936801DCFAF911C8E97 /* UXMThumbnailViewCell.swift */, + 32CEDE3FB3A8F227776FA1A682D0024E /* UXMThumbnailViewController.swift */, + ); + name = Renderer; + path = Pod/Classes/Renderer; sourceTree = ""; }; - 546BB7A2873A587864100A030E28B105 /* Targets Support Files */ = { + BA71A175B11A598F98B3576EFD383B28 /* Annotations */ = { isa = PBXGroup; children = ( - 5B7D162BC35F470E2CAC1257E8A5946E /* Pods-UXMPDFKit_Example */, - ); - name = "Targets Support Files"; + 08DBC90C86301A17AE53FD91C248C5AA /* UXMAnnotation.swift */, + 9AD1E58B84E1DD5CAA8DA9C3AA7ACE4F /* UXMAnnotationController.swift */, + 57DAFFEFED84C6B613C919F6E11E90A2 /* UXMAnnotationStore.swift */, + C541D8CB9806406CE3BB959B87A230E8 /* UXMPathAnnotation.swift */, + 77E351D50E497B2A5919537B7BB7A905 /* UXMSignAnnotation.swift */, + F1295D8AC76D1852B8030D2943F7F7E4 /* UXMTextAnnotation.swift */, + ); + name = Annotations; + path = Pod/Classes/Annotations; sourceTree = ""; }; - 5A90FE0DFE2EBD8FE99BC387BEBFF1BC /* Products */ = { + BCF74BAA26B5B7D7484019444548135F /* Pod */ = { isa = PBXGroup; children = ( - 0E25E22600004B87F1FD6DE65F353057 /* Pods_UXMPDFKit_Example.framework */, - 36816B3ABA7674FDDFE94F22C8EC3FAB /* UXMPDFKit.bundle */, - EC338060A25E46404C16949C136E122D /* UXMPDFKit.framework */, + BBFA3CDB790241873E42276174E22D5D /* LICENSE */, + DC88BB6E3274477C6FC30923BC5DFB98 /* README.md */, + 93B18DCBE501EE2CA3AB512802929B45 /* UXMPDFKit.podspec */, ); - name = Products; + name = Pod; sourceTree = ""; }; - 5B7D162BC35F470E2CAC1257E8A5946E /* Pods-UXMPDFKit_Example */ = { + BE6D1D77533B826712A76AF7407950EF /* Development Pods */ = { isa = PBXGroup; children = ( - A599D61A3B46FD09E6025DE6E91F8D66 /* Info.plist */, - 923C8A6AA6EF26F1AFCE47B4B4307540 /* Pods-UXMPDFKit_Example.modulemap */, - 75574BE886F738F3093CE3A2F50EDEC8 /* Pods-UXMPDFKit_Example-acknowledgements.markdown */, - D7B61F1F28653D99DFE37D252E1BD160 /* Pods-UXMPDFKit_Example-acknowledgements.plist */, - EF5680F0C21DEB74F7B47666298F36DB /* Pods-UXMPDFKit_Example-dummy.m */, - F5E1EF2045F8CAE079FBBD1B47009647 /* Pods-UXMPDFKit_Example-frameworks.sh */, - 84EF34252AF2C6686B91CF82C433AF97 /* Pods-UXMPDFKit_Example-resources.sh */, - 73B9DE7CB16631F30FAE38D53282A2FE /* Pods-UXMPDFKit_Example-umbrella.h */, - 98269C964ED3DBB303CBAA1006CEE6AC /* Pods-UXMPDFKit_Example.debug.xcconfig */, - CF95F142877C93B0BAB858F7187F7D1C /* Pods-UXMPDFKit_Example.release.xcconfig */, + DCAFEC9E0109D7ABF735915AD2370276 /* UXMPDFKit */, ); - name = "Pods-UXMPDFKit_Example"; - path = "Target Support Files/Pods-UXMPDFKit_Example"; + name = "Development Pods"; sourceTree = ""; }; - 61C3A26F1EC3C0DF00807C4B /* View */ = { + BE8B4D2C78765B3CB025E9A2FF36F194 /* Form */ = { isa = PBXGroup; children = ( - BC1A9EB3AA234A93FFED5E5EC31C26C0 /* PDFBarButton.swift */, - 61C3A26D1EC2859A00807C4B /* ResizeableView.swift */, - ); - path = View; + 762D65A1ADB7C9E3D70280C4F34B4822 /* UXMArray.swift */, + 07D45D737FC8602D67AE935E9B78DC13 /* UXMDictionary.swift */, + A83F4F2BB75B923121E4058C9B49E5C8 /* UXMFormButtonField.swift */, + 1C02FAE7B5517778D27FC12DCE3C76AA /* UXMFormField.swift */, + 6F25EBDE2DBA00B2EEEF22ED5BCE6AF1 /* UXMFormPageView.swift */, + E9CE9F623C23FC20A57E2B4868458F3C /* UXMFormSignatureField.swift */, + F563B4A933F29C0EB628AC25E1D034CF /* UXMFormTextField.swift */, + 737C10965302DDAB8F8AC9A310ED6B38 /* UXMFormViewController.swift */, + 2C5F30D4A264044EBAFA74B1548089CD /* UXMObjectParser.swift */, + 6A15C24BE9B577CFE5B59F03560EF573 /* UXMToggleButton.swift */, + ); + name = Form; + path = Pod/Classes/Form; sourceTree = ""; }; - 61D72DBF1DDB7BEF003CE472 /* TextParser */ = { + CF1408CF629C7361332E53B88F7BD30C = { isa = PBXGroup; children = ( - 61D72DC01DDB7C15003CE472 /* PDFTextParser.swift */, + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, + BE6D1D77533B826712A76AF7407950EF /* Development Pods */, + D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */, + 4FE10B3BB3D1B14EF29D554836735AD0 /* Products */, + 56485CFAD8696111B177F54A5D2F9424 /* Targets Support Files */, ); - path = TextParser; sourceTree = ""; }; - 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */ = { + D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */ = { isa = PBXGroup; children = ( - CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */, + 9B055D0CFEA43187E72B03DED11F5662 /* iOS */, ); - name = iOS; + name = Frameworks; sourceTree = ""; }; - 7DB346D0F39D3F0E887471402A8071AB = { + DCAFEC9E0109D7ABF735915AD2370276 /* UXMPDFKit */ = { isa = PBXGroup; children = ( - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 318E3AFCB1B7A601FCFD36A1F1E2D215 /* Development Pods */, - BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, - 5A90FE0DFE2EBD8FE99BC387BEBFF1BC /* Products */, - 546BB7A2873A587864100A030E28B105 /* Targets Support Files */, + BA71A175B11A598F98B3576EFD383B28 /* Annotations */, + 5A759173F9ADEB396033C85558C44DA2 /* Extensions */, + BE8B4D2C78765B3CB025E9A2FF36F194 /* Form */, + EF97E1CC05B50DCF6B75E132962ACF65 /* Model */, + BCF74BAA26B5B7D7484019444548135F /* Pod */, + B06D7E9724442DF99985B9F154070B8F /* Renderer */, + ED3D370C52A6BF1FA69607C8AACD82C8 /* Resources */, + DE3C2DF274AEF2FF3E1608117D90277B /* Support Files */, + 21A2A9A2C13C97E0A00B0456081738B9 /* TextParser */, + 3503DFDE984D50C742C87AC263C4F3D3 /* View */, ); + name = UXMPDFKit; + path = ../..; sourceTree = ""; }; - 81336BCA9643382D6508CC16CB35EE81 /* Model */ = { + DE3C2DF274AEF2FF3E1608117D90277B /* Support Files */ = { isa = PBXGroup; children = ( - 69FD1010A27EE6442B7768D3B955DBF9 /* PDFAction.swift */, - 61D72DBA1DDB7039003CE472 /* PDFActionGoTo.swift */, - 61D72DBC1DDB705B003CE472 /* PDFActionURL.swift */, + 4C0444CC4E010F8A63E5F44DE7875296 /* ResourceBundle-UXMPDFKit-UXMPDFKit-Info.plist */, + 00E3209739A597A9528C7DDF2BC2180B /* UXMPDFKit.modulemap */, + F11AA7CF079743F72E84484332A1526D /* UXMPDFKit.xcconfig */, + 2A01E57E875087F54AA54F22CC28A2E1 /* UXMPDFKit-dummy.m */, + A0664E0B108D49FD61C28400B5E1045F /* UXMPDFKit-Info.plist */, + 6649F6B893EFD6A7FB6A6D6E36E52C57 /* UXMPDFKit-prefix.pch */, + A6E95B0D94B174CA4A7A5A379E507D29 /* UXMPDFKit-umbrella.h */, ); - path = Model; + name = "Support Files"; + path = "Example/Pods/Target Support Files/UXMPDFKit"; sourceTree = ""; }; - 979A0E9CA81EA780D9E508F7D7F685F3 /* Resources */ = { + ED3D370C52A6BF1FA69607C8AACD82C8 /* Resources */ = { isa = PBXGroup; children = ( - 324D8889BBF1842A8967F51028F0D554 /* Pod */, + 3E83558981FDBEE74AE82607C0A7EF55 /* Images.xcassets */, ); name = Resources; sourceTree = ""; }; - A083585FF5599659E2041632E7C5F5C4 /* Pod */ = { + EF97E1CC05B50DCF6B75E132962ACF65 /* Model */ = { isa = PBXGroup; children = ( - D17F081B2041A570628ABBA6B6B55AA2 /* Classes */, + FBB095FEC4FEDD501B41714C64A55EBC /* UXMAction.swift */, + 998A32C83E9824F624F989D7EC6DC875 /* UXMActionGoTo.swift */, + F7FE6A73A7B4DD26FE9D0FDDB940F6D7 /* UXMActionURL.swift */, ); - path = Pod; - sourceTree = ""; - }; - AC09AA8151ECC4D8DF379AC7A4DE44F3 /* Assets */ = { - isa = PBXGroup; - children = ( - C22425B0A3F84BE18A46849E29C823A0 /* Images.xcassets */, - ); - path = Assets; - sourceTree = ""; - }; - BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */, - ); - name = Frameworks; - sourceTree = ""; - }; - D17F081B2041A570628ABBA6B6B55AA2 /* Classes */ = { - isa = PBXGroup; - children = ( - 61C3A26F1EC3C0DF00807C4B /* View */, - 0D5534176FDA413966A2FA057AB7673C /* Annotations */, - 0F2EF4198B8CF05B867C8F5A18697809 /* Extensions */, - 2267295D4FF13F19ED68658643D87819 /* Form */, - 81336BCA9643382D6508CC16CB35EE81 /* Model */, - 459AC960074E2604A104023B48ECFF7C /* Renderer */, - 61D72DBF1DDB7BEF003CE472 /* TextParser */, - ); - path = Classes; + name = Model; + path = Pod/Classes/Model; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 53C150893EDE3FF26B25F4389C91540E /* Headers */ = { + 49D48559BC1AE32EABD11630C9913B32 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 4431B8FC918BE6C9C21DCC72EDA860E6 /* Pods-UXMPDFKit_Example-umbrella.h in Headers */, + 66C0AA9A006F6E003C58659FC92F13A2 /* Pods-UXMPDFKit_Example-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - E7AD556DFBA75846E3964ECDB643C739 /* Headers */ = { + A295CD79EC06698ABB0EB7D978844ECB /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - DE4A344370F68EA63CCA245BB42FF44A /* UXMPDFKit-umbrella.h in Headers */, + A89F167626D70627BC97499C82BA1499 /* UXMPDFKit-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 806AC9F20336348B8F1E6138E470491D /* UXMPDFKit */ = { + 62461F911964E382768E2ADEEA9915D9 /* Pods-UXMPDFKit_Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 5C7D5A2662D2A9AB5E7CE59CD239DB95 /* Build configuration list for PBXNativeTarget "UXMPDFKit" */; + buildConfigurationList = 2B03F247C5BAC3276CAE9A324C4CA0D3 /* Build configuration list for PBXNativeTarget "Pods-UXMPDFKit_Example" */; buildPhases = ( - 98A56FB3FD3FB5519F98F60AFCE59D1B /* Sources */, - 849C03B3857198A4F0552B45D927C18B /* Frameworks */, - ED93727C0550098E76C04AE96D4B68BE /* Resources */, - E7AD556DFBA75846E3964ECDB643C739 /* Headers */, + 49D48559BC1AE32EABD11630C9913B32 /* Headers */, + 079A2CDCDF617A4FAA6D0A1DBA259DC2 /* Sources */, + 925C58307F2CC497977A2DE97458D558 /* Frameworks */, + FAD46B1A7BE70B376821CD9E9C408C8A /* Resources */, ); buildRules = ( ); dependencies = ( - 9BE6807A248AAB746DE7056F757EB31F /* PBXTargetDependency */, + 5F9D5D4CE0AF1C20DED76CD94DF2DDBE /* PBXTargetDependency */, ); - name = UXMPDFKit; - productName = UXMPDFKit; - productReference = EC338060A25E46404C16949C136E122D /* UXMPDFKit.framework */; + name = "Pods-UXMPDFKit_Example"; + productName = "Pods-UXMPDFKit_Example"; + productReference = DF315C998D5E4A0AA3B52E81C470D1FE /* Pods_UXMPDFKit_Example.framework */; productType = "com.apple.product-type.framework"; }; - 9C492BC63E45F8B8D516D6487251ECE8 /* UXMPDFKit-UXMPDFKit */ = { + 8F9CC8B698EB7702368FB8BBDA601634 /* UXMPDFKit */ = { isa = PBXNativeTarget; - buildConfigurationList = 3ACF369ACBEDC0AF392EC3B7BC0E7802 /* Build configuration list for PBXNativeTarget "UXMPDFKit-UXMPDFKit" */; + buildConfigurationList = 8D52F3E8BD575C6CFE2AF5DDF38DC29A /* Build configuration list for PBXNativeTarget "UXMPDFKit" */; buildPhases = ( - 073A74B0A07977AD05C916BD9C12A883 /* Sources */, - 4CF0BB5202264D8B9A75BF1A4424E192 /* Frameworks */, - 03347CCBCE02AC7AC604FD79263C2BAF /* Resources */, + A295CD79EC06698ABB0EB7D978844ECB /* Headers */, + A2E17567A11B72F1F527A9F15C712B79 /* Sources */, + CB21F7A2F502E5BBA6C01ACF2D0A040C /* Frameworks */, + 3AB8E2CE655CD37964B3E135BE531680 /* Resources */, ); buildRules = ( ); dependencies = ( + EBFF5213301CB8B31B038DCBE830FA65 /* PBXTargetDependency */, ); - name = "UXMPDFKit-UXMPDFKit"; - productName = "UXMPDFKit-UXMPDFKit"; - productReference = 36816B3ABA7674FDDFE94F22C8EC3FAB /* UXMPDFKit.bundle */; - productType = "com.apple.product-type.bundle"; + name = UXMPDFKit; + productName = UXMPDFKit; + productReference = 52EED9C6DFEB791138FDDC8910DFEAEC /* UXMPDFKit.framework */; + productType = "com.apple.product-type.framework"; }; - D7C77B95095598F2FFA1E9456D29905E /* Pods-UXMPDFKit_Example */ = { + B18081AD223E357F1772DD977B2B2622 /* UXMPDFKit-UXMPDFKit */ = { isa = PBXNativeTarget; - buildConfigurationList = 525FD211AF92A10F91F03DE95E6719D1 /* Build configuration list for PBXNativeTarget "Pods-UXMPDFKit_Example" */; + buildConfigurationList = 3B8CCB40E9BDD36EF6D8D539067E6769 /* Build configuration list for PBXNativeTarget "UXMPDFKit-UXMPDFKit" */; buildPhases = ( - 9369D7C8F41BAF85CC912243F0FC33B6 /* Sources */, - 1D9AB7D6437976EB5224E6F01B05E400 /* Frameworks */, - 53C150893EDE3FF26B25F4389C91540E /* Headers */, + FB221CF9827616365E315D3E4D04ABB7 /* Sources */, + 5527D6FA5B2A372C4B2DD227E7B02769 /* Frameworks */, + D91D20A7667111C05B2CB76B13E9A258 /* Resources */, ); buildRules = ( ); dependencies = ( - C3EEE5E9BEFB08C924139EBE6E10FF70 /* PBXTargetDependency */, ); - name = "Pods-UXMPDFKit_Example"; - productName = "Pods-UXMPDFKit_Example"; - productReference = 0E25E22600004B87F1FD6DE65F353057 /* Pods_UXMPDFKit_Example.framework */; - productType = "com.apple.product-type.framework"; + name = "UXMPDFKit-UXMPDFKit"; + productName = "UXMPDFKit-UXMPDFKit"; + productReference = F83CFB9C26AB5C4569E64E4CCE777047 /* UXMPDFKit.bundle */; + productType = "com.apple.product-type.bundle"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + BFDFE7DC352907FC980B868725387E98 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0830; - TargetAttributes = { - D7C77B95095598F2FFA1E9456D29905E = { - LastSwiftMigration = 0820; - }; - }; + LastSwiftUpdateCheck = 0930; + LastUpgradeCheck = 0930; }; - buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); - mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = 5A90FE0DFE2EBD8FE99BC387BEBFF1BC /* Products */; + mainGroup = CF1408CF629C7361332E53B88F7BD30C; + productRefGroup = 4FE10B3BB3D1B14EF29D554836735AD0 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - D7C77B95095598F2FFA1E9456D29905E /* Pods-UXMPDFKit_Example */, - 806AC9F20336348B8F1E6138E470491D /* UXMPDFKit */, - 9C492BC63E45F8B8D516D6487251ECE8 /* UXMPDFKit-UXMPDFKit */, + 62461F911964E382768E2ADEEA9915D9 /* Pods-UXMPDFKit_Example */, + 8F9CC8B698EB7702368FB8BBDA601634 /* UXMPDFKit */, + B18081AD223E357F1772DD977B2B2622 /* UXMPDFKit-UXMPDFKit */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 03347CCBCE02AC7AC604FD79263C2BAF /* Resources */ = { + 3AB8E2CE655CD37964B3E135BE531680 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 136BBDBE476024706CB69316C2AAA8E2 /* UXMPDFKit.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D91D20A7667111C05B2CB76B13E9A258 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 4DFC30C056451573A629F3EA2C9378B7 /* Images.xcassets in Resources */, + BCBC7D84131B9D49AB875A5B3F25B1C8 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; - ED93727C0550098E76C04AE96D4B68BE /* Resources */ = { + FAD46B1A7BE70B376821CD9E9C408C8A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3718081077F2A6A3CB9DB4259C52A9A6 /* UXMPDFKit.bundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 073A74B0A07977AD05C916BD9C12A883 /* Sources */ = { + 079A2CDCDF617A4FAA6D0A1DBA259DC2 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + F44032805350D1E1D301682DE8589503 /* Pods-UXMPDFKit_Example-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 9369D7C8F41BAF85CC912243F0FC33B6 /* Sources */ = { + A2E17567A11B72F1F527A9F15C712B79 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6CBA8437445A566C49E81E0FA15F8B89 /* Pods-UXMPDFKit_Example-dummy.m in Sources */, + 4251835297584B417189204D61E506D0 /* CGPDFDocument.swift in Sources */, + DBA6419C16C0E2584BDEE934A86A7CAB /* CGPoint.swift in Sources */, + F4D10F3E222DDAD52354352E6515C032 /* CGRect.swift in Sources */, + 6A9A15EE477E277A14FA288FC7B5E865 /* ResizeableView.swift in Sources */, + DA448BB7BBEB6F6E08A50747B13E44FF /* UIColor.swift in Sources */, + EF2BA6EFE1A9356E3BC925127C0E3FF0 /* UIImage.swift in Sources */, + 37EB5C1ECB8FBF934C11E1E73F3C2022 /* UIScreen.swift in Sources */, + 841BE296A8ED59681137FDC0F4FC2E0D /* UIView.swift in Sources */, + D58A7C8DF74F6CE0CC1BC193B90F5E70 /* UIViewController.swift in Sources */, + D64728A53D6EE7BA9FA91026C335E719 /* UXMAction.swift in Sources */, + 43614C4545E0FF920984CD0D5AED409B /* UXMActionGoTo.swift in Sources */, + 356FE7A72B89DD070A15692ADEDDEAFF /* UXMActionURL.swift in Sources */, + 5AB8A72CE7CD8AACF8F69B3533FD14C8 /* UXMAnnotation.swift in Sources */, + FA438F8C35B70888B0518E2B4C22EE22 /* UXMAnnotationController.swift in Sources */, + 980D70AF6AEC797FB89CB8312D116645 /* UXMAnnotationStore.swift in Sources */, + CB0400B6986109E95202CF5E1026CD21 /* UXMArray.swift in Sources */, + 1C10A1135D687EB61CBD22095FA5395B /* UXMBarButton.swift in Sources */, + 42B42F04D9F99F92FC1A935F1CB2BF86 /* UXMDictionary.swift in Sources */, + A9458D69B4D46952862681919BE9DD1E /* UXMDocumentLink.swift in Sources */, + 1250E6776356E100E9DC14FBCFF2B037 /* UXMFormButtonField.swift in Sources */, + E64BF6495808F9103FB45A5089B385FF /* UXMFormField.swift in Sources */, + BF75A8BDA9F9AEDE8E233721EFC34E85 /* UXMFormPageView.swift in Sources */, + 28F2C060F4EAB1D09B4A58C18AA7962C /* UXMFormSignatureField.swift in Sources */, + B6B55F1C62F772558F9F9D1199F3EA07 /* UXMFormTextField.swift in Sources */, + 638D81AA2C840054E120FFC48C446358 /* UXMFormViewController.swift in Sources */, + 24DB87C576BECEF1750821B31F5F080A /* UXMObjectParser.swift in Sources */, + 6462D115812637A01B2E17F07C8CFEDE /* UXMPageContent.swift in Sources */, + 894A1B75AC4BAB454B94ADE62CC5E3EE /* UXMPageContentView.swift in Sources */, + 73DB3164507CBDDA1B6D3F34D8463A56 /* UXMPageScrubber.swift in Sources */, + DFA7C63060BDF746941C4B5E1E76A851 /* UXMPageScrubberThumb.swift in Sources */, + 882F787CA5CC4504E8909353CAB76F20 /* UXMPageScrubberTrackControl.swift in Sources */, + 56C65EAAB99CAB4F4F0807DF50FEA8F8 /* UXMPageTileLayer.swift in Sources */, + 4067F8F4B76B08D5D240E52074D6F054 /* UXMPathAnnotation.swift in Sources */, + 169527322DA9731208A8D6D0F185783F /* UXMPDFDocument.swift in Sources */, + BF1C004F79B1DFDF40AB3C5CE7F5A3D5 /* UXMPDFKit-dummy.m in Sources */, + 96253ECC10010433A78ECA627018EBCC /* UXMPDFViewController.swift in Sources */, + 9456E3E836B8E60BC7D4CC5DD0238A1A /* UXMRenderer.swift in Sources */, + 5C701F3E5503C9E45A02B11C71E0DA49 /* UXMSignAnnotation.swift in Sources */, + 4804B2FAD1753BDAC0B997BA4FBA3414 /* UXMSinglePageCell.swift in Sources */, + 96D2109755C4E3EDB546A2FCC107051F /* UXMSinglePageViewer.swift in Sources */, + D966C5918E9416C1A2BBE2D385B53ED5 /* UXMSnapshotCache.swift in Sources */, + 3CEA23416ECE2712887613C6D3FA1407 /* UXMTextAnnotation.swift in Sources */, + 7695D223316C5E49AA9B88E809BB4042 /* UXMTextParser.swift in Sources */, + EBFF37DCC8DAC16BEBC5233A47B8CCEE /* UXMThumbnailView.swift in Sources */, + 434F4BFFC909FD9FC9EC39D000EBEDAB /* UXMThumbnailViewCell.swift in Sources */, + B1BB02018B2C75CED34AAD08DE4AF15E /* UXMThumbnailViewController.swift in Sources */, + 6D36DD344B08FFEC67C14149926EDE80 /* UXMToggleButton.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 98A56FB3FD3FB5519F98F60AFCE59D1B /* Sources */ = { + FB221CF9827616365E315D3E4D04ABB7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DEEE49CA145C9CAFCB54635C31D6F6E6 /* CGPDFDocument.swift in Sources */, - 4B1F57EBF4BECAEC47EEF57BD3CA1AD7 /* PDFAction.swift in Sources */, - B564F9589CA9317A04F24F9DC40AC5AA /* PDFAnnotation.swift in Sources */, - E8C31B918E22C5EB41B659A64E076416 /* PDFAnnotationController.swift in Sources */, - 61D72DBD1DDB705B003CE472 /* PDFActionURL.swift in Sources */, - 00703477D03E535E1BFA3A7169814C2C /* PDFAnnotationStore.swift in Sources */, - C1EDA6F9A885F21D2887845369237062 /* PDFArray.swift in Sources */, - 61561CB41DDA7C6100C314EB /* PDFThumbnailViewController.swift in Sources */, - 75332EB7DF07634FEBA4DB30AED834DE /* PDFBarButton.swift in Sources */, - 27F938F715132EBBE5F6903A0029CA2B /* PDFDictionary.swift in Sources */, - 612E003F1E424A9E00C42D3E /* CGPoint.swift in Sources */, - 02F91569195B82122C93CD73F89BF123 /* PDFDocument.swift in Sources */, - 610688731E3A52BD00A85AF0 /* UIViewController.swift in Sources */, - 4226B8E079C7A46273F41F374F2D54EB /* PDFDocumentLink.swift in Sources */, - C4E224C0D0BFCC63723ACA2EDB266CC6 /* PDFFormButtonField.swift in Sources */, - 0168C787039F39EFC7CC717928780ECE /* PDFFormField.swift in Sources */, - 612E00421E424F3E00C42D3E /* CGRect.swift in Sources */, - 61D72DC11DDB7C15003CE472 /* PDFTextParser.swift in Sources */, - 14E3AEB11DD6ED3800CC9C60 /* PDFSinglePageCell.swift in Sources */, - DD3034BF3EE6DA6D91BBF74EAEAC456E /* PDFFormPageView.swift in Sources */, - 61D72DBE1DDB7062003CE472 /* PDFActionGoTo.swift in Sources */, - C4ECF8B8556E26A1DF679C202AC9B641 /* PDFFormSignatureField.swift in Sources */, - F9C1E676BBEAC0A22212CD00437C1073 /* PDFFormTextField.swift in Sources */, - 1A6C84063FC233E27AEA75D7300DFD96 /* PDFFormViewController.swift in Sources */, - 61C3A26E1EC2859A00807C4B /* ResizeableView.swift in Sources */, - CC2919A41AAA5F6BCC83D700E574345F /* PDFObjectParser.swift in Sources */, - CE63E30770B2CDD35ED208AF2A284F5B /* PDFPageContent.swift in Sources */, - F77D80C31A9B9DBED9D3A258932F9922 /* PDFPageContentView.swift in Sources */, - B6610EC0BB6FC688BE01E6A0CEDAC1E8 /* PDFPageScrubber.swift in Sources */, - 026FEED112A93B09A02BE58F8F025312 /* PDFPageScrubberThumb.swift in Sources */, - E2EE8D087924795726295ABA80B0079F /* PDFPageScrubberTrackControl.swift in Sources */, - 38629AF01DDA548700DF2B43 /* UIColor.swift in Sources */, - C02189E300C9F94935CFF78ECD34CA3B /* PDFPageTileLayer.swift in Sources */, - 075383BD36B769E863ED5F59FA08F555 /* PDFPathAnnotation.swift in Sources */, - D09FB06765B5FCD7A81F58BE68B1BDED /* PDFRenderer.swift in Sources */, - 75EBCC5DA128D1197EE38C0D71ED2E61 /* PDFSinglePageViewer.swift in Sources */, - 38629AF21DDA55DF00DF2B43 /* PDFToggleButton.swift in Sources */, - 298424542AE0A9D498FF405DFA338D75 /* PDFSnapshotCache.swift in Sources */, - 14ED9AA74A5A2E807B36B928AAE04F32 /* PDFTextAnnotation.swift in Sources */, - 536A83F7FA72186229EBF285914A5B78 /* PDFThumbnailView.swift in Sources */, - 37C1CD56A692371828740DFCEE4A9128 /* PDFViewController.swift in Sources */, - EF0C3B060264BDE888EFCB98B2E95088 /* UIImage.swift in Sources */, - 61561CB61DDA7F6200C314EB /* PDFThumbnailViewCell.swift in Sources */, - EA02320D912547EAE5017330C7835B18 /* UXMPDFKit-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 9BE6807A248AAB746DE7056F757EB31F /* PBXTargetDependency */ = { + 5F9D5D4CE0AF1C20DED76CD94DF2DDBE /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "UXMPDFKit-UXMPDFKit"; - target = 9C492BC63E45F8B8D516D6487251ECE8 /* UXMPDFKit-UXMPDFKit */; - targetProxy = E19880B3709917456341F3D38E3AAC50 /* PBXContainerItemProxy */; + name = UXMPDFKit; + target = 8F9CC8B698EB7702368FB8BBDA601634 /* UXMPDFKit */; + targetProxy = F98F184F8CA7BE07D558F77659AAD05A /* PBXContainerItemProxy */; }; - C3EEE5E9BEFB08C924139EBE6E10FF70 /* PBXTargetDependency */ = { + EBFF5213301CB8B31B038DCBE830FA65 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = UXMPDFKit; - target = 806AC9F20336348B8F1E6138E470491D /* UXMPDFKit */; - targetProxy = 1E1EE300810192D509C81620ADAD5F2A /* PBXContainerItemProxy */; + name = "UXMPDFKit-UXMPDFKit"; + target = B18081AD223E357F1772DD977B2B2622 /* UXMPDFKit-UXMPDFKit */; + targetProxy = 459EAE1E3294B1297887E072F48FD575 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 16FD4E82C3422F35D6BECF3CA34D7D33 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = A4813EE89CCCB14693E9B61A6CD6117F /* UXMPDFKit.xcconfig */; - buildSettings = { - CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/UXMPDFKit"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - PRODUCT_NAME = UXMPDFKit; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - WRAPPER_EXTENSION = bundle; - }; - name = Debug; - }; - 4292339A0A86E71445EE70994681FDEB /* Release */ = { + 2D072C105F653C527F31A8CAB4B4F4E8 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A4813EE89CCCB14693E9B61A6CD6117F /* UXMPDFKit.xcconfig */; + baseConfigurationReference = F11AA7CF079743F72E84484332A1526D /* UXMPDFKit.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/UXMPDFKit"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-Info.plist"; + INFOPLIST_FILE = "Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-UXMPDFKit-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; PRODUCT_NAME = UXMPDFKit; SDKROOT = iphoneos; @@ -655,281 +639,316 @@ }; name = Release; }; - 79C5EF50AA494113B2C3B5F8DC79D20C /* Release */ = { + 89B73A1AF15FBABD27767FB984F1B751 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A4813EE89CCCB14693E9B61A6CD6117F /* UXMPDFKit.xcconfig */; + baseConfigurationReference = F11AA7CF079743F72E84484332A1526D /* UXMPDFKit.xcconfig */; buildSettings = { + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; GCC_PREFIX_HEADER = "Target Support Files/UXMPDFKit/UXMPDFKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/UXMPDFKit/Info.plist"; + INFOPLIST_FILE = "Target Support Files/UXMPDFKit/UXMPDFKit-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/UXMPDFKit/UXMPDFKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_MODULE_NAME = UXMPDFKit; PRODUCT_NAME = UXMPDFKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; - 9175E73BFC95BA3C68150FC02E443C40 /* Debug */ = { + A8F27C82371BBC1B9E61E0F115FA1098 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F11AA7CF079743F72E84484332A1526D /* UXMPDFKit.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/UXMPDFKit"; + INFOPLIST_FILE = "Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-UXMPDFKit-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + PRODUCT_NAME = UXMPDFKit; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = bundle; + }; + name = Debug; + }; + AB4D69770D8ACE3A05E80BB3502666F6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "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 = 9.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + B6DF0BAA53458D08B1D9694B8D08EDE7 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A4813EE89CCCB14693E9B61A6CD6117F /* UXMPDFKit.xcconfig */; + baseConfigurationReference = ED92938D073F3CBF339E581A6F042A15 /* Pods-UXMPDFKit_Example.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/UXMPDFKit/UXMPDFKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/UXMPDFKit/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/UXMPDFKit/UXMPDFKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = UXMPDFKit; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; - A50DC6C4213258C6A36D31EB3282422B /* Release */ = { + DDCC6F5AFCCF36E41CFC8235F71F1E2E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = CF95F142877C93B0BAB858F7187F7D1C /* Pods-UXMPDFKit_Example.release.xcconfig */; + baseConfigurationReference = 953F5F2EA710FEF04EA2714303BDB1B8 /* Pods-UXMPDFKit_Example.release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CLANG_ENABLE_MODULES = YES; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-UXMPDFKit_Example/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MODULEMAP_FILE = "Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_UXMPDFKit_Example; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; - AD24A8B772A3AB80F338EF6B452909A0 /* Release */ = { + F232B5ECA11A71BFA199A229B323F454 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; + 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_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "POD_CONFIGURATION_RELEASE=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.1; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; STRIP_INSTALLED_PRODUCT = NO; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 4.2; SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; }; name = Release; }; - BDEC3DA845473F8FD47C9EE623A1CC11 /* Debug */ = { + FA41AD9979EC6FFF61EC2E739BE8D5E0 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 98269C964ED3DBB303CBAA1006CEE6AC /* Pods-UXMPDFKit_Example.debug.xcconfig */; + baseConfigurationReference = F11AA7CF079743F72E84484332A1526D /* UXMPDFKit.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-UXMPDFKit_Example/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/UXMPDFKit/UXMPDFKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/UXMPDFKit/UXMPDFKit-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_UXMPDFKit_Example; + MODULEMAP_FILE = "Target Support Files/UXMPDFKit/UXMPDFKit.modulemap"; + PRODUCT_MODULE_NAME = UXMPDFKit; + PRODUCT_NAME = UXMPDFKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; - F15098F4E21DD883A1445CB810C455E8 /* 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; - 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; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - 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 = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.1; - ONLY_ACTIVE_ARCH = YES; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + 2B03F247C5BAC3276CAE9A324C4CA0D3 /* Build configuration list for PBXNativeTarget "Pods-UXMPDFKit_Example" */ = { isa = XCConfigurationList; buildConfigurations = ( - F15098F4E21DD883A1445CB810C455E8 /* Debug */, - AD24A8B772A3AB80F338EF6B452909A0 /* Release */, + B6DF0BAA53458D08B1D9694B8D08EDE7 /* Debug */, + DDCC6F5AFCCF36E41CFC8235F71F1E2E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 3ACF369ACBEDC0AF392EC3B7BC0E7802 /* Build configuration list for PBXNativeTarget "UXMPDFKit-UXMPDFKit" */ = { + 3B8CCB40E9BDD36EF6D8D539067E6769 /* Build configuration list for PBXNativeTarget "UXMPDFKit-UXMPDFKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 16FD4E82C3422F35D6BECF3CA34D7D33 /* Debug */, - 4292339A0A86E71445EE70994681FDEB /* Release */, + A8F27C82371BBC1B9E61E0F115FA1098 /* Debug */, + 2D072C105F653C527F31A8CAB4B4F4E8 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 525FD211AF92A10F91F03DE95E6719D1 /* Build configuration list for PBXNativeTarget "Pods-UXMPDFKit_Example" */ = { + 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - BDEC3DA845473F8FD47C9EE623A1CC11 /* Debug */, - A50DC6C4213258C6A36D31EB3282422B /* Release */, + AB4D69770D8ACE3A05E80BB3502666F6 /* Debug */, + F232B5ECA11A71BFA199A229B323F454 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 5C7D5A2662D2A9AB5E7CE59CD239DB95 /* Build configuration list for PBXNativeTarget "UXMPDFKit" */ = { + 8D52F3E8BD575C6CFE2AF5DDF38DC29A /* Build configuration list for PBXNativeTarget "UXMPDFKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 9175E73BFC95BA3C68150FC02E443C40 /* Debug */, - 79C5EF50AA494113B2C3B5F8DC79D20C /* Release */, + FA41AD9979EC6FFF61EC2E739BE8D5E0 /* Debug */, + 89B73A1AF15FBABD27767FB984F1B751 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; } diff --git a/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme deleted file mode 100644 index a2f2807..0000000 --- a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Info.plist b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Info.plist old mode 100644 new mode 100755 diff --git a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-Info.plist b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-acknowledgements.markdown old mode 100644 new mode 100755 diff --git a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-acknowledgements.plist old mode 100644 new mode 100755 diff --git a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-dummy.m b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-dummy.m old mode 100644 new mode 100755 diff --git a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-frameworks.sh b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-frameworks.sh index 52997f1..a1828e4 100755 --- a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-frameworks.sh +++ b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-frameworks.sh @@ -1,11 +1,33 @@ #!/bin/sh set -e +set -u +set -o pipefail + +function on_error { + echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" +} +trap 'on_error $LINENO' ERR + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -19,19 +41,24 @@ install_framework() local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" + echo "Symlinked..." + source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then binary="${destination}/${basename}" + elif [ -L "${binary}" ]; then + echo "Destination binary is symlinked..." + dirname="$(dirname "${binary}")" + binary="${dirname}/$(readlink "${binary}")" fi # Strip invalid architectures so "fat" simulator / device frameworks work on device @@ -45,7 +72,7 @@ install_framework() # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) for lib in $swift_runtime_libs; do echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" @@ -54,38 +81,83 @@ install_framework() fi } +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" + else + # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identitiy + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identity echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } # Strip invalid architectures strip_invalid_archs() { binary="$1" - # Get architectures for current file - archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi stripped="" - for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + lipo -remove "$arch" -output "$binary" "$binary" stripped="$stripped $arch" fi done if [[ "$stripped" ]]; then echo "Stripped $binary of architectures:$stripped" fi + STRIP_BINARY_RETVAL=1 } if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/UXMPDFKit/UXMPDFKit.framework" + install_framework "${BUILT_PRODUCTS_DIR}/UXMPDFKit/UXMPDFKit.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/UXMPDFKit/UXMPDFKit.framework" + install_framework "${BUILT_PRODUCTS_DIR}/UXMPDFKit/UXMPDFKit.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait fi diff --git a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-resources.sh b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-resources.sh index 25e9d37..345301f 100755 --- a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-resources.sh +++ b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-resources.sh @@ -1,5 +1,13 @@ #!/bin/sh set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" @@ -8,7 +16,11 @@ RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt XCASSET_FILES=() -case "${TARGETED_DEVICE_FAMILY}" in +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in 1,2) TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" ;; @@ -18,6 +30,12 @@ case "${TARGETED_DEVICE_FAMILY}" in 2) TARGET_DEVICE_ARGS="--target-device ipad" ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; *) TARGET_DEVICE_ARGS="--target-device mac" ;; @@ -38,29 +56,29 @@ EOM fi case $RESOURCE_PATH in *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} ;; *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" ;; *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" ;; *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" ;; *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" ;; *.xcassets) @@ -68,7 +86,7 @@ EOM XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") ;; *) - echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" || true echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" ;; esac @@ -82,7 +100,7 @@ if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then fi rm -f "$RESOURCES_TO_COPY" -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] then # Find all other xcassets (this unfortunately includes those of path pods and other targets). OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) @@ -92,5 +110,9 @@ then fi done <<<"$OTHER_XCASSETS" - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi fi diff --git a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-umbrella.h b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-umbrella.h old mode 100644 new mode 100755 index a31bb47..6ec08b3 --- a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-umbrella.h +++ b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.debug.xcconfig b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.debug.xcconfig old mode 100644 new mode 100755 index b328b02..457e881 --- a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.debug.xcconfig +++ b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.debug.xcconfig @@ -1,11 +1,11 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/UXMPDFKit" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/UXMPDFKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/UXMPDFKit/UXMPDFKit.framework/Headers" LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/UXMPDFKit/UXMPDFKit.framework/Headers" OTHER_LDFLAGS = $(inherited) -framework "UXMPDFKit" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.modulemap b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.modulemap old mode 100644 new mode 100755 diff --git a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.release.xcconfig b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.release.xcconfig old mode 100644 new mode 100755 index b328b02..457e881 --- a/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.release.xcconfig +++ b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.release.xcconfig @@ -1,11 +1,11 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/UXMPDFKit" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/UXMPDFKit" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/UXMPDFKit/UXMPDFKit.framework/Headers" LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/UXMPDFKit/UXMPDFKit.framework/Headers" OTHER_LDFLAGS = $(inherited) -framework "UXMPDFKit" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/UXMPDFKit/Info.plist b/Example/Pods/Target Support Files/UXMPDFKit/Info.plist old mode 100644 new mode 100755 index 1c2e79e..89a33ca --- a/Example/Pods/Target Support Files/UXMPDFKit/Info.plist +++ b/Example/Pods/Target Support Files/UXMPDFKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.5.1 + 0.8.3 CFBundleSignature ???? CFBundleVersion diff --git a/Example/Pods/Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-Info.plist b/Example/Pods/Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-Info.plist old mode 100644 new mode 100755 index 0a6e74f..d155756 --- a/Example/Pods/Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-Info.plist +++ b/Example/Pods/Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-Info.plist @@ -13,7 +13,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.5.1 + 0.8.3 CFBundleSignature ???? CFBundleVersion diff --git a/Example/Pods/Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-UXMPDFKit-Info.plist b/Example/Pods/Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-UXMPDFKit-Info.plist new file mode 100644 index 0000000..d155756 --- /dev/null +++ b/Example/Pods/Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-UXMPDFKit-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + BNDL + CFBundleShortVersionString + 0.8.3 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-Info.plist b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-Info.plist new file mode 100644 index 0000000..89a33ca --- /dev/null +++ b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.8.3 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-dummy.m b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-dummy.m old mode 100644 new mode 100755 diff --git a/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-prefix.pch b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-prefix.pch old mode 100644 new mode 100755 index aa992a4..beb2a24 --- a/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-prefix.pch +++ b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-umbrella.h b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-umbrella.h old mode 100644 new mode 100755 index 5d16006..868f64b --- a/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-umbrella.h +++ b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit.modulemap b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit.modulemap old mode 100644 new mode 100755 diff --git a/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit.xcconfig b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit.xcconfig old mode 100644 new mode 100755 index 91e4cd0..2f45e42 --- a/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit.xcconfig +++ b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit.xcconfig @@ -1,9 +1,9 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/UXMPDFKit +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/UXMPDFKit GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/Example/UXMPDFKit.xcodeproj/project.pbxproj b/Example/UXMPDFKit.xcodeproj/project.pbxproj index 5b0f08d..ef7f802 100644 --- a/Example/UXMPDFKit.xcodeproj/project.pbxproj +++ b/Example/UXMPDFKit.xcodeproj/project.pbxproj @@ -15,7 +15,6 @@ 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 614D2EE31C8C8A9A00A856CD /* sample.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 614D2EE21C8C8A9A00A856CD /* sample.pdf */; }; 616B61061CF7395100B743A7 /* sample2.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 616B61051CF7395100B743A7 /* sample2.pdf */; }; - 619D94B91EE7B5FA0009538F /* CHANGELOG.md in Sources */ = {isa = PBXBuildFile; fileRef = 619D94B81EE7B5FA0009538F /* CHANGELOG.md */; }; 61CBF9411D86EB7F00282554 /* sample3.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 61CBF9401D86EB7F00282554 /* sample3.pdf */; }; 61D3B3771CDE9C1600E7C3A6 /* ExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61D3B3761CDE9C1600E7C3A6 /* ExampleViewController.swift */; }; /* End PBXBuildFile section */ @@ -142,7 +141,6 @@ 607FACCD1AFB9204008FA782 /* Frameworks */, 607FACCE1AFB9204008FA782 /* Resources */, 11FEA666DA65959F0F40E4BD /* [CP] Embed Pods Frameworks */, - 19016150C960787A2E91681A /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -160,13 +158,13 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 1010; ORGANIZATIONNAME = CocoaPods; TargetAttributes = { 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; DevelopmentTeam = 9592M4L4J8; - LastSwiftMigration = 0800; + LastSwiftMigration = ""; }; }; }; @@ -211,28 +209,16 @@ files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/UXMPDFKit/UXMPDFKit.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UXMPDFKit.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 19016150C960787A2E91681A /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 8FE2420313AAD9BD47D333C2 /* [CP] Check Pods Manifest.lock */ = { @@ -241,13 +227,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-UXMPDFKit_Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -260,7 +249,6 @@ 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 61D3B3771CDE9C1600E7C3A6 /* ExampleViewController.swift in Sources */, - 619D94B91EE7B5FA0009538F /* CHANGELOG.md in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -294,14 +282,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -330,7 +326,8 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -342,14 +339,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -370,7 +375,8 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.2; VALIDATE_PRODUCT = YES; }; name = Release; @@ -379,7 +385,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = A9FF669EE8472D82692EADE4 /* Pods-UXMPDFKit_Example.debug.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = 9592M4L4J8; FRAMEWORK_SEARCH_PATHS = ( @@ -387,7 +392,6 @@ "$(PROJECT_DIR)/UXMPDFKit", ); INFOPLIST_FILE = UXMPDFKit/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; OTHER_LDFLAGS = ( @@ -399,7 +403,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.uxmstudio.uxmpdfit; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -408,7 +412,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 20EBD11EFF06C30A3117928C /* Pods-UXMPDFKit_Example.release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = 9592M4L4J8; FRAMEWORK_SEARCH_PATHS = ( @@ -416,7 +419,6 @@ "$(PROJECT_DIR)/UXMPDFKit", ); INFOPLIST_FILE = UXMPDFKit/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; OTHER_LDFLAGS = ( @@ -428,7 +430,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.uxmstudio.uxmpdfit; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/Example/UXMPDFKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/UXMPDFKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 diff --git a/Example/UXMPDFKit.xcodeproj/xcshareddata/xcschemes/UXMPDFKit-Example.xcscheme b/Example/UXMPDFKit.xcodeproj/xcshareddata/xcschemes/UXMPDFKit-Example.xcscheme deleted file mode 100644 index 180fa0a..0000000 --- a/Example/UXMPDFKit.xcodeproj/xcshareddata/xcschemes/UXMPDFKit-Example.xcscheme +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/UXMPDFKit.xcworkspace/contents.xcworkspacedata b/Example/UXMPDFKit.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 diff --git a/Example/UXMPDFKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/UXMPDFKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/UXMPDFKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/UXMPDFKit/AppDelegate.swift b/Example/UXMPDFKit/AppDelegate.swift index dea5111..6ee9085 100644 --- a/Example/UXMPDFKit/AppDelegate.swift +++ b/Example/UXMPDFKit/AppDelegate.swift @@ -9,11 +9,11 @@ import UIKit @UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { + class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { let dirPaths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) print("App Path: \(dirPaths)") diff --git a/Example/UXMPDFKit/Base.lproj/LaunchScreen.xib b/Example/UXMPDFKit/Base.lproj/LaunchScreen.xib old mode 100644 new mode 100755 diff --git a/Example/UXMPDFKit/Base.lproj/Main.storyboard b/Example/UXMPDFKit/Base.lproj/Main.storyboard old mode 100644 new mode 100755 index e077937..6e36159 --- a/Example/UXMPDFKit/Base.lproj/Main.storyboard +++ b/Example/UXMPDFKit/Base.lproj/Main.storyboard @@ -1,11 +1,12 @@ - - + + - + + @@ -13,16 +14,12 @@ - - - - - + - - + + @@ -34,11 +31,12 @@ - + - - + + + @@ -52,16 +50,12 @@ - - - - - + - + @@ -88,10 +82,11 @@ - - - + + + + @@ -105,7 +100,7 @@ - + diff --git a/Example/UXMPDFKit/ExampleViewController.swift b/Example/UXMPDFKit/ExampleViewController.swift old mode 100644 new mode 100755 index df4f9ae..bec9bf3 --- a/Example/UXMPDFKit/ExampleViewController.swift +++ b/Example/UXMPDFKit/ExampleViewController.swift @@ -14,13 +14,14 @@ class ExampleViewController: UIViewController { @IBAction func loadPDF() { let url = Bundle.main.path(forResource: "sample2", ofType: "pdf")! - let document = try! PDFDocument.from(filePath: url) + let document = try! UXMPDFDocument.from(filePath: url) - let pdf = PDFViewController(document: document!) + let pdf = UXMPDFViewController(document: document!) pdf.annotationController.annotationTypes = [ PDFHighlighterAnnotation.self, PDFPenAnnotation.self, - PDFTextAnnotation.self + UXMTextAnnotation.self, + UXMSignAnnotation.self, ] self.navigationController?.pushViewController(pdf, animated: true) diff --git a/Example/UXMPDFKit/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/UXMPDFKit/Images.xcassets/AppIcon.appiconset/Contents.json index da379e7..63016a0 100644 --- a/Example/UXMPDFKit/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Example/UXMPDFKit/Images.xcassets/AppIcon.appiconset/Contents.json @@ -138,6 +138,11 @@ "filename" : "Icon-iPadPro@2x.png", "scale" : "2x" }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + }, { "size" : "24x24", "idiom" : "watch", @@ -173,6 +178,20 @@ "role" : "appLauncher", "subtype" : "38mm" }, + { + "size" : "44x44", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "40mm" + }, + { + "size" : "50x50", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "44mm" + }, { "size" : "86x86", "idiom" : "watch", @@ -186,6 +205,18 @@ "scale" : "2x", "role" : "quickLook", "subtype" : "42mm" + }, + { + "size" : "108x108", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "44mm" + }, + { + "idiom" : "watch-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/Example/UXMPDFKit/Info.plist b/Example/UXMPDFKit/Info.plist old mode 100644 new mode 100755 diff --git a/Example/UXMPDFKit/ViewController.swift b/Example/UXMPDFKit/ViewController.swift old mode 100644 new mode 100755 index f325319..364992d --- a/Example/UXMPDFKit/ViewController.swift +++ b/Example/UXMPDFKit/ViewController.swift @@ -11,13 +11,13 @@ import UXMPDFKit class ViewController: UIViewController { - @IBOutlet var collectionView:PDFSinglePageViewer! + @IBOutlet var collectionView:UXMSinglePageViewer! override func viewDidLoad() { super.viewDidLoad() let url = Bundle.main.path(forResource: "sample", ofType: "pdf")! - let document = try! PDFDocument(filePath: url, password: "") + let document = try! UXMPDFDocument(filePath: url, password: "") self.collectionView.document = document } diff --git a/Example/UXMPDFKit/sample.pdf b/Example/UXMPDFKit/sample.pdf old mode 100644 new mode 100755 diff --git a/Example/UXMPDFKit/sample3.pdf b/Example/UXMPDFKit/sample3.pdf old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/Package.swift b/Package.swift old mode 100644 new mode 100755 diff --git a/Pod/Assets/Images.xcassets/annot.imageset/Contents.json b/Pod/Assets/Images.xcassets/annot.imageset/Contents.json index e6df1e6..cfd102e 100644 --- a/Pod/Assets/Images.xcassets/annot.imageset/Contents.json +++ b/Pod/Assets/Images.xcassets/annot.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "annotationTools_static.png", + "filename" : "compose.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "annotationTools_static@2x.png", + "filename" : "compose@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "annotationTools_static@3x.png", + "filename" : "compose@3x.png", "scale" : "3x" } ], diff --git a/Pod/Assets/Images.xcassets/annot.imageset/annotationTools_static.png b/Pod/Assets/Images.xcassets/annot.imageset/annotationTools_static.png deleted file mode 100644 index 48cbba2..0000000 Binary files a/Pod/Assets/Images.xcassets/annot.imageset/annotationTools_static.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/annot.imageset/annotationTools_static@2x.png b/Pod/Assets/Images.xcassets/annot.imageset/annotationTools_static@2x.png deleted file mode 100644 index d82ffa1..0000000 Binary files a/Pod/Assets/Images.xcassets/annot.imageset/annotationTools_static@2x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/annot.imageset/annotationTools_static@3x.png b/Pod/Assets/Images.xcassets/annot.imageset/annotationTools_static@3x.png deleted file mode 100644 index 156f605..0000000 Binary files a/Pod/Assets/Images.xcassets/annot.imageset/annotationTools_static@3x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/annot.imageset/compose.png b/Pod/Assets/Images.xcassets/annot.imageset/compose.png new file mode 100644 index 0000000..bfde43e Binary files /dev/null and b/Pod/Assets/Images.xcassets/annot.imageset/compose.png differ diff --git a/Pod/Assets/Images.xcassets/annot.imageset/compose@2x.png b/Pod/Assets/Images.xcassets/annot.imageset/compose@2x.png new file mode 100644 index 0000000..b43add7 Binary files /dev/null and b/Pod/Assets/Images.xcassets/annot.imageset/compose@2x.png differ diff --git a/Pod/Assets/Images.xcassets/annot.imageset/compose@3x.png b/Pod/Assets/Images.xcassets/annot.imageset/compose@3x.png new file mode 100644 index 0000000..2713c4a Binary files /dev/null and b/Pod/Assets/Images.xcassets/annot.imageset/compose@3x.png differ diff --git a/Pod/Assets/Images.xcassets/delete.imageset/Contents.json b/Pod/Assets/Images.xcassets/delete.imageset/Contents.json index 499ea63..1231572 100644 --- a/Pod/Assets/Images.xcassets/delete.imageset/Contents.json +++ b/Pod/Assets/Images.xcassets/delete.imageset/Contents.json @@ -2,15 +2,17 @@ "images" : [ { "idiom" : "universal", + "filename" : "delete.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "garbage.png", + "filename" : "delete@2x.png", "scale" : "2x" }, { "idiom" : "universal", + "filename" : "delete@3x.png", "scale" : "3x" } ], diff --git a/Pod/Assets/Images.xcassets/delete.imageset/delete.png b/Pod/Assets/Images.xcassets/delete.imageset/delete.png new file mode 100644 index 0000000..d664804 Binary files /dev/null and b/Pod/Assets/Images.xcassets/delete.imageset/delete.png differ diff --git a/Pod/Assets/Images.xcassets/delete.imageset/delete@2x.png b/Pod/Assets/Images.xcassets/delete.imageset/delete@2x.png new file mode 100644 index 0000000..ca8fa19 Binary files /dev/null and b/Pod/Assets/Images.xcassets/delete.imageset/delete@2x.png differ diff --git a/Pod/Assets/Images.xcassets/delete.imageset/delete@3x.png b/Pod/Assets/Images.xcassets/delete.imageset/delete@3x.png new file mode 100644 index 0000000..739006a Binary files /dev/null and b/Pod/Assets/Images.xcassets/delete.imageset/delete@3x.png differ diff --git a/Pod/Assets/Images.xcassets/delete.imageset/garbage.png b/Pod/Assets/Images.xcassets/delete.imageset/garbage.png deleted file mode 100644 index d05be2d..0000000 Binary files a/Pod/Assets/Images.xcassets/delete.imageset/garbage.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/form.imageset/Contents.json b/Pod/Assets/Images.xcassets/form.imageset/Contents.json index a498879..e328883 100644 --- a/Pod/Assets/Images.xcassets/form.imageset/Contents.json +++ b/Pod/Assets/Images.xcassets/form.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "form_static.png", + "filename" : "form.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "form_static@2x.png", + "filename" : "form@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "form_static@3x.png", + "filename" : "form@3x.png", "scale" : "3x" } ], diff --git a/Pod/Assets/Images.xcassets/form.imageset/form.png b/Pod/Assets/Images.xcassets/form.imageset/form.png new file mode 100644 index 0000000..9bb5f2b Binary files /dev/null and b/Pod/Assets/Images.xcassets/form.imageset/form.png differ diff --git a/Pod/Assets/Images.xcassets/form.imageset/form@2x.png b/Pod/Assets/Images.xcassets/form.imageset/form@2x.png new file mode 100644 index 0000000..4dae5a0 Binary files /dev/null and b/Pod/Assets/Images.xcassets/form.imageset/form@2x.png differ diff --git a/Pod/Assets/Images.xcassets/form.imageset/form@3x.png b/Pod/Assets/Images.xcassets/form.imageset/form@3x.png new file mode 100644 index 0000000..ae57b68 Binary files /dev/null and b/Pod/Assets/Images.xcassets/form.imageset/form@3x.png differ diff --git a/Pod/Assets/Images.xcassets/form.imageset/form_static.png b/Pod/Assets/Images.xcassets/form.imageset/form_static.png deleted file mode 100644 index 9bf6626..0000000 Binary files a/Pod/Assets/Images.xcassets/form.imageset/form_static.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/form.imageset/form_static@2x.png b/Pod/Assets/Images.xcassets/form.imageset/form_static@2x.png deleted file mode 100644 index 0db2f1f..0000000 Binary files a/Pod/Assets/Images.xcassets/form.imageset/form_static@2x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/form.imageset/form_static@3x.png b/Pod/Assets/Images.xcassets/form.imageset/form_static@3x.png deleted file mode 100644 index 91aab59..0000000 Binary files a/Pod/Assets/Images.xcassets/form.imageset/form_static@3x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/highlighter.imageset/Contents.json b/Pod/Assets/Images.xcassets/highlighter.imageset/Contents.json index 7261b90..224e8dc 100644 --- a/Pod/Assets/Images.xcassets/highlighter.imageset/Contents.json +++ b/Pod/Assets/Images.xcassets/highlighter.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "highlighter_static.png", + "filename" : "marker.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "highlighter_static@2x.png", + "filename" : "marker@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "highlighter_static@3x.png", + "filename" : "marker@3x.png", "scale" : "3x" } ], diff --git a/Pod/Assets/Images.xcassets/highlighter.imageset/highlighter_static.png b/Pod/Assets/Images.xcassets/highlighter.imageset/highlighter_static.png deleted file mode 100644 index f829e0c..0000000 Binary files a/Pod/Assets/Images.xcassets/highlighter.imageset/highlighter_static.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/highlighter.imageset/highlighter_static@2x.png b/Pod/Assets/Images.xcassets/highlighter.imageset/highlighter_static@2x.png deleted file mode 100644 index 85b0e46..0000000 Binary files a/Pod/Assets/Images.xcassets/highlighter.imageset/highlighter_static@2x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/highlighter.imageset/highlighter_static@3x.png b/Pod/Assets/Images.xcassets/highlighter.imageset/highlighter_static@3x.png deleted file mode 100644 index 1ffe6ae..0000000 Binary files a/Pod/Assets/Images.xcassets/highlighter.imageset/highlighter_static@3x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/highlighter.imageset/marker.png b/Pod/Assets/Images.xcassets/highlighter.imageset/marker.png new file mode 100644 index 0000000..86583de Binary files /dev/null and b/Pod/Assets/Images.xcassets/highlighter.imageset/marker.png differ diff --git a/Pod/Assets/Images.xcassets/highlighter.imageset/marker@2x.png b/Pod/Assets/Images.xcassets/highlighter.imageset/marker@2x.png new file mode 100644 index 0000000..abb4360 Binary files /dev/null and b/Pod/Assets/Images.xcassets/highlighter.imageset/marker@2x.png differ diff --git a/Pod/Assets/Images.xcassets/highlighter.imageset/marker@3x.png b/Pod/Assets/Images.xcassets/highlighter.imageset/marker@3x.png new file mode 100644 index 0000000..1300c36 Binary files /dev/null and b/Pod/Assets/Images.xcassets/highlighter.imageset/marker@3x.png differ diff --git a/Pod/Assets/Images.xcassets/pen.imageset/Contents.json b/Pod/Assets/Images.xcassets/pen.imageset/Contents.json index 6e381c2..e4f01b2 100644 --- a/Pod/Assets/Images.xcassets/pen.imageset/Contents.json +++ b/Pod/Assets/Images.xcassets/pen.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "pen_static.png", + "filename" : "pen.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "pen_static@2x.png", + "filename" : "pen@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "pen_static@3x.png", + "filename" : "pen@3x.png", "scale" : "3x" } ], diff --git a/Pod/Assets/Images.xcassets/pen.imageset/pen.png b/Pod/Assets/Images.xcassets/pen.imageset/pen.png new file mode 100644 index 0000000..b34d09f Binary files /dev/null and b/Pod/Assets/Images.xcassets/pen.imageset/pen.png differ diff --git a/Pod/Assets/Images.xcassets/pen.imageset/pen@2x.png b/Pod/Assets/Images.xcassets/pen.imageset/pen@2x.png new file mode 100644 index 0000000..499377e Binary files /dev/null and b/Pod/Assets/Images.xcassets/pen.imageset/pen@2x.png differ diff --git a/Pod/Assets/Images.xcassets/pen.imageset/pen@3x.png b/Pod/Assets/Images.xcassets/pen.imageset/pen@3x.png new file mode 100644 index 0000000..eb4314b Binary files /dev/null and b/Pod/Assets/Images.xcassets/pen.imageset/pen@3x.png differ diff --git a/Pod/Assets/Images.xcassets/pen.imageset/pen_static.png b/Pod/Assets/Images.xcassets/pen.imageset/pen_static.png deleted file mode 100644 index 49a551c..0000000 Binary files a/Pod/Assets/Images.xcassets/pen.imageset/pen_static.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/pen.imageset/pen_static@2x.png b/Pod/Assets/Images.xcassets/pen.imageset/pen_static@2x.png deleted file mode 100644 index 92f02d2..0000000 Binary files a/Pod/Assets/Images.xcassets/pen.imageset/pen_static@2x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/pen.imageset/pen_static@3x.png b/Pod/Assets/Images.xcassets/pen.imageset/pen_static@3x.png deleted file mode 100644 index fced135..0000000 Binary files a/Pod/Assets/Images.xcassets/pen.imageset/pen_static@3x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/share.imageset/Contents.json b/Pod/Assets/Images.xcassets/share.imageset/Contents.json index 867ba8c..72c2f3c 100644 --- a/Pod/Assets/Images.xcassets/share.imageset/Contents.json +++ b/Pod/Assets/Images.xcassets/share.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "export_static.png", + "filename" : "share.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "export_static@2x.png", + "filename" : "share@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "export_static@3x.png", + "filename" : "share@3x.png", "scale" : "3x" } ], diff --git a/Pod/Assets/Images.xcassets/share.imageset/export_static.png b/Pod/Assets/Images.xcassets/share.imageset/export_static.png deleted file mode 100644 index 8409252..0000000 Binary files a/Pod/Assets/Images.xcassets/share.imageset/export_static.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/share.imageset/export_static@2x.png b/Pod/Assets/Images.xcassets/share.imageset/export_static@2x.png deleted file mode 100644 index bb650cc..0000000 Binary files a/Pod/Assets/Images.xcassets/share.imageset/export_static@2x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/share.imageset/export_static@3x.png b/Pod/Assets/Images.xcassets/share.imageset/export_static@3x.png deleted file mode 100644 index 4882924..0000000 Binary files a/Pod/Assets/Images.xcassets/share.imageset/export_static@3x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/share.imageset/share.png b/Pod/Assets/Images.xcassets/share.imageset/share.png new file mode 100644 index 0000000..53b8b9f Binary files /dev/null and b/Pod/Assets/Images.xcassets/share.imageset/share.png differ diff --git a/Pod/Assets/Images.xcassets/share.imageset/share@2x.png b/Pod/Assets/Images.xcassets/share.imageset/share@2x.png new file mode 100644 index 0000000..9a6a073 Binary files /dev/null and b/Pod/Assets/Images.xcassets/share.imageset/share@2x.png differ diff --git a/Pod/Assets/Images.xcassets/share.imageset/share@3x.png b/Pod/Assets/Images.xcassets/share.imageset/share@3x.png new file mode 100644 index 0000000..47366e8 Binary files /dev/null and b/Pod/Assets/Images.xcassets/share.imageset/share@3x.png differ diff --git a/Pod/Assets/Images.xcassets/sign.imageset/Contents.json b/Pod/Assets/Images.xcassets/sign.imageset/Contents.json new file mode 100644 index 0000000..cfebc27 --- /dev/null +++ b/Pod/Assets/Images.xcassets/sign.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "sign.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "sign@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "sign@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Pod/Assets/Images.xcassets/sign.imageset/sign.png b/Pod/Assets/Images.xcassets/sign.imageset/sign.png new file mode 100644 index 0000000..2326e18 Binary files /dev/null and b/Pod/Assets/Images.xcassets/sign.imageset/sign.png differ diff --git a/Pod/Assets/Images.xcassets/sign.imageset/sign@2x.png b/Pod/Assets/Images.xcassets/sign.imageset/sign@2x.png new file mode 100644 index 0000000..8d21c7c Binary files /dev/null and b/Pod/Assets/Images.xcassets/sign.imageset/sign@2x.png differ diff --git a/Pod/Assets/Images.xcassets/sign.imageset/sign@3x.png b/Pod/Assets/Images.xcassets/sign.imageset/sign@3x.png new file mode 100644 index 0000000..01336d8 Binary files /dev/null and b/Pod/Assets/Images.xcassets/sign.imageset/sign@3x.png differ diff --git a/Pod/Assets/Images.xcassets/text-symbol.imageset/Contents.json b/Pod/Assets/Images.xcassets/text-symbol.imageset/Contents.json index 8f62b39..af8fcbb 100644 --- a/Pod/Assets/Images.xcassets/text-symbol.imageset/Contents.json +++ b/Pod/Assets/Images.xcassets/text-symbol.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "text_static.png", + "filename" : "text.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "text_static@2x.png", + "filename" : "text@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "text_static@3x.png", + "filename" : "text@3x.png", "scale" : "3x" } ], diff --git a/Pod/Assets/Images.xcassets/text-symbol.imageset/text.png b/Pod/Assets/Images.xcassets/text-symbol.imageset/text.png new file mode 100644 index 0000000..d07d132 Binary files /dev/null and b/Pod/Assets/Images.xcassets/text-symbol.imageset/text.png differ diff --git a/Pod/Assets/Images.xcassets/text-symbol.imageset/text@2x.png b/Pod/Assets/Images.xcassets/text-symbol.imageset/text@2x.png new file mode 100644 index 0000000..cd3c401 Binary files /dev/null and b/Pod/Assets/Images.xcassets/text-symbol.imageset/text@2x.png differ diff --git a/Pod/Assets/Images.xcassets/text-symbol.imageset/text@3x.png b/Pod/Assets/Images.xcassets/text-symbol.imageset/text@3x.png new file mode 100644 index 0000000..10d8f16 Binary files /dev/null and b/Pod/Assets/Images.xcassets/text-symbol.imageset/text@3x.png differ diff --git a/Pod/Assets/Images.xcassets/text-symbol.imageset/text_static.png b/Pod/Assets/Images.xcassets/text-symbol.imageset/text_static.png deleted file mode 100644 index fca50ad..0000000 Binary files a/Pod/Assets/Images.xcassets/text-symbol.imageset/text_static.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/text-symbol.imageset/text_static@2x.png b/Pod/Assets/Images.xcassets/text-symbol.imageset/text_static@2x.png deleted file mode 100644 index 4cfcffc..0000000 Binary files a/Pod/Assets/Images.xcassets/text-symbol.imageset/text_static@2x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/text-symbol.imageset/text_static@3x.png b/Pod/Assets/Images.xcassets/text-symbol.imageset/text_static@3x.png deleted file mode 100644 index 32c5210..0000000 Binary files a/Pod/Assets/Images.xcassets/text-symbol.imageset/text_static@3x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/thumbs.imageset/Contents.json b/Pod/Assets/Images.xcassets/thumbs.imageset/Contents.json index 7d83b06..9816641 100644 --- a/Pod/Assets/Images.xcassets/thumbs.imageset/Contents.json +++ b/Pod/Assets/Images.xcassets/thumbs.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "tableOfContents_static.png", + "filename" : "grid.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "tableOfContents_static@2x.png", + "filename" : "grid@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "tableOfContents_static@3x.png", + "filename" : "grid@3x.png", "scale" : "3x" } ], diff --git a/Pod/Assets/Images.xcassets/thumbs.imageset/grid.png b/Pod/Assets/Images.xcassets/thumbs.imageset/grid.png new file mode 100644 index 0000000..6542d8f Binary files /dev/null and b/Pod/Assets/Images.xcassets/thumbs.imageset/grid.png differ diff --git a/Pod/Assets/Images.xcassets/thumbs.imageset/grid@2x.png b/Pod/Assets/Images.xcassets/thumbs.imageset/grid@2x.png new file mode 100644 index 0000000..19136ef Binary files /dev/null and b/Pod/Assets/Images.xcassets/thumbs.imageset/grid@2x.png differ diff --git a/Pod/Assets/Images.xcassets/thumbs.imageset/grid@3x.png b/Pod/Assets/Images.xcassets/thumbs.imageset/grid@3x.png new file mode 100644 index 0000000..31a11ad Binary files /dev/null and b/Pod/Assets/Images.xcassets/thumbs.imageset/grid@3x.png differ diff --git a/Pod/Assets/Images.xcassets/thumbs.imageset/tableOfContents_static.png b/Pod/Assets/Images.xcassets/thumbs.imageset/tableOfContents_static.png deleted file mode 100644 index 52bd93e..0000000 Binary files a/Pod/Assets/Images.xcassets/thumbs.imageset/tableOfContents_static.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/thumbs.imageset/tableOfContents_static@2x.png b/Pod/Assets/Images.xcassets/thumbs.imageset/tableOfContents_static@2x.png deleted file mode 100644 index 728e90f..0000000 Binary files a/Pod/Assets/Images.xcassets/thumbs.imageset/tableOfContents_static@2x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/thumbs.imageset/tableOfContents_static@3x.png b/Pod/Assets/Images.xcassets/thumbs.imageset/tableOfContents_static@3x.png deleted file mode 100644 index 881fd81..0000000 Binary files a/Pod/Assets/Images.xcassets/thumbs.imageset/tableOfContents_static@3x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/undo.imageset/Contents.json b/Pod/Assets/Images.xcassets/undo.imageset/Contents.json index 0241191..3a0afb1 100644 --- a/Pod/Assets/Images.xcassets/undo.imageset/Contents.json +++ b/Pod/Assets/Images.xcassets/undo.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "undo_static.png", + "filename" : "undo.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "undo_static@2x.png", + "filename" : "undo@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "undo_static@3x.png", + "filename" : "undo@3x.png", "scale" : "3x" } ], diff --git a/Pod/Assets/Images.xcassets/undo.imageset/undo.png b/Pod/Assets/Images.xcassets/undo.imageset/undo.png new file mode 100644 index 0000000..0dd7d93 Binary files /dev/null and b/Pod/Assets/Images.xcassets/undo.imageset/undo.png differ diff --git a/Pod/Assets/Images.xcassets/undo.imageset/undo@2x.png b/Pod/Assets/Images.xcassets/undo.imageset/undo@2x.png new file mode 100644 index 0000000..db91ee8 Binary files /dev/null and b/Pod/Assets/Images.xcassets/undo.imageset/undo@2x.png differ diff --git a/Pod/Assets/Images.xcassets/undo.imageset/undo@3x.png b/Pod/Assets/Images.xcassets/undo.imageset/undo@3x.png new file mode 100644 index 0000000..3a401df Binary files /dev/null and b/Pod/Assets/Images.xcassets/undo.imageset/undo@3x.png differ diff --git a/Pod/Assets/Images.xcassets/undo.imageset/undo_static.png b/Pod/Assets/Images.xcassets/undo.imageset/undo_static.png deleted file mode 100644 index e4bb4e9..0000000 Binary files a/Pod/Assets/Images.xcassets/undo.imageset/undo_static.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/undo.imageset/undo_static@2x.png b/Pod/Assets/Images.xcassets/undo.imageset/undo_static@2x.png deleted file mode 100644 index 9aaf71e..0000000 Binary files a/Pod/Assets/Images.xcassets/undo.imageset/undo_static@2x.png and /dev/null differ diff --git a/Pod/Assets/Images.xcassets/undo.imageset/undo_static@3x.png b/Pod/Assets/Images.xcassets/undo.imageset/undo_static@3x.png deleted file mode 100644 index 3fd1c5f..0000000 Binary files a/Pod/Assets/Images.xcassets/undo.imageset/undo_static@3x.png and /dev/null differ diff --git a/Pod/Classes/.gitkeep b/Pod/Classes/.gitkeep old mode 100644 new mode 100755 diff --git a/Pod/Classes/Annotations/PDFAnnotation.swift b/Pod/Classes/Annotations/UXMAnnotation.swift old mode 100644 new mode 100755 similarity index 74% rename from Pod/Classes/Annotations/PDFAnnotation.swift rename to Pod/Classes/Annotations/UXMAnnotation.swift index faedbf7..65b7b01 --- a/Pod/Classes/Annotations/PDFAnnotation.swift +++ b/Pod/Classes/Annotations/UXMAnnotation.swift @@ -1,5 +1,5 @@ // -// PDFAnnotation.swift +// UXMAnnotation.swift // Pods // // Created by Chris Anderson on 3/7/16. @@ -8,7 +8,7 @@ import UIKit -public protocol PDFAnnotation { +public protocol UXMAnnotation { /// The page number the annotation is located on var page: Int? { get set } @@ -19,7 +19,7 @@ public protocol PDFAnnotation { /// Boolean representing if the annotation has been saved var saved: Bool { get set } - var delegate: PDFAnnotationEvent? { get set } + var delegate: UXMPDFAnnotationEvent? { get set } /// Force implementations to have an init init() @@ -41,7 +41,7 @@ public protocol PDFAnnotation { func encode(with aCoder: NSCoder) } -public protocol PDFAnnotationButtonable: PDFAnnotation { +public protocol UXMPDFAnnotationButtonable: UXMAnnotation { /// Name for UIBarButtonItem representation of annotation static var name: String? { get } @@ -50,12 +50,12 @@ public protocol PDFAnnotationButtonable: PDFAnnotation { static var buttonImage: UIImage? { get } } -public protocol PDFAnnotationEvent { - func annotationUpdated(annotation: PDFAnnotation) - func annotation(annotation: PDFAnnotation, selected action: String) +public protocol UXMPDFAnnotationEvent : class { + func annotationUpdated(annotation: UXMAnnotation) + func annotation(annotation: UXMAnnotation, selected action: String) } -public protocol PDFAnnotationView { - var parent: PDFAnnotation? { get } +public protocol UXMPDFAnnotationView { + var parent: UXMAnnotation? { get } var canBecomeFirstResponder: Bool { get } } diff --git a/Pod/Classes/Annotations/PDFAnnotationController.swift b/Pod/Classes/Annotations/UXMAnnotationController.swift similarity index 65% rename from Pod/Classes/Annotations/PDFAnnotationController.swift rename to Pod/Classes/Annotations/UXMAnnotationController.swift index e0cd2b0..c2c7f7a 100644 --- a/Pod/Classes/Annotations/PDFAnnotationController.swift +++ b/Pod/Classes/Annotations/UXMAnnotationController.swift @@ -1,5 +1,5 @@ // -// PDFAnnotationController.swift +// UXMAnnotationController.swift // Pods // // Created by Chris Anderson on 6/22/16. @@ -8,26 +8,26 @@ import Foundation -public protocol PDFAnnotationControllerProtocol { +public protocol UXMAnnotationControllerProtocol : class { func annotationWillStart(touch: UITouch) -> Int? } -open class PDFAnnotationController: UIViewController { +open class UXMAnnotationController: UIViewController { /// Reference to document - var document: PDFDocument! + var document: UXMPDFDocument! /// Store containing all annotations for document - var annotations = PDFAnnotationStore() + open var annotationsStore = UXMAnnotationStore() /// References to pages within view - var allPages = [PDFPageContentView]() + var allPages = [UXMPageContentView]() /// Type of annotation being added - var annotationType: PDFAnnotation.Type? + var annotationType: UXMAnnotation.Type? - open var annotationTypes: [PDFAnnotation.Type] = [ - PDFTextAnnotation.self, + open var annotationTypes: [UXMAnnotation.Type] = [ + UXMTextAnnotation.self, PDFPenAnnotation.self, PDFHighlighterAnnotation.self, ] { @@ -37,41 +37,41 @@ open class PDFAnnotationController: UIViewController { } /// The buttons for the created annotation types - var buttons: [PDFBarButton] = [] + var buttons: [UXMBarButton] = [] /// Delegate reference for annotation events - var annotationDelegate: PDFAnnotationControllerProtocol? + weak var annotationDelegate: UXMAnnotationControllerProtocol? /// Current annotation - open var currentAnnotation: PDFAnnotation? + open var currentAnnotation: UXMAnnotation? open var currentAnnotationPage: Int? { return currentAnnotation?.page } - open var currentPage: PDFPageContentView? { + open var currentPage: UXMPageContentView? { return allPages.filter({ $0.page == currentAnnotationPage }).first } - var pageView: PDFPageContent? { + var pageView: UXMPageContent? { return currentPage?.contentView } - func pageViewFor(page: Int) -> PDFPageContent? { + func pageViewFor(page: Int) -> UXMPageContent? { return self.pageContentViewFor(page: page)?.contentView } - func pageContentViewFor(page: Int) -> PDFPageContentView? { + func pageContentViewFor(page: Int) -> UXMPageContentView? { return allPages.filter({ $0.page == page }).first } //MARK: - Bar button items - lazy var undoButton: PDFBarButton = PDFBarButton( + lazy var undoButton: UXMBarButton = UXMBarButton( image: UIImage.bundledImage("undo"), toggled: false, target: self, - action: #selector(PDFAnnotationController.selectedUndo(_:)) + action: #selector(UXMAnnotationController.selectedUndo(_:)) ) /** @@ -83,9 +83,9 @@ open class PDFAnnotationController: UIViewController { - Returns: An instance of the PDFAnnotationController */ - public init(document: PDFDocument, delegate: PDFAnnotationControllerProtocol) { + public init(document: UXMPDFDocument, delegate: UXMAnnotationControllerProtocol) { self.document = document - self.annotations = document.annotations + self.annotationsStore = document.annotationsStore self.annotationDelegate = delegate super.init(nibName: nil, bundle: nil) @@ -103,9 +103,9 @@ open class PDFAnnotationController: UIViewController { - Returns: An instance of the PDFAnnotationController */ - public convenience init(document: PDFDocument, - delegate: PDFAnnotationControllerProtocol, - annotationTypes: [PDFAnnotation.Type]) { + public convenience init(document: UXMPDFDocument, + delegate: UXMAnnotationControllerProtocol, + annotationTypes: [UXMAnnotation.Type]) { self.init(document: document, delegate: delegate) self.annotationTypes = annotationTypes } @@ -119,11 +119,12 @@ open class PDFAnnotationController: UIViewController { view.isOpaque = false view.backgroundColor = UIColor.clear - self.loadButtons(for: self.annotationTypes) + loadButtons(for: self.annotationTypes) + undoButton.isEnabled = (annotationsStore.hasAnnotations) } //MARK: - Annotation handling - open func showAnnotations(_ contentView: PDFPageContentView) { + open func showAnnotations(_ contentView: UXMPageContentView) { let page = contentView.page if let pageIndex = allPages.index(where: { $0.page == page }) { clear(pageView: allPages[pageIndex].contentView) @@ -131,27 +132,30 @@ open class PDFAnnotationController: UIViewController { } allPages.append(contentView) - let annotationsForPage = annotations.annotations(page: page) + let annotationsForPage = annotationsStore.annotations(page: page) for annotation in annotationsForPage { let view = annotation.mutableView() contentView.contentView.addSubview(view) - contentView.contentView.bringSubview(toFront: view) + contentView.contentView.bringSubviewToFront(view) } } - open func startAnnotation(_ type: PDFAnnotation.Type?) { + open func startAnnotation(_ type: UXMAnnotation.Type?) { finishAnnotation() annotationType = type view.isUserInteractionEnabled = annotationType != nil + undoButton.isEnabled = (annotationType != nil || annotationsStore.hasAnnotations) } open func finishAnnotation() { annotationType = .none addCurrentAnnotationToStore() + view.isUserInteractionEnabled = false + undoButton.isEnabled = (annotationsStore.hasAnnotations) } //MARK: - Bar button actions @@ -175,22 +179,28 @@ open class PDFAnnotationController: UIViewController { } } - @IBAction func selectedUndo(_ button: PDFBarButton) { + @IBAction func selectedUndo(_ button: UXMBarButton) { + //keep track of what kind of annotation we're adding + let currentAnnotationType = annotationType + //finish and undo it finishAnnotation() undo() + + //then start a new annotation of the same type + startAnnotation(currentAnnotationType) } - func select(annotation: PDFAnnotation?) { + func select(annotation: UXMAnnotation?) { self.currentAnnotation?.didEnd() self.currentAnnotation = annotation self.currentAnnotation?.delegate = self } - func loadButtons(for annotations: [PDFAnnotation.Type]) { - self.buttons = self.annotationTypes.flatMap { + func loadButtons(for annotations: [UXMAnnotation.Type]) { + self.buttons = self.annotationTypes.compactMap { - if let annotation = $0 as? PDFAnnotationButtonable.Type { + if let annotation = $0 as? UXMPDFAnnotationButtonable.Type { return PDFAnnotationBarButton( toggled: false, type: annotation, @@ -205,7 +215,7 @@ open class PDFAnnotationController: UIViewController { public func undo() { - if let annotation = annotations.undo() { + if let annotation = annotationsStore.undo() { if let annotationPage = annotation.page, let pageContentView = self.pageContentViewFor(page: annotationPage) { clear(pageView: pageContentView.contentView) @@ -217,13 +227,13 @@ open class PDFAnnotationController: UIViewController { func deleteCurrent() { if let currentAnnotation = self.currentAnnotation { - self.annotations.remove(annotation: currentAnnotation) + self.annotationsStore.remove(annotation: currentAnnotation) } } - func clear(pageView: PDFPageContent) { + func clear(pageView: UXMPageContent) { for subview in pageView.subviews { - if subview is PDFAnnotationView { + if subview is UXMPDFAnnotationView { subview.removeFromSuperview() } } @@ -231,7 +241,13 @@ open class PDFAnnotationController: UIViewController { //MARK: - Touches methods to pass to annotation open override func touchesBegan(_ touches: Set, with event: UIEvent?) { - guard let touch = touches.first else { return } + // We only allow one-finger touches to start annotations, as otherwise + // when you are pen-editing then try to zoom, one of your fingers will draw instead of zooming + // This is a HACK, as IDEALLY the two-finger pinch would zoom while still in + // annotation editing mode, but for the life of me I could not get that to go, forwarding + // events/touches to pretty much anything. + guard let touch = touches.first, event?.allTouches?.count == 1 + else { return } let page = annotationDelegate?.annotationWillStart(touch: touch) @@ -252,14 +268,16 @@ open class PDFAnnotationController: UIViewController { open override func touchesMoved(_ touches: Set, with event: UIEvent?) { - guard let touch = touches.first else { return } + guard let touch = touches.first, event?.allTouches?.count == 1 + else { return } let point = touch.location(in: pageView) currentAnnotation?.touchMoved(touch, point: point) } open override func touchesEnded(_ touches: Set, with event: UIEvent?) { - guard let touch = touches.first else { return } + guard let touch = touches.first, event?.allTouches?.count == 1 + else { return } let point = touch.location(in: pageView) currentAnnotation?.touchEnded(touch, point: point) @@ -268,7 +286,7 @@ open class PDFAnnotationController: UIViewController { private func view(uuid: String) -> UIView? { guard let pageView = self.pageView else { return nil } for subview in pageView.subviews { - if let annotView = subview as? PDFAnnotationView, + if let annotView = subview as? UXMPDFAnnotationView, let parent = annotView.parent, parent.uuid == uuid { return subview @@ -280,25 +298,26 @@ open class PDFAnnotationController: UIViewController { private func createNewAnnotation() { if let annotationType = self.annotationType { currentAnnotation = annotationType.init() + currentAnnotation?.delegate = self } } private func addCurrentAnnotationToStore() { if let currentAnnotation = currentAnnotation { currentAnnotation.didEnd() - annotations.add(annotation: currentAnnotation) + annotationsStore.add(annotation: currentAnnotation) } currentAnnotation = nil } } -extension PDFAnnotationController: PDFAnnotationEvent { - public func annotationUpdated(annotation: PDFAnnotation) { } +extension UXMAnnotationController: UXMPDFAnnotationEvent { + public func annotationUpdated(annotation: UXMAnnotation) { } - public func annotation(annotation: PDFAnnotation, selected action: String) { + public func annotation(annotation: UXMAnnotation, selected action: String) { if action == "delete" { - self.annotations.remove(annotation: annotation) - + self.annotationsStore.remove(annotation: annotation) + /// VERY DIRTY FIX LATER if let annotationPage = annotation.page, let pageContentView = self.pageContentViewFor(page: annotationPage) { @@ -310,8 +329,8 @@ extension PDFAnnotationController: PDFAnnotationEvent { } } -extension PDFAnnotationController: PDFRenderer { +extension UXMAnnotationController: UXMRenderer { public func render(_ page: Int, context: CGContext, bounds: CGRect) { - annotations.renderInContext(context, size: bounds, page: page) + annotationsStore.renderInContext(context, size: bounds, page: page) } } diff --git a/Pod/Classes/Annotations/PDFAnnotationStore.swift b/Pod/Classes/Annotations/UXMAnnotationStore.swift old mode 100644 new mode 100755 similarity index 62% rename from Pod/Classes/Annotations/PDFAnnotationStore.swift rename to Pod/Classes/Annotations/UXMAnnotationStore.swift index c35058b..e6ff30c --- a/Pod/Classes/Annotations/PDFAnnotationStore.swift +++ b/Pod/Classes/Annotations/UXMAnnotationStore.swift @@ -1,5 +1,5 @@ // -// PDFAnnotationStore.swift +// UXMAnnotationStore.swift // Pods // // Created by Chris Anderson on 5/8/16. @@ -9,31 +9,34 @@ import UIKit -public protocol PDFAnnotationStoreDelegate { +public protocol UXMAnnotationStoreDelegate : class { - func annotationStore(store: PDFAnnotationStore, addedAnnotation: PDFAnnotation) - func annotationStore(store: PDFAnnotationStore, removedAnnotation: PDFAnnotation) + func annotationStore(store: UXMAnnotationStore, addedAnnotation: UXMAnnotation) + func annotationStore(store: UXMAnnotationStore, removedAnnotation: UXMAnnotation) } -open class PDFAnnotationStore: NSObject, NSCoding { +open class UXMAnnotationStore: NSObject, NSCoding { - var annotations: [PDFAnnotation] = [] - var delegate: PDFAnnotationStoreDelegate? + private (set) open var annotations: [UXMAnnotation] = [] + weak var delegate: UXMAnnotationStoreDelegate? - - func add(annotation: PDFAnnotation) { + open var hasAnnotations: Bool { + return annotations.count > 0 + } + + func add(annotation: UXMAnnotation) { annotations.append(annotation) self.delegate?.annotationStore(store: self, addedAnnotation: annotation) } - func remove(annotation: PDFAnnotation) { + func remove(annotation: UXMAnnotation) { if let index = annotations.index(where: { $0.uuid == annotation.uuid }), index > -1 { self.delegate?.annotationStore(store: self, removedAnnotation: annotation) self.annotations.remove(at: index) } } - func undo() -> PDFAnnotation? { + func undo() -> UXMAnnotation? { if let annotation = annotations.popLast() { self.delegate?.annotationStore(store: self, removedAnnotation: annotation) @@ -42,7 +45,7 @@ open class PDFAnnotationStore: NSObject, NSCoding { return nil } - func annotations(page: Int) -> [PDFAnnotation] { + func annotations(page: Int) -> [UXMAnnotation] { return annotations.filter({ $0.page == page }) } @@ -55,7 +58,7 @@ open class PDFAnnotationStore: NSObject, NSCoding { override init() { super.init() } required public init(coder aDecoder: NSCoder) { - annotations = aDecoder.decodeObject(forKey: "annotations") as! [PDFAnnotation] + annotations = aDecoder.decodeObject(forKey: "annotations") as! [UXMAnnotation] } public func encode(with aCoder: NSCoder) { diff --git a/Pod/Classes/Annotations/PDFPathAnnotation.swift b/Pod/Classes/Annotations/UXMPathAnnotation.swift old mode 100644 new mode 100755 similarity index 90% rename from Pod/Classes/Annotations/PDFPathAnnotation.swift rename to Pod/Classes/Annotations/UXMPathAnnotation.swift index 1e37507..55cddd7 --- a/Pod/Classes/Annotations/PDFPathAnnotation.swift +++ b/Pod/Classes/Annotations/UXMPathAnnotation.swift @@ -1,5 +1,5 @@ // -// PDFPathAnnotation.swift +// UXMPathAnnotation.swift // Pods // // Created by Chris Anderson on 6/24/16. @@ -8,12 +8,12 @@ import UIKit -open class PDFPathAnnotation: NSObject, NSCoding { +open class UXMPathAnnotation: NSObject, NSCoding { public var page: Int? public var uuid: String = UUID().uuidString public var saved: Bool = false - public var delegate: PDFAnnotationEvent? + public weak var delegate: UXMPDFAnnotationEvent? var path: UIBezierPath = UIBezierPath() @@ -65,6 +65,7 @@ open class PDFPathAnnotation: NSObject, NSCoding { func drawRect(_ frame: CGRect, point: CGPoint = CGPoint.zero) { self.incrementalImage?.draw(at: point) + self.path.lineWidth = self.lineWidth self.color.setStroke() self.path.stroke() } @@ -82,11 +83,11 @@ open class PDFPathAnnotation: NSObject, NSCoding { } } -class PDFPathView: ResizableView, PDFAnnotationView { - var parent: PDFAnnotation? +class PDFPathView: ResizableView, UXMPDFAnnotationView { + var parent: UXMAnnotation? override var canBecomeFirstResponder: Bool { return true } - convenience init(parent: PDFPathAnnotation, frame: CGRect) { + convenience init(parent: UXMPathAnnotation, frame: CGRect) { self.init() @@ -100,11 +101,11 @@ class PDFPathView: ResizableView, PDFAnnotationView { } override func draw(_ rect: CGRect) { - (parent as? PDFPathAnnotation)?.drawRect(rect) + (parent as? UXMPathAnnotation)?.drawRect(rect) } } -extension PDFPathAnnotation: PDFAnnotation { +extension UXMPathAnnotation: UXMAnnotation { public func mutableView() -> UIView { view = PDFPathView(parent: self, frame: rect) @@ -182,7 +183,7 @@ extension PDFPathAnnotation: PDFAnnotation { } } -extension PDFPathAnnotation: ResizableViewDelegate { +extension UXMPathAnnotation: ResizableViewDelegate { func resizableViewDidBeginEditing(view: ResizableView) { } func resizableViewDidEndEditing(view: ResizableView) { @@ -194,13 +195,13 @@ extension PDFPathAnnotation: ResizableViewDelegate { } } -open class PDFPenAnnotation: PDFPathAnnotation, PDFAnnotationButtonable { +open class PDFPenAnnotation: UXMPathAnnotation, UXMPDFAnnotationButtonable { public static var name: String? { return "Pen" } public static var buttonImage: UIImage? { return UIImage.bundledImage("pen") } } -open class PDFHighlighterAnnotation: PDFPathAnnotation, PDFAnnotationButtonable { +open class PDFHighlighterAnnotation: UXMPathAnnotation, UXMPDFAnnotationButtonable { public static var name: String? { return "Highlighter" } public static var buttonImage: UIImage? { return UIImage.bundledImage("highlighter") } diff --git a/Pod/Classes/Annotations/UXMSignAnnotation.swift b/Pod/Classes/Annotations/UXMSignAnnotation.swift new file mode 100644 index 0000000..ed0b132 --- /dev/null +++ b/Pod/Classes/Annotations/UXMSignAnnotation.swift @@ -0,0 +1,225 @@ +// +// UXMSignAnnotation.swift +// Pods +// +// Created by Chris Anderson on 6/23/16. +// +// + +import UIKit + +open class UXMSignAnnotation: NSObject, NSCoding { + + public var page: Int? + public var uuid: String = UUID().uuidString + public var saved: Bool = false + public weak var delegate: UXMPDFAnnotationEvent? + + var image: UIImage? = nil { + didSet { + view.signImage.image = image + } + } + + var rect: CGRect = CGRect.zero { + didSet { + view.frame = self.rect + } + } + + lazy var view: PDFSignAnnotationView = PDFSignAnnotationView(parent: self) + + fileprivate var isEditing: Bool = false + + override required public init() { super.init() } + + public func didEnd() { + } + + required public init(coder aDecoder: NSCoder) { + page = aDecoder.decodeObject(forKey: "page") as? Int + image = aDecoder.decodeObject(forKey: "image") as? UIImage + rect = aDecoder.decodeCGRect(forKey: "rect") +// font = aDecoder.decodeObject(forKey: "font") as! UIFont + } + + public func encode(with aCoder: NSCoder) { + aCoder.encode(page, forKey: "page") + aCoder.encode(image, forKey: "image") + aCoder.encode(rect, forKey: "rect") +// aCoder.encode(font, forKey: "font") + } +} + +extension UXMSignAnnotation: UXMAnnotation { + + public func mutableView() -> UIView { + view = PDFSignAnnotationView(parent: self) + return view + } + + public func touchStarted(_ touch: UITouch, point: CGPoint) { + if rect == CGRect.zero { + rect = CGRect(origin: point, size: CGSize(width: 150, height: 48)) + } + self.view.touchesBegan([touch], with: nil) + } + + public func touchMoved(_ touch: UITouch, point: CGPoint) { + self.view.touchesMoved([touch], with: nil) + } + + public func touchEnded(_ touch: UITouch, point: CGPoint) { + self.view.touchesEnded([touch], with: nil) + } + + public func save() { + self.saved = true + } + + public func drawInContext(_ context: CGContext) { + UIGraphicsPushContext(context) + + guard let size = self.image?.size else { return } + let imageRect = CGRect(origin: rect.origin, size: size) + + guard let cgImage = self.image?.cgImage else { return } + // Draw our CGImage in the context of our PDFAnnotation bounds + context.draw(cgImage, in: imageRect) + + UIGraphicsPopContext() + } +} + +extension UXMSignAnnotation: ResizableViewDelegate { + func resizableViewDidBeginEditing(view: ResizableView) { } + + func resizableViewDidEndEditing(view: ResizableView) { + self.rect = self.view.frame + } + + func resizableViewDidSelectAction(view: ResizableView, action: String) { + self.delegate?.annotation(annotation: self, selected: action) + } +} + +extension UXMSignAnnotation: UXMPDFAnnotationButtonable { + + public static var name: String? { return "Sign" } + public static var buttonImage: UIImage? { return UIImage.bundledImage("sign") } +} + +//extension UXMSignAnnotation: UITextViewDelegate { +// public func textViewDidChange(_ textView: UITextView) { +// textView.sizeToFit() +// +// var width: CGFloat = 150.0 +// if self.view.frame.width > width { +// width = self.view.frame.width +// } +// +// rect = CGRect(x: self.view.frame.origin.x, +// y: self.view.frame.origin.y, +// width: width, +// height: self.view.frame.height) +// +// if text != textView.text { +// text = textView.text +// } +// } +// +// public func textViewDidEndEditing(_ textView: UITextView) { +// textView.isUserInteractionEnabled = false +// } +//} + + +class PDFSignAnnotationView: ResizableView, UXMPDFAnnotationView { + + let signExtraPadding: CGFloat = 22.0 + + var parent: UXMAnnotation? + let signController = UXMFormSignatureViewController() + override var canBecomeFirstResponder: Bool { return true } + override var menuItems: [UIMenuItem] { + return [ + UIMenuItem( + title: "Delete", + action: #selector(PDFSignAnnotationView.menuActionDelete(_:)) + ), + UIMenuItem( + title: "Sign", + action: #selector(PDFSignAnnotationView.menuActionSign(_:)) + ) + ] + } + + var signImage: UIImageView = { + var image = UIImageView() + image.contentMode = .scaleAspectFit + image.backgroundColor = UIColor.clear + return image + }() + + + override var frame: CGRect { + didSet { + signImage.frame = CGRect(x: 0, y: 0, width: frame.width, height: frame.height) + } + } + + convenience init(parent: UXMSignAnnotation) { + + self.init() + + self.parent = parent + self.delegate = parent + self.frame = parent.rect + self.signImage.image = parent.image + + signController.delegate = parent + + self.signImage.backgroundColor = UIColor.clear + self.signImage.isUserInteractionEnabled = false + self.backgroundColor = UIColor.clear + + self.addSubview(signImage) + } + + @objc func menuActionSign(_ sender: Any!) { + self.delegate?.resizableViewDidSelectAction(view: self, action: "sign") + + self.isLocked = true + self.signImage.isUserInteractionEnabled = true + self.signImage.becomeFirstResponder() + self.addSignature() + } + + @objc func addSignature() { + + + let nvc = UINavigationController(rootViewController: signController) + nvc.modalPresentationStyle = .formSheet + nvc.preferredContentSize = CGSize(width: 640, height: 300) + UIViewController.topController()?.present(nvc, animated: true) + } + + override open func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool { + + if action == #selector(menuActionSign(_:)) { + return true + } + return super.canPerformAction(action, withSender: sender) + } +} + +extension UXMSignAnnotation: UXMFormSignatureDelegate { + func completedSignatureDrawing(field: UXMFormFieldSignatureCaptureView) { + + if let image = field.getSignature() { + self.image = image + } + + self.view.isLocked = false + } +} diff --git a/Pod/Classes/Annotations/PDFTextAnnotation.swift b/Pod/Classes/Annotations/UXMTextAnnotation.swift similarity index 87% rename from Pod/Classes/Annotations/PDFTextAnnotation.swift rename to Pod/Classes/Annotations/UXMTextAnnotation.swift index 32d95dd..12cc2c5 100644 --- a/Pod/Classes/Annotations/PDFTextAnnotation.swift +++ b/Pod/Classes/Annotations/UXMTextAnnotation.swift @@ -1,5 +1,5 @@ // -// PDFTextAnnotation.swift +// UXMTextAnnotation.swift // Pods // // Created by Chris Anderson on 6/23/16. @@ -8,12 +8,12 @@ import UIKit -open class PDFTextAnnotation: NSObject, NSCoding { +open class UXMTextAnnotation: NSObject, NSCoding { public var page: Int? public var uuid: String = UUID().uuidString public var saved: Bool = false - public var delegate: PDFAnnotationEvent? + public weak var delegate: UXMPDFAnnotationEvent? var text: String = "" { didSet { @@ -60,7 +60,7 @@ open class PDFTextAnnotation: NSObject, NSCoding { } } -extension PDFTextAnnotation: PDFAnnotation { +extension UXMTextAnnotation: UXMAnnotation { public func mutableView() -> UIView { view = PDFTextAnnotationView(parent: self) @@ -94,13 +94,13 @@ extension PDFTextAnnotation: PDFAnnotation { let paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle paragraphStyle.alignment = NSTextAlignment.left - let attributes: [String:AnyObject] = [ - NSFontAttributeName: font, - NSForegroundColorAttributeName: UIColor.black, - NSParagraphStyleAttributeName: paragraphStyle + let attributes: [NSAttributedString.Key:AnyObject] = [ + NSAttributedString.Key.font: font, + NSAttributedString.Key.foregroundColor: UIColor.black, + NSAttributedString.Key.paragraphStyle: paragraphStyle ] - let size = nsText.size(attributes: attributes) + let size = nsText.size(withAttributes: attributes) let textRect = CGRect(origin: rect.origin, size: size) nsText.draw(in: textRect, withAttributes: attributes) @@ -109,7 +109,7 @@ extension PDFTextAnnotation: PDFAnnotation { } } -extension PDFTextAnnotation: ResizableViewDelegate { +extension UXMTextAnnotation: ResizableViewDelegate { func resizableViewDidBeginEditing(view: ResizableView) {} func resizableViewDidEndEditing(view: ResizableView) { @@ -121,13 +121,13 @@ extension PDFTextAnnotation: ResizableViewDelegate { } } -extension PDFTextAnnotation: PDFAnnotationButtonable { +extension UXMTextAnnotation: UXMPDFAnnotationButtonable { public static var name: String? { return "Text" } public static var buttonImage: UIImage? { return UIImage.bundledImage("text-symbol") } } -extension PDFTextAnnotation: UITextViewDelegate { +extension UXMTextAnnotation: UITextViewDelegate { public func textViewDidChange(_ textView: UITextView) { textView.sizeToFit() @@ -152,9 +152,9 @@ extension PDFTextAnnotation: UITextViewDelegate { } -class PDFTextAnnotationView: ResizableView, PDFAnnotationView { +class PDFTextAnnotationView: ResizableView, UXMPDFAnnotationView { - var parent: PDFAnnotation? + var parent: UXMAnnotation? override var canBecomeFirstResponder: Bool { return true } override var menuItems: [UIMenuItem] { return [ @@ -189,7 +189,7 @@ class PDFTextAnnotationView: ResizableView, PDFAnnotationView { } } - convenience init(parent: PDFTextAnnotation) { + convenience init(parent: UXMTextAnnotation) { self.init() @@ -209,7 +209,7 @@ class PDFTextAnnotationView: ResizableView, PDFAnnotationView { self.addSubview(textView) } - func menuActionEdit(_ sender: Any!) { + @objc func menuActionEdit(_ sender: Any!) { self.delegate?.resizableViewDidSelectAction(view: self, action: "edit") self.isLocked = true diff --git a/Pod/Classes/Extensions/CGPoint.swift b/Pod/Classes/Extensions/CGPoint.swift old mode 100644 new mode 100755 index 5dded27..de51470 --- a/Pod/Classes/Extensions/CGPoint.swift +++ b/Pod/Classes/Extensions/CGPoint.swift @@ -19,8 +19,8 @@ extension CGPoint { func rect(from point: CGPoint) -> CGRect { return CGRect(x: min(self.x, point.x), y: min(self.y, point.y), - width: fabs(self.x - point.x), - height: fabs(self.y - point.y)) + width: abs(self.x - point.x), + height: abs(self.y - point.y)) } /// Get the distance between two points diff --git a/Pod/Classes/Extensions/CGRect.swift b/Pod/Classes/Extensions/CGRect.swift old mode 100644 new mode 100755 index 94b9c25..8a8f2ae --- a/Pod/Classes/Extensions/CGRect.swift +++ b/Pod/Classes/Extensions/CGRect.swift @@ -55,8 +55,8 @@ extension CGRect { return CGRect( x: minX, y: minY, - width: fabs(maxX - minX), - height: fabs(maxY - minY) + width: abs(maxX - minX), + height: abs(maxY - minY) ) } } diff --git a/Pod/Classes/Extensions/UIColor.swift b/Pod/Classes/Extensions/UIColor.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Extensions/UIImage.swift b/Pod/Classes/Extensions/UIImage.swift old mode 100644 new mode 100755 index 5b84de3..9dacfa9 --- a/Pod/Classes/Extensions/UIImage.swift +++ b/Pod/Classes/Extensions/UIImage.swift @@ -19,7 +19,7 @@ extension UIImage { let image = UIImage(named: named) if image == nil { - let podBundle = Bundle(for: PDFViewController.classForCoder()) + let podBundle = Bundle(for: UXMPDFViewController.classForCoder()) if let bundleURL = podBundle.url(forResource: "UXMPDFKit", withExtension: "bundle"), let bundle = Bundle(url: bundleURL) { return UIImage( diff --git a/Pod/Classes/Extensions/UIScreen.swift b/Pod/Classes/Extensions/UIScreen.swift new file mode 100644 index 0000000..9b97226 --- /dev/null +++ b/Pod/Classes/Extensions/UIScreen.swift @@ -0,0 +1,72 @@ +// +// UIScreen.swift +// UXMPDFKit +// +// Created by Diego Stamigni on 26/01/2018. +// + +import UIKit + +extension UIScreen { + var widthOfSafeArea: CGFloat { + get { + guard let rootView = UIApplication.shared.keyWindow else { return 0 } + return rootView.bounds.height - self.leftSafeAreaInset - self.rightSafeAreaInset + } + } + + var heightOfSafeArea: CGFloat { + get { + guard let rootView = UIApplication.shared.keyWindow else { return 0 } + return rootView.bounds.height - self.topSafeAreaInset - self.bottomSafeAreaInset + } + } + + var topSafeAreaInset: CGFloat { + get { + guard let rootView = UIApplication.shared.keyWindow else { return 0 } + + if #available(iOS 11.0, *) { + return rootView.safeAreaInsets.top + } else { + return 0 + } + } + } + + var bottomSafeAreaInset: CGFloat { + get { + guard let rootView = UIApplication.shared.keyWindow else { return 0 } + + if #available(iOS 11.0, *) { + return rootView.safeAreaInsets.bottom + } else { + return 0 + } + } + } + + var leftSafeAreaInset: CGFloat { + get { + guard let rootView = UIApplication.shared.keyWindow else { return 0 } + + if #available(iOS 11.0, *) { + return rootView.safeAreaInsets.left + } else { + return 0 + } + } + } + + var rightSafeAreaInset: CGFloat { + get { + guard let rootView = UIApplication.shared.keyWindow else { return 0 } + + if #available(iOS 11.0, *) { + return rootView.safeAreaInsets.right + } else { + return 0 + } + } + } +} diff --git a/Pod/Classes/Extensions/UIView.swift b/Pod/Classes/Extensions/UIView.swift new file mode 100644 index 0000000..ddd8ff9 --- /dev/null +++ b/Pod/Classes/Extensions/UIView.swift @@ -0,0 +1,17 @@ +// +// UIView.swift +// UXMPDFKit +// +// Created by Diego Stamigni on 26/01/2018. +// + +import UIKit + +extension UIView { + var hasNotch: Bool { + get { + // https://stackoverflow.com/a/46192822 + return UIDevice().userInterfaceIdiom == .phone && UIScreen.main.nativeBounds.height >= 2436 + } + } +} diff --git a/Pod/Classes/Extensions/UIViewController.swift b/Pod/Classes/Extensions/UIViewController.swift old mode 100644 new mode 100755 index 1a64e4b..2725064 --- a/Pod/Classes/Extensions/UIViewController.swift +++ b/Pod/Classes/Extensions/UIViewController.swift @@ -10,6 +10,12 @@ import UIKit extension UIViewController { + var hasNotch: Bool { + get { + return self.view.hasNotch + } + } + static func topController() -> UIViewController? { if var topController = UIApplication.shared.keyWindow?.rootViewController { while let presentedViewController = topController.presentedViewController { diff --git a/Pod/Classes/Form/PDFArray.swift b/Pod/Classes/Form/UXMArray.swift old mode 100644 new mode 100755 similarity index 89% rename from Pod/Classes/Form/PDFArray.swift rename to Pod/Classes/Form/UXMArray.swift index 25bb87f..adac64e --- a/Pod/Classes/Form/PDFArray.swift +++ b/Pod/Classes/Form/UXMArray.swift @@ -1,5 +1,5 @@ // -// PDFArray.swift +// UXMArray.swift // Pods // // Created by Chris Anderson on 5/27/16. @@ -8,7 +8,7 @@ import UIKit -internal class PDFArray: PDFObject { +internal class UXMArray: UXMObject { fileprivate var arr: CGPDFArrayRef var array: [AnyObject] = [] @@ -79,18 +79,18 @@ internal class PDFArray: PDFObject { return nil } - func dictionaryAtIndex(_ index: Int) -> PDFDictionary? { + func dictionaryAtIndex(_ index: Int) -> UXMDictionary? { var dictionary: CGPDFDictionaryRef? = nil if CGPDFArrayGetDictionary(arr, index, &dictionary) { - return PDFDictionary(dictionaryRef: dictionary!) + return UXMDictionary(dictionaryRef: dictionary!) } return nil } - func arrayAtIndex(_ index: Int) -> PDFArray? { + func arrayAtIndex(_ index: Int) -> UXMArray? { var array: CGPDFArrayRef? = nil if CGPDFArrayGetArray(arr, index, &array) { - return PDFArray(arrayRef: array!) + return UXMArray(arrayRef: array!) } return nil } @@ -139,11 +139,11 @@ internal class PDFArray: PDFObject { return nil } - func streamAtIndex(_ index: Int) -> PDFDictionary? { + func streamAtIndex(_ index: Int) -> UXMDictionary? { var stream: CGPDFStreamRef? = nil if CGPDFArrayGetStream(arr, index, &stream) { let dictionaryRef = CGPDFStreamGetDictionary(stream!) - return PDFDictionary(dictionaryRef: dictionaryRef!) + return UXMDictionary(dictionaryRef: dictionaryRef!) } return nil } @@ -161,13 +161,13 @@ internal class PDFArray: PDFObject { } } -extension PDFArray: NSCopying { +extension UXMArray: NSCopying { func copy(with zone: NSZone?) -> Any { - return type(of: self).init(arrayRef: arr) + return Swift.type(of: self).init(arrayRef: arr) } } -extension PDFArray: Sequence { +extension UXMArray: Sequence { func makeIterator() -> AnyIterator { var nextIndex = array.count - 1 diff --git a/Pod/Classes/Form/PDFDictionary.swift b/Pod/Classes/Form/UXMDictionary.swift old mode 100644 new mode 100755 similarity index 88% rename from Pod/Classes/Form/PDFDictionary.swift rename to Pod/Classes/Form/UXMDictionary.swift index 9e0ceb9..c0ebdca --- a/Pod/Classes/Form/PDFDictionary.swift +++ b/Pod/Classes/Form/UXMDictionary.swift @@ -1,5 +1,5 @@ // -// PDFDictionary.swift +// UXMDictionary.swift // Pods // // Created by Chris Anderson on 5/27/16. @@ -8,11 +8,11 @@ import UIKit -internal protocol PDFObject { +internal protocol UXMObject { var type: CGPDFObjectType { get } } -fileprivate class PDFObjectParserContext { +fileprivate class UXMObjectParserContext { var keys: [UnsafePointer] = [] init(keys: [UnsafePointer]) { @@ -20,7 +20,7 @@ fileprivate class PDFObjectParserContext { } } -func == (lhs: PDFDictionary, rhs: PDFDictionary) -> Bool { +func == (lhs: UXMDictionary, rhs: UXMDictionary) -> Bool { let rect1 = lhs.arrayForKey("Rect")?.rect let rect2 = rhs.arrayForKey("Rect")?.rect @@ -33,12 +33,12 @@ func == (lhs: PDFDictionary, rhs: PDFDictionary) -> Bool { return rect1 == rect2 && keys1 == keys2 && t1 == t2 } -internal class PDFDictionary: PDFObject, Equatable { +internal class UXMDictionary: UXMObject, Equatable { var dict: CGPDFDictionaryRef lazy var attributes: [String:AnyObject] = { - var context = PDFObjectParserContext(keys: []) + var context = UXMObjectParserContext(keys: []) CGPDFDictionaryApplyFunction(self.dict, self.getDictionaryObjects, &context) self.keys = context.keys @@ -73,8 +73,8 @@ internal class PDFDictionary: PDFObject, Equatable { return attributes[key] } - func arrayForKey(_ key: String) -> PDFArray? { - return attributes[key] as? PDFArray + func arrayForKey(_ key: String) -> UXMArray? { + return attributes[key] as? UXMArray } func stringForKey(_ key: String) -> String? { @@ -129,15 +129,15 @@ internal class PDFDictionary: PDFObject, Equatable { return nil } - fileprivate func arrayFromKey(_ key: UnsafePointer) -> PDFArray? { + fileprivate func arrayFromKey(_ key: UnsafePointer) -> UXMArray? { var arrayObj: CGPDFArrayRef? = nil if CGPDFDictionaryGetArray(dict, key, &arrayObj) { - return PDFArray(arrayRef: arrayObj!) + return UXMArray(arrayRef: arrayObj!) } return nil } - fileprivate func dictionaryFromKey(_ key: UnsafePointer) -> PDFDictionary? { + fileprivate func dictionaryFromKey(_ key: UnsafePointer) -> UXMDictionary? { guard let stringKey = String(validatingUTF8: key) else { return nil } @@ -148,12 +148,12 @@ internal class PDFDictionary: PDFObject, Equatable { var dictObj: CGPDFArrayRef? = nil if CGPDFDictionaryGetDictionary(dict, key, &dictObj) { - return PDFDictionary(dictionaryRef: dictObj!) + return UXMDictionary(dictionaryRef: dictObj!) } return nil } - fileprivate func streamFromKey(_ key: UnsafePointer) -> PDFDictionary? { + fileprivate func streamFromKey(_ key: UnsafePointer) -> UXMDictionary? { guard let stringKey = String(validatingUTF8: key) else { return nil } @@ -165,14 +165,14 @@ internal class PDFDictionary: PDFObject, Equatable { var streamObj: CGPDFArrayRef? = nil if CGPDFDictionaryGetStream(self.dict, key, &streamObj) { let dictObj = CGPDFStreamGetDictionary(streamObj!) - return PDFDictionary(dictionaryRef: dictObj!) + return UXMDictionary(dictionaryRef: dictObj!) } return nil } func pdfObjectForKey(_ key: UnsafePointer) -> AnyObject? { var object: CGPDFObjectRef? = nil - if CGPDFDictionaryGetObject(dict, key, &object) { + if CGPDFDictionaryGetObject(dict, key, &object), object != nil { let type = CGPDFObjectGetType(object!) switch type { case CGPDFObjectType.boolean: return booleanFromKey(key) as AnyObject? @@ -192,7 +192,7 @@ internal class PDFDictionary: PDFObject, Equatable { } var getDictionaryObjects: CGPDFDictionaryApplierFunction = { (key, object, info) in - let context = info!.assumingMemoryBound(to: PDFObjectParserContext.self).pointee + let context = info!.assumingMemoryBound(to: UXMObjectParserContext.self).pointee context.keys.append(key) } @@ -202,7 +202,7 @@ internal class PDFDictionary: PDFObject, Equatable { var string = "\n\(spacer){\n" for (key, value) in attributes { - if let value = value as? PDFDictionary { + if let value = value as? UXMDictionary { string += "\(spacer)\(key) : \(value.description(level+1))" } else { string += "\(spacer)\(key) : \(value)\n" diff --git a/Pod/Classes/Form/PDFFormButtonField.swift b/Pod/Classes/Form/UXMFormButtonField.swift similarity index 83% rename from Pod/Classes/Form/PDFFormButtonField.swift rename to Pod/Classes/Form/UXMFormButtonField.swift index 82a4d93..2471df6 100644 --- a/Pod/Classes/Form/PDFFormButtonField.swift +++ b/Pod/Classes/Form/UXMFormButtonField.swift @@ -1,5 +1,5 @@ // -// PDFFormButtonField.swift +// UXMFormButtonField.swift // Pods // // Created by Chris Anderson on 6/1/16. @@ -18,7 +18,7 @@ public enum ButtonType { case radio, checkbox, push } -open class PDFFormButtonField: PDFFormField { +open class UXMFormButtonField: UXMFormField { open var buttonType = ButtonType.checkbox open var noOff = false open var name = "" @@ -31,7 +31,7 @@ open class PDFFormButtonField: PDFFormField { return false } - fileprivate var button = PDFToggleButton(frame: CGRect.zero) + fileprivate var button = UXMToggleButton(frame: CGRect.zero) fileprivate let inset: CGFloat = 1.0 init(frame: CGRect, radio: Bool) { @@ -60,13 +60,13 @@ open class PDFFormButtonField: PDFFormField { height: frame.height - inset * 2) button.isOpaque = false button.backgroundColor = UIColor.clear - button.addTarget(self, action: #selector(PDFFormButtonField.buttonPressed), for: .touchUpInside) + button.addTarget(self, action: #selector(UXMFormButtonField.buttonPressed), for: .touchUpInside) button.isUserInteractionEnabled = true button.isExclusiveTouch = true addSubview(button) } - func buttonPressed() { + @objc func buttonPressed() { value = (isSelected ? "" : exportValue) as AnyObject? delegate?.formFieldValueChanged(self) } @@ -91,7 +91,7 @@ open class PDFFormButtonField: PDFFormField { frame.origin.x += self.frame.origin.x frame.origin.y += self.frame.origin.y - let state = isSelected ? UIControlState.selected : UIControlState.normal + let state = isSelected ? UIControl.State.selected : UIControl.State.normal var title: NSString = "" let titleColor = button.titleColor(for: state) ?? UIColor.black let font: UIFont = button.titleLabel!.font @@ -105,10 +105,10 @@ open class PDFFormButtonField: PDFFormField { let paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle paragraphStyle.alignment = NSTextAlignment.center - let attributes: [String:AnyObject] = [ - NSFontAttributeName: font, - NSForegroundColorAttributeName: titleColor, - NSParagraphStyleAttributeName: paragraphStyle + let attributes: [NSAttributedString.Key:AnyObject] = [ + NSAttributedString.Key.font: font, + NSAttributedString.Key.foregroundColor: titleColor, + NSAttributedString.Key.paragraphStyle: paragraphStyle ] title.draw(in: frame, withAttributes: attributes) diff --git a/Pod/Classes/Form/PDFFormField.swift b/Pod/Classes/Form/UXMFormField.swift old mode 100644 new mode 100755 similarity index 58% rename from Pod/Classes/Form/PDFFormField.swift rename to Pod/Classes/Form/UXMFormField.swift index e89a565..a2e0276 --- a/Pod/Classes/Form/PDFFormField.swift +++ b/Pod/Classes/Form/UXMFormField.swift @@ -1,5 +1,5 @@ // -// PDFFormField.swift +// UXMFormField.swift // Pods // // Created by Chris Anderson on 5/26/16. @@ -8,19 +8,19 @@ import UIKit -protocol PDFFormViewDelegate { - func formFieldValueChanged(_ widget: PDFFormField) - func formFieldEntered(_ widget: PDFFormField) - func formFieldOptionsChanged(_ widget: PDFFormField) +protocol UXMFormViewDelegate : class { + func formFieldValueChanged(_ widget: UXMFormField) + func formFieldEntered(_ widget: UXMFormField) + func formFieldOptionsChanged(_ widget: UXMFormField) } -open class PDFFormFieldObject { +open class UXMFormFieldObject { var value: AnyObject? - var options: PDFFormViewOptions? + var options: UXMFormViewOptions? - let dict: PDFDictionary + let dict: UXMDictionary - init(dict: PDFDictionary) { + init(dict: UXMDictionary) { self.dict = dict guard let type = dict["FT"] as? String else { @@ -30,9 +30,9 @@ open class PDFFormFieldObject { return } - let flags: [PDFFormFlag] + let flags: [UXMFormFlag] if let flagsObj = dict["Ff"] as? NSNumber { - flags = self.determineFlags(UInt(flagsObj)) + flags = self.determineFlags(UInt(truncating: flagsObj)) } else { flags = [] @@ -41,7 +41,7 @@ open class PDFFormFieldObject { let export = self.determineExportValue(dict) let name = dict.stringForKey("T") ?? "" - options = PDFFormViewOptions( + options = UXMFormViewOptions( type: type, rect: rect, flags: flags, @@ -51,7 +51,7 @@ open class PDFFormFieldObject { ) } - func createFormField() -> PDFFormField? { + func createFormField() -> UXMFormField? { if let options = self.options { if options.type == "Btn" { return self.createButtonField(options) @@ -66,35 +66,35 @@ open class PDFFormFieldObject { return nil } - func determineFlags(_ flags: UInt) -> [PDFFormFlag] { - var flagsArr: [PDFFormFlag] = [] - if ((flags & PDFFormFlag.ReadOnly.rawValue) > 0) { - flagsArr.append(PDFFormFlag.ReadOnly) + func determineFlags(_ flags: UInt) -> [UXMFormFlag] { + var flagsArr: [UXMFormFlag] = [] + if ((flags & UXMFormFlag.ReadOnly.rawValue) > 0) { + flagsArr.append(UXMFormFlag.ReadOnly) } - if ((flags & PDFFormFlag.Required.rawValue) > 0) { - flagsArr.append(PDFFormFlag.Required) + if ((flags & UXMFormFlag.Required.rawValue) > 0) { + flagsArr.append(UXMFormFlag.Required) } - if ((flags & PDFFormFlag.NoExport.rawValue) > 0) { - flagsArr.append(PDFFormFlag.NoExport) + if ((flags & UXMFormFlag.NoExport.rawValue) > 0) { + flagsArr.append(UXMFormFlag.NoExport) } - if ((flags & PDFFormFlag.ButtonNoToggleToOff.rawValue) > 0) { - flagsArr.append(PDFFormFlag.ButtonNoToggleToOff) + if ((flags & UXMFormFlag.ButtonNoToggleToOff.rawValue) > 0) { + flagsArr.append(UXMFormFlag.ButtonNoToggleToOff) } - if ((flags & PDFFormFlag.ButtonRadio.rawValue) > 0) { - flagsArr.append(PDFFormFlag.ButtonRadio) + if ((flags & UXMFormFlag.ButtonRadio.rawValue) > 0) { + flagsArr.append(UXMFormFlag.ButtonRadio) } - if ((flags & PDFFormFlag.ButtonPushButton.rawValue) > 0) { - flagsArr.append(PDFFormFlag.ButtonPushButton) + if ((flags & UXMFormFlag.ButtonPushButton.rawValue) > 0) { + flagsArr.append(UXMFormFlag.ButtonPushButton) } - if ((flags & PDFFormFlag.TextFieldMultiline.rawValue) > 0) { - flagsArr.append(PDFFormFlag.TextFieldMultiline) + if ((flags & UXMFormFlag.TextFieldMultiline.rawValue) > 0) { + flagsArr.append(UXMFormFlag.TextFieldMultiline) } return flagsArr } - func determineExportValue(_ dict: PDFDictionary) -> String { - if let apObj = dict["AP"] as? PDFDictionary { - if let nObj = apObj["N"] as? PDFDictionary { + func determineExportValue(_ dict: UXMDictionary) -> String { + if let apObj = dict["AP"] as? UXMDictionary { + if let nObj = apObj["N"] as? UXMDictionary { for key in nObj.allKeys() { if key == "Off" || key == "OFF" { return key @@ -109,9 +109,9 @@ open class PDFFormFieldObject { return "" } - func createTextField(_ options: PDFFormViewOptions) -> PDFFormField { - let multiline = options.flags?.contains(PDFFormFlag.TextFieldMultiline) ?? false - let field = PDFFormTextField(frame: options.rect, multiline: multiline, alignment: NSTextAlignment.left) + func createTextField(_ options: UXMFormViewOptions) -> UXMFormField { + let multiline = options.flags?.contains(UXMFormFlag.TextFieldMultiline) ?? false + let field = UXMFormTextField(frame: options.rect, multiline: multiline, alignment: NSTextAlignment.left) field.delegate = self if let value = self.value { field.value = value @@ -119,9 +119,9 @@ open class PDFFormFieldObject { return field } - func createButtonField(_ options: PDFFormViewOptions) -> PDFFormField { - let radio = options.flags?.contains(where: { $0 == PDFFormFlag.ButtonRadio }) ?? false - let field = PDFFormButtonField(frame: options.rect, radio: radio) + func createButtonField(_ options: UXMFormViewOptions) -> UXMFormField { + let radio = options.flags?.contains(where: { $0 == UXMFormFlag.ButtonRadio }) ?? false + let field = UXMFormButtonField(frame: options.rect, radio: radio) field.name = options.name field.exportValue = options.exportValue field.delegate = self @@ -132,8 +132,8 @@ open class PDFFormFieldObject { return field } - func createSignatureField(_ options: PDFFormViewOptions) -> PDFFormField { - let field = PDFFormSignatureField(frame: options.rect) + func createSignatureField(_ options: UXMFormViewOptions) -> UXMFormField { + let field = UXMFormSignatureField(frame: options.rect) field.delegate = self if let value = self.value { field.value = value @@ -142,19 +142,20 @@ open class PDFFormFieldObject { } } -extension PDFFormFieldObject: PDFFormViewDelegate { - func formFieldValueChanged(_ widget: PDFFormField) { +extension UXMFormFieldObject: UXMFormViewDelegate { + func formFieldValueChanged(_ widget: UXMFormField) { self.value = widget.value } - func formFieldEntered(_ widget: PDFFormField) { } + func formFieldEntered(_ widget: UXMFormField) { } - func formFieldOptionsChanged(_ widget: PDFFormField) { } + func formFieldOptionsChanged(_ widget: UXMFormField) { } } -open class PDFFormField: UIView { +open class UXMFormField: UIView { var zoomScale: CGFloat = 1.0 var options: [AnyObject] = [] + var parent: UXMFormPageView? var baseFrame: CGRect var value: AnyObject? { didSet { @@ -162,7 +163,7 @@ open class PDFFormField: UIView { } } - var delegate: PDFFormViewDelegate? + weak var delegate: UXMFormViewDelegate? override init(frame: CGRect) { self.baseFrame = frame @@ -212,4 +213,13 @@ open class PDFFormField: UIView { func renderInContext(_ context: CGContext) { } + + func resign() {} + + deinit { + if (parent?.activeWidgetAnnotationView == self) { + self.resign() + parent?.activeWidgetAnnotationView = nil; + } + } } diff --git a/Pod/Classes/Form/PDFFormPageView.swift b/Pod/Classes/Form/UXMFormPageView.swift old mode 100644 new mode 100755 similarity index 50% rename from Pod/Classes/Form/PDFFormPageView.swift rename to Pod/Classes/Form/UXMFormPageView.swift index 9e3b729..9148c8b --- a/Pod/Classes/Form/PDFFormPageView.swift +++ b/Pod/Classes/Form/UXMFormPageView.swift @@ -8,67 +8,67 @@ import UIKit -struct PDFFormViewOptions { +struct UXMFormViewOptions { var type: String var rect: CGRect - var flags: [PDFFormFlag]? + var flags: [UXMFormFlag]? var name: String = "" var exportValue: String = "" var options: [String]? } -struct PDFFormFlag: Equatable { +struct UXMFormFlag: Equatable { let rawValue: UInt - static let ReadOnly = PDFFormFlag(rawValue:1 << 0) - static let Required = PDFFormFlag(rawValue:1 << 1) - static let NoExport = PDFFormFlag(rawValue:1 << 2) - static let TextFieldMultiline = PDFFormFlag(rawValue:1 << 12) - static let TextFieldPassword = PDFFormFlag(rawValue:1 << 13) - static let ButtonNoToggleToOff = PDFFormFlag(rawValue:1 << 14) - static let ButtonRadio = PDFFormFlag(rawValue:1 << 15) - static let ButtonPushButton = PDFFormFlag(rawValue:1 << 16) - static let ChoiceFieldIsCombo = PDFFormFlag(rawValue:1 << 17) - static let ChoiceFieldEditable = PDFFormFlag(rawValue:1 << 18) - static let ChoiceFieldSorted = PDFFormFlag(rawValue:1 << 19) + static let ReadOnly = UXMFormFlag(rawValue:1 << 0) + static let Required = UXMFormFlag(rawValue:1 << 1) + static let NoExport = UXMFormFlag(rawValue:1 << 2) + static let TextFieldMultiline = UXMFormFlag(rawValue:1 << 12) + static let TextFieldPassword = UXMFormFlag(rawValue:1 << 13) + static let ButtonNoToggleToOff = UXMFormFlag(rawValue:1 << 14) + static let ButtonRadio = UXMFormFlag(rawValue:1 << 15) + static let ButtonPushButton = UXMFormFlag(rawValue:1 << 16) + static let ChoiceFieldIsCombo = UXMFormFlag(rawValue:1 << 17) + static let ChoiceFieldEditable = UXMFormFlag(rawValue:1 << 18) + static let ChoiceFieldSorted = UXMFormFlag(rawValue:1 << 19) } -func ==(lhs: PDFFormFlag, rhs: PDFFormFlag) -> Bool { +func ==(lhs: UXMFormFlag, rhs: UXMFormFlag) -> Bool { return lhs.rawValue == rhs.rawValue } -open class PDFFormPage: NSObject { +open class UXMFormPage: NSObject { let page: Int - var fields: [PDFFormFieldObject] = [] + var fields: [UXMFormFieldObject] = [] let zoomScale: CGFloat = 1.0 init(page: Int) { self.page = page } - func showForm(_ contentView: PDFPageContentView) { - let formView = PDFFormPageView( + func showForm(_ contentView: UXMPageContentView) { + let formView = UXMFormPageView( frame: contentView.contentView.cropBoxRect, boundingBox: contentView.containerView.frame, cropBox: contentView.contentView.cropBoxRect, fields: self.fields) formView.zoomScale = contentView.zoomScale - if contentView.contentView.subviews.filter({ $0 is PDFFormPageView }).count <= 0 { + if contentView.contentView.subviews.filter({ $0 is UXMFormPageView }).count <= 0 { contentView.contentView.addSubview(formView) } contentView.viewDidZoom = { scale in formView.updateWithZoom(scale) } - contentView.sendSubview(toBack: formView) + contentView.sendSubviewToBack(formView) } - func createFormField(_ dict: PDFDictionary) { - fields.append(PDFFormFieldObject(dict: dict)) + func createFormField(_ dict: UXMDictionary) { + fields.append(UXMFormFieldObject(dict: dict)) } func renderInContext(_ context: CGContext, size: CGRect) { - let formView = PDFFormPageView( + let formView = UXMFormPageView( frame: size, boundingBox: size, cropBox: size, @@ -77,24 +77,33 @@ open class PDFFormPage: NSObject { } } -open class PDFFormPageView: UIView { - var fields: [PDFFormFieldObject] - var fieldViews: [PDFFormField] = [] +open class UXMFormPageView: UIView { + var fields: [UXMFormFieldObject] + var fieldViews: [UXMFormField] = [] var zoomScale: CGFloat = 1.0 + + var activeWidgetAnnotationView: UXMFormField? + + var tapGestureRecognizer: UITapGestureRecognizer? let cropBox: CGRect let boundingBox: CGRect let baseFrame: CGRect - init(frame: CGRect, boundingBox: CGRect, cropBox: CGRect, fields: [PDFFormFieldObject]) { + init(frame: CGRect, boundingBox: CGRect, cropBox: CGRect, fields: [UXMFormFieldObject]) { self.baseFrame = frame self.cropBox = cropBox self.boundingBox = boundingBox self.fields = fields super.init(frame: frame) + + self.tapGestureRecognizer = UITapGestureRecognizer(target: self, action: nil) + self.tapGestureRecognizer?.delegate = self + self.addGestureRecognizer(tapGestureRecognizer!) for field in fields { guard let fieldView = field.createFormField() else { continue } + fieldView.parent = self addSubview(fieldView) adjustFrame(fieldView) fieldViews.append(fieldView) @@ -112,7 +121,7 @@ open class PDFFormPageView: UIView { } } - func adjustFrame(_ field: PDFFormField) { + func adjustFrame(_ field: UXMFormField) { let factor: CGFloat = 1.0 let correctedFrame = CGRect( x: (field.baseFrame.origin.x - cropBox.origin.x) * factor, @@ -129,3 +138,25 @@ open class PDFFormPageView: UIView { } } } + +extension UXMFormPageView: UIGestureRecognizerDelegate { + + public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { + return true + } + + public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { + if (activeWidgetAnnotationView == nil) { return false } + let rect = activeWidgetAnnotationView?.frame + if(!(rect?.contains(touch.location(in: self)))!) { + if (activeWidgetAnnotationView?.isKind(of: UITextView.self))! { + activeWidgetAnnotationView?.resignFirstResponder() + } else { + activeWidgetAnnotationView?.resign() + } + } + + return false + } + +} diff --git a/Pod/Classes/Form/PDFFormSignatureField.swift b/Pod/Classes/Form/UXMFormSignatureField.swift similarity index 73% rename from Pod/Classes/Form/PDFFormSignatureField.swift rename to Pod/Classes/Form/UXMFormSignatureField.swift index e7a013c..952c201 100644 --- a/Pod/Classes/Form/PDFFormSignatureField.swift +++ b/Pod/Classes/Form/UXMFormSignatureField.swift @@ -8,7 +8,7 @@ import UIKit -open class PDFFormSignatureField: PDFFormField { +open class UXMFormSignatureField: UXMFormField { open var name: String? @@ -17,17 +17,17 @@ open class PDFFormSignatureField: PDFFormField { lazy fileprivate var signButton: UIButton = { var button = UIButton(frame: CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.height)) - button.setTitle("Tap To Sign", for: UIControlState()) + button.setTitle("Tap To Sign", for: UIControl.State()) button.tintColor = UIColor.black button.titleLabel?.font = UIFont.systemFont(ofSize: 14.0) - button.setTitleColor(UIColor.black, for: UIControlState()) - button.addTarget(self, action: #selector(PDFFormSignatureField.addSignature), for: .touchUpInside) + button.setTitleColor(UIColor.black, for: UIControl.State()) + button.addTarget(self, action: #selector(UXMFormSignatureField.addSignature), for: .touchUpInside) button.isUserInteractionEnabled = true button.isExclusiveTouch = true return button }() - lazy fileprivate var signImage:UIImageView = { + lazy fileprivate var signImage: UIImageView = { var image = UIImageView(frame: CGRect( x: 0, y: -self.signatureExtraPadding, @@ -48,7 +48,7 @@ open class PDFFormSignatureField: PDFFormField { addSubview(signImage) addSubview(signButton) - bringSubview(toFront: signButton) + bringSubviewToFront(signButton) } required public init?(coder aDecoder: NSCoder) { @@ -61,9 +61,9 @@ open class PDFFormSignatureField: PDFFormField { } } - func addSignature() { + @objc func addSignature() { - let vc = PDFFormSignatureViewController() + let vc = UXMFormSignatureViewController() vc.delegate = self let nvc = UINavigationController(rootViewController: vc) nvc.modalPresentationStyle = .formSheet @@ -80,8 +80,8 @@ open class PDFFormSignatureField: PDFFormField { } } -extension PDFFormSignatureField: PDFFormSignatureDelegate { - func completedSignatureDrawing(field: PDFFormFieldSignatureCaptureView) { +extension UXMFormSignatureField: UXMFormSignatureDelegate { + func completedSignatureDrawing(field: UXMFormFieldSignatureCaptureView) { signImage.image = field.getSignature() signButton.setTitle("", for: .normal) @@ -90,27 +90,30 @@ extension PDFFormSignatureField: PDFFormSignatureDelegate { } } -protocol PDFFormSignatureDelegate { - func completedSignatureDrawing(field: PDFFormFieldSignatureCaptureView) +protocol UXMFormSignatureDelegate: class { + func completedSignatureDrawing(field: UXMFormFieldSignatureCaptureView) } -class PDFFormSignatureViewController: UIViewController { +class UXMFormSignatureViewController: UIViewController { - var signatureView = PDFFormFieldSignatureCaptureView() - var delegate: PDFFormSignatureDelegate? + // Allow View to rotate disregarding current app orientation restrictions + @objc func canRotate() -> Void {} + + var signatureView = UXMFormFieldSignatureCaptureView() + weak var delegate: UXMFormSignatureDelegate? lazy fileprivate var doneButton: UIBarButtonItem = UIBarButtonItem( title: "Done", style: .plain, target: self, - action: #selector(PDFFormSignatureViewController.tappedDone) + action: #selector(UXMFormSignatureViewController.tappedDone) ) - lazy fileprivate var clearButton:UIBarButtonItem = UIBarButtonItem( + lazy fileprivate var clearButton: UIBarButtonItem = UIBarButtonItem( title: "Clear", style: .plain, target: self, - action: #selector(PDFFormSignatureViewController.tappedClear) + action: #selector(UXMFormSignatureViewController.tappedClear) ) override func viewDidLoad() { @@ -130,6 +133,12 @@ class PDFFormSignatureViewController: UIViewController { self.signatureView.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height) } + override func viewWillDisappear(_ animated: Bool) { + let value = UIInterfaceOrientation.portrait.rawValue + UIDevice.current.setValue(value, forKey: "orientation") + UINavigationController.attemptRotationToDeviceOrientation() + } + @IBAction func tappedDone() { self.delegate?.completedSignatureDrawing(field: self.signatureView) @@ -142,7 +151,7 @@ class PDFFormSignatureViewController: UIViewController { } } -class PDFFormFieldSignatureCaptureView: UIView { +class UXMFormFieldSignatureCaptureView: UIView { // MARK: - Public properties var strokeWidth: CGFloat = 2.0 { @@ -218,7 +227,7 @@ class PDFFormFieldSignatureCaptureView: UIView { ctr += 1 pts[ctr] = touchPoint if (ctr == 4) { - pts[3] = CGPoint(x: (pts[2].x + pts[4].x)/2.0, y: (pts[2].y + pts[4].y)/2.0) + pts[3] = CGPoint(x: (pts[2].x + pts[4].x) / 2.0, y: (pts[2].y + pts[4].y) / 2.0) path.move(to: pts[0]) path.addCurve(to: pts[3], controlPoint1: pts[1], controlPoint2: pts[2]) @@ -235,8 +244,8 @@ class PDFFormFieldSignatureCaptureView: UIView { override func touchesEnded(_ touches: Set , with event: UIEvent?) { if ctr == 0 { let touchPoint = pts[0] - path.move(to: CGPoint(x: touchPoint.x-1.0,y: touchPoint.y)) - path.addLine(to: CGPoint(x: touchPoint.x+1.0,y: touchPoint.y)) + path.move(to: CGPoint(x: touchPoint.x - 1.0, y: touchPoint.y)) + path.addLine(to: CGPoint(x: touchPoint.x + 1.0, y: touchPoint.y)) setNeedsDisplay() } else { ctr = 0 @@ -266,10 +275,10 @@ class PDFFormFieldSignatureCaptureView: UIView { } func getSignatureCropped(scale: CGFloat = 1) -> UIImage? { - guard let fullRender = getSignature(scale:scale) else { + guard let fullRender = getSignature(scale: scale) else { return nil } - let bounds = scaleRect(path.bounds.insetBy(dx: -strokeWidth/2, dy: -strokeWidth/2), byFactor: scale) + let bounds = scaleRect(path.bounds.insetBy(dx: -strokeWidth / 2, dy: -strokeWidth / 2), byFactor: scale) guard let imageRef = fullRender.cgImage?.cropping(to: bounds) else { return nil } @@ -283,5 +292,31 @@ class PDFFormFieldSignatureCaptureView: UIView { scaledRect.size.width *= factor scaledRect.size.height *= factor return scaledRect + } + + // Saves the Signature as a Vector PDF Data blob + public func getPDFSignature() -> Data { + + let mutableData = CFDataCreateMutable(nil, 0) + + guard let dataConsumer = CGDataConsumer.init(data: mutableData!) else { fatalError() } + + var rect = CGRect(x: 0, y: 0, width: frame.width, height: frame.height) + + guard let pdfContext = CGContext(consumer: dataConsumer, mediaBox: &rect, nil) else { fatalError() } + + pdfContext.beginPDFPage(nil) + pdfContext.translateBy(x: 0, y: frame.height) + pdfContext.scaleBy(x: 1, y: -1) + pdfContext.addPath(path.cgPath) + pdfContext.setStrokeColor(strokeColor.cgColor) + pdfContext.strokePath() + pdfContext.saveGState() + pdfContext.endPDFPage() + pdfContext.closePDF() + + let data = mutableData! as Data + + return data } } diff --git a/Pod/Classes/Form/PDFFormTextField.swift b/Pod/Classes/Form/UXMFormTextField.swift similarity index 82% rename from Pod/Classes/Form/PDFFormTextField.swift rename to Pod/Classes/Form/UXMFormTextField.swift index bb4040a..fd6e83d 100644 --- a/Pod/Classes/Form/PDFFormTextField.swift +++ b/Pod/Classes/Form/UXMFormTextField.swift @@ -1,5 +1,5 @@ // -// PDFFormTextField.swift +// UXMFormTextField.swift // Pods // // Created by Chris Anderson on 5/26/16. @@ -8,7 +8,7 @@ import UIKit -open class PDFFormTextField: PDFFormField { +open class UXMFormTextField: UXMFormField { let multiline: Bool let textEntryBox: UIView let baseFontSize: CGFloat @@ -59,7 +59,7 @@ open class PDFFormTextField: PDFFormField { textView.autoresizingMask = [.flexibleWidth, .flexibleHeight] textView.delegate = self textView.isScrollEnabled = true - textView.textContainerInset = UIEdgeInsetsMake(4, 4, 4, 4) + textView.textContainerInset = UIEdgeInsets.init(top: 4, left: 4, bottom: 4, right: 4) let fontSize = fontSizeForRect(frame) < 13.0 ? fontSizeForRect(frame) : 13.0 textView.font = UIFont.systemFont(ofSize: fontSize) } @@ -72,7 +72,7 @@ open class PDFFormTextField: PDFFormField { textField.adjustsFontSizeToFitWidth = true textField.minimumFontSize = 6.0 textField.font = UIFont.systemFont(ofSize: fontSizeForRect(self.frame)) - textField.addTarget(self, action: #selector(PDFFormTextField.textChanged), for: .editingChanged) + textField.addTarget(self, action: #selector(UXMFormTextField.textChanged), for: .editingChanged) } layer.cornerRadius = frame.size.height / 6 @@ -119,26 +119,40 @@ open class PDFFormTextField: PDFFormField { } /// UGLY - (text as NSString!).draw(in: frame, withAttributes: [ - NSFontAttributeName: font + (text as NSString).draw(in: frame, withAttributes: [ + NSAttributedString.Key.font: font ]) } + + override func resign() { + textEntryBox.resignFirstResponder() + } } -extension PDFFormTextField: UITextFieldDelegate { - func textChanged() { +extension UXMFormTextField: UITextFieldDelegate { + @objc func textChanged() { value = text as AnyObject? delegate?.formFieldValueChanged(self) } public func textFieldDidBeginEditing(_ textField: UITextField) { delegate?.formFieldEntered(self) + self.parent?.activeWidgetAnnotationView = self + } + + public func textFieldDidEndEditing(_ textField: UITextField) { + self.parent?.activeWidgetAnnotationView = nil } } -extension PDFFormTextField: UITextViewDelegate { +extension UXMFormTextField: UITextViewDelegate { public func textViewDidBeginEditing(_ textView: UITextView) { delegate?.formFieldEntered(self) + self.parent?.activeWidgetAnnotationView = self + } + + public func textViewDidEndEditing(_ textView: UITextView) { + self.parent?.activeWidgetAnnotationView = nil; } public func textViewDidChange(_ textView: UITextView) { diff --git a/Pod/Classes/Form/PDFFormViewController.swift b/Pod/Classes/Form/UXMFormViewController.swift old mode 100644 new mode 100755 similarity index 73% rename from Pod/Classes/Form/PDFFormViewController.swift rename to Pod/Classes/Form/UXMFormViewController.swift index c236cd1..e439b74 --- a/Pod/Classes/Form/PDFFormViewController.swift +++ b/Pod/Classes/Form/UXMFormViewController.swift @@ -8,17 +8,17 @@ import Foundation -open class PDFFormViewController: NSObject { - var formPages: [Int: PDFFormPage] = [:] +open class UXMFormViewController: NSObject { + var formPages: [Int: UXMFormPage] = [:] - let document: PDFDocument - let parser: PDFObjectParser - var lastPage: PDFPageContentView? + let document: UXMPDFDocument + let parser: UXMObjectParser + var lastPage: UXMPageContentView? - public init(document: PDFDocument) { + public init(document: UXMPDFDocument) { self.document = document - parser = PDFObjectParser(document: document) + parser = UXMObjectParser(document: document) super.init() @@ -30,7 +30,7 @@ open class PDFFormViewController: NSObject { guard let attributes = self.parser.attributes else { return } - guard let pages = attributes["Pages"] as? PDFDictionary else { + guard let pages = attributes["Pages"] as? UXMDictionary else { return } guard let kids = pages.arrayForKey("Kids") else { @@ -40,12 +40,12 @@ open class PDFFormViewController: NSObject { var page = kids.count for kid in kids { - if let dict = kid as? PDFDictionary, + if let dict = kid as? UXMDictionary, let annots = dict.arrayForKey("Annots") { for annot in annots { - guard let annot = annot as? PDFDictionary else { continue } + guard let annot = annot as? UXMDictionary else { continue } self.enumerate(annot, page: page) } } @@ -60,7 +60,7 @@ open class PDFFormViewController: NSObject { } } - func enumerate(_ fieldDict: PDFDictionary, page: Int = 0) { + func enumerate(_ fieldDict: UXMDictionary, page: Int = 0) { if fieldDict["Subtype"] != nil { @@ -73,7 +73,7 @@ open class PDFFormViewController: NSObject { } for dict in array { - guard let innerFieldDict = dict as? PDFDictionary else { continue } + guard let innerFieldDict = dict as? UXMDictionary else { continue } if let type = innerFieldDict["Type"] as? String , type == "Annot" { createFormField(innerFieldDict, page: page) } @@ -83,20 +83,20 @@ open class PDFFormViewController: NSObject { } } - func createFormField(_ dict: PDFDictionary, page: Int = 0) { + func createFormField(_ dict: UXMDictionary, page: Int = 0) { DispatchQueue.main.async { if let formView = self.form(page: page) { formView.createFormField(dict) } else { - let formView = PDFFormPage(page: page) + let formView = UXMFormPage(page: page) formView.createFormField(dict) self.formPages[page] = formView } } } - func showForm(_ contentView: PDFPageContentView) { + func showForm(_ contentView: UXMPageContentView) { lastPage = contentView let page = contentView.page if let formPage = self.form(page: page) { @@ -104,12 +104,12 @@ open class PDFFormViewController: NSObject { } } - func form(page: Int) -> PDFFormPage? { + func form(page: Int) -> UXMFormPage? { return formPages[page] } } -extension PDFFormViewController: PDFRenderer { +extension UXMFormViewController: UXMRenderer { public func render(_ page: Int, context: CGContext, bounds: CGRect) { if let form = form(page: page) { form.renderInContext(context, size: bounds) diff --git a/Pod/Classes/Form/PDFObjectParser.swift b/Pod/Classes/Form/UXMObjectParser.swift old mode 100644 new mode 100755 similarity index 57% rename from Pod/Classes/Form/PDFObjectParser.swift rename to Pod/Classes/Form/UXMObjectParser.swift index 6a29c22..00d3327 --- a/Pod/Classes/Form/PDFObjectParser.swift +++ b/Pod/Classes/Form/UXMObjectParser.swift @@ -8,14 +8,14 @@ import UIKit -open class PDFObjectParser { - let document: PDFDocument - let attributes: PDFDictionary? +open class UXMObjectParser { + let document: UXMPDFDocument + let attributes: UXMDictionary? - public init(document: PDFDocument) { + public init(document: UXMPDFDocument) { self.document = document if let catalogue = document.documentRef?.catalog { - attributes = PDFDictionary(dictionaryRef: catalogue) + attributes = UXMDictionary(dictionaryRef: catalogue) } else { attributes = nil diff --git a/Pod/Classes/Form/PDFToggleButton.swift b/Pod/Classes/Form/UXMToggleButton.swift old mode 100644 new mode 100755 similarity index 83% rename from Pod/Classes/Form/PDFToggleButton.swift rename to Pod/Classes/Form/UXMToggleButton.swift index 45a944c..bcdbbd8 --- a/Pod/Classes/Form/PDFToggleButton.swift +++ b/Pod/Classes/Form/UXMToggleButton.swift @@ -8,7 +8,7 @@ import UIKit -class PDFToggleButton: UIButton { +class UXMToggleButton: UIButton { override init(frame: CGRect) { super.init(frame: frame) @@ -20,7 +20,7 @@ class PDFToggleButton: UIButton { } func setup() { - addTarget(self, action: #selector(PDFToggleButton.buttonTapped), for: .touchUpInside) + addTarget(self, action: #selector(UXMToggleButton.buttonTapped), for: .touchUpInside) setTitle("", for: .normal) setTitle(checkmark, for: .selected) setTitleColor(UIColor.black, for: .normal) @@ -28,7 +28,7 @@ class PDFToggleButton: UIButton { titleLabel?.font = UIFont(name: "ZapfDingbatsITC", size: 10) } - func buttonTapped() { + @objc func buttonTapped() { self.isSelected = !self.isSelected } } diff --git a/Pod/Classes/Model/PDFActionURL.swift b/Pod/Classes/Model/PDFActionURL.swift deleted file mode 100644 index b23d619..0000000 --- a/Pod/Classes/Model/PDFActionURL.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// PDFActionURL.swift -// Pods -// -// Created by Chris Anderson on 11/15/16. -// -// - -import Foundation - -open class PDFActionURL: PDFAction { - var url: URL - - public init(url: URL) { - self.url = url - } - - public init(stringUrl: String) { - self.url = URL(string: stringUrl)! - } -} diff --git a/Pod/Classes/Model/PDFAction.swift b/Pod/Classes/Model/UXMAction.swift similarity index 95% rename from Pod/Classes/Model/PDFAction.swift rename to Pod/Classes/Model/UXMAction.swift index dfa7fcb..2f16525 100644 --- a/Pod/Classes/Model/PDFAction.swift +++ b/Pod/Classes/Model/UXMAction.swift @@ -1,5 +1,5 @@ // -// PDFAction.swift +// UXMAction.swift // Pods // // Created by Chris Anderson on 9/12/16. @@ -8,9 +8,9 @@ import Foundation -open class PDFAction { - open static func fromPDFDictionary(_ sourceDictionary: CGPDFDictionaryRef, documentReference: CGPDFDocument) -> PDFAction? { - var action: PDFAction? +open class UXMAction { + public static func fromPDFDictionary(_ sourceDictionary: CGPDFDictionaryRef, documentReference: CGPDFDocument) -> UXMAction? { + var action: UXMAction? var destinationName: CGPDFStringRef? = nil var destinationString: UnsafePointer? = nil var actionDictionary: CGPDFDictionaryRef? = nil @@ -38,7 +38,7 @@ open class PDFAction { let uri = UnsafeRawPointer(CGPDFStringGetBytePtr(uriString!)!).assumingMemoryBound(to: Int8.self) if let target = String(validatingUTF8: uri) { - action = PDFActionURL(stringUrl: target) + action = UXMActionURL(stringUrl: target) } } } @@ -115,7 +115,7 @@ open class PDFAction { /// We have a target page number, make GoTo link if targetPageNumber > 0 { - action = PDFActionGoTo(pageIndex: targetPageNumber) + action = UXMActionGoTo(pageIndex: targetPageNumber) } } diff --git a/Pod/Classes/Model/PDFActionGoTo.swift b/Pod/Classes/Model/UXMActionGoTo.swift old mode 100644 new mode 100755 similarity index 84% rename from Pod/Classes/Model/PDFActionGoTo.swift rename to Pod/Classes/Model/UXMActionGoTo.swift index fdf5816..28c0054 --- a/Pod/Classes/Model/PDFActionGoTo.swift +++ b/Pod/Classes/Model/UXMActionGoTo.swift @@ -8,7 +8,7 @@ import Foundation -open class PDFActionGoTo: PDFAction { +open class UXMActionGoTo: UXMAction { var pageIndex: Int public init(pageIndex: Int) { diff --git a/Pod/Classes/Model/UXMActionURL.swift b/Pod/Classes/Model/UXMActionURL.swift new file mode 100755 index 0000000..9931d07 --- /dev/null +++ b/Pod/Classes/Model/UXMActionURL.swift @@ -0,0 +1,22 @@ +// +// UXMActionURL.swift +// Pods +// +// Created by Chris Anderson on 11/15/16. +// +// + +import Foundation + +open class UXMActionURL: UXMAction { + var url: URL + + public init(url: URL) { + self.url = url + } + + public init?(stringUrl: String) { + guard let url = URL(string: stringUrl) else { return nil } + self.url = url + } +} diff --git a/Pod/Classes/Renderer/CGPDFDocument.swift b/Pod/Classes/Renderer/CGPDFDocument.swift old mode 100644 new mode 100755 diff --git a/Pod/Classes/Renderer/PDFRenderer.swift b/Pod/Classes/Renderer/PDFRenderer.swift deleted file mode 100644 index 94b1deb..0000000 --- a/Pod/Classes/Renderer/PDFRenderer.swift +++ /dev/null @@ -1,62 +0,0 @@ -// -// PDFRenderer.swift -// Pods -// -// Created by Chris Anderson on 6/25/16. -// -// - -import Foundation - -public protocol PDFRenderer { - func render(_ page: Int, context:CGContext, bounds: CGRect) -} - -open class PDFRenderController { - let document: PDFDocument - let renderControllers: [PDFRenderer] - - public init(document: PDFDocument, controllers: [PDFRenderer]) { - self.document = document - self.renderControllers = controllers - } - - open func renderOntoPDF() -> URL { - let documentRef = document.documentRef - let pages = document.pageCount - let title = document.fileUrl?.lastPathComponent ?? "annotated.pdf" - let tempPath = NSTemporaryDirectory() + title - - UIGraphicsBeginPDFContextToFile(tempPath, CGRect.zero, nil) - for i in 1...pages { - let page = documentRef?.page(at: i) - let bounds = document.boundsForPDFPage(i) - - guard let context = UIGraphicsGetCurrentContext() else { continue } - UIGraphicsBeginPDFPageWithInfo(bounds, nil) - context.translateBy(x: 0, y: bounds.size.height) - context.scaleBy(x: 1.0, y: -1.0) - context.drawPDFPage (page!) - - context.scaleBy(x: 1.0, y: -1.0) - context.translateBy(x: 0, y: -bounds.size.height) - - for controller in renderControllers { - controller.render(i, context:context, bounds:bounds) - } - } - UIGraphicsEndPDFContext() - - return URL(fileURLWithPath: tempPath) - } - - open func save(_ url: URL) -> Bool { - let tempUrl = self.renderOntoPDF() - let fileManger = FileManager.default - do { - try fileManger.copyItem(at: tempUrl, to: url) - } - catch _ { return false } - return true - } -} diff --git a/Pod/Classes/Renderer/PDFThumbnailView.swift b/Pod/Classes/Renderer/PDFThumbnailView.swift deleted file mode 100644 index 5c31902..0000000 --- a/Pod/Classes/Renderer/PDFThumbnailView.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// PDFThumbnailView.swift -// Pods -// -// Created by Chris Anderson on 5/6/16. -// -// - -import UIKit - -internal class PDFThumbnailView: UIView { - let imageView: UIImageView - - override init(frame: CGRect) { - imageView = UIImageView() - imageView.autoresizesSubviews = false - imageView.isUserInteractionEnabled = false - imageView.autoresizingMask = UIViewAutoresizing() - imageView.translatesAutoresizingMaskIntoConstraints = false - imageView.contentMode = .scaleAspectFit - - super.init(frame: frame) - - imageView.frame = frame - addSubview(imageView) - - autoresizesSubviews = false - isUserInteractionEnabled = false - contentMode = .redraw - autoresizingMask = UIViewAutoresizing() - backgroundColor = UIColor.clear - - var constraints = NSLayoutConstraint.constraints(withVisualFormat: "H:[image]|", options: .alignAllLastBaseline, metrics: nil, views: [ "superview": self, "image": imageView ]) - constraints.append(contentsOf: NSLayoutConstraint.constraints(withVisualFormat: "V:[image]|", options: .alignAllLastBaseline, metrics: nil, views: [ "superview": self, "image": imageView ])) - - addConstraints(constraints) - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - convenience init(frame: CGRect, document: PDFDocument, page: Int) { - self.init(frame: frame) - showImage(document, page: page) - } - - func showImage(_ document: PDFDocument, page: Int) { - imageView.image = nil - PDFQueue.sharedQueue.fetchPage(document, page: page, size: frame.size) { (thumbnail) in - self.imageView.image = thumbnail.image - } - } -} diff --git a/Pod/Classes/Renderer/PDFViewController.swift b/Pod/Classes/Renderer/PDFViewController.swift deleted file mode 100644 index 9a964a2..0000000 --- a/Pod/Classes/Renderer/PDFViewController.swift +++ /dev/null @@ -1,374 +0,0 @@ -// -// PDFViewController.swift -// Pods -// -// Created by Chris Anderson on 5/7/16. -// -// - -import UIKit -import SafariServices - -open class PDFViewController: UIViewController { - - /// A boolean value that determines whether the navigation bar and scrubber bar hide on screen tap - open var hidesBarsOnTap: Bool = true - - /// A boolean value that determines if the scrubber bar should be visible - open var showsScrubber: Bool = true { - didSet { - guard isViewLoaded else { - return - } - pageScrubber.isHidden = !showsScrubber - } - } - - /// A boolean value that determines if a PDF should have fillable form elements - open var allowsFormFilling: Bool = true - - /// A boolean value that determines if annotations are allowed - open var allowsAnnotations: Bool = true - - /// A boolean value that determines if sharing should be allowed - open var allowsSharing: Bool = true - - /// A boolean value that determines if view controller is displayed as modal - open var isPresentingInModal: Bool = false - - /// The scroll direction of the reader - open var scrollDirection: UICollectionViewScrollDirection = .horizontal - - /// A reference to the document that is being displayed - var document: PDFDocument! - - /// A reference to the share button - var shareBarButtonItem: UIBarButtonItem? - - /// A closure that defines an action to take upon selecting the share button. - /// The default action brings up a UIActivityViewController - open lazy var shareBarButtonAction: () -> () = { self.showActivitySheet() } - - /// A reference to the collection view handling page presentation - var collectionView: PDFSinglePageViewer! - - /// A reference to the page scrubber bar - var pageScrubber: PDFPageScrubber! - private(set) open lazy var formController: PDFFormViewController = PDFFormViewController(document: self.document) - private(set) open lazy var annotationController: PDFAnnotationController = PDFAnnotationController(document: self.document, delegate: self) - - fileprivate var showingAnnotations = false - fileprivate var showingFormFilling = true - - - /** - Initializes a new reader with a given document - - - Parameters: - - document: The document to display - - - Returns: An instance of the PDFViewController - */ - public init(document: PDFDocument) { - super.init(nibName: nil, bundle: nil) - self.document = document - } - - /** - Initializes a new reader with a given document and annotation controller - - - Parameters: - - document: The document to display - - annotationController: The controller to supervise annotations - - - Returns: An instance of the PDFViewController - */ - public convenience init(document: PDFDocument, annotationController: PDFAnnotationController) { - self.init(document: document) - self.annotationController = PDFAnnotationController(document: self.document, delegate: self) - } - - required public init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - } - - override open func viewDidLoad() { - super.viewDidLoad() - - pageScrubber = PDFPageScrubber(frame: CGRect(x: 0, y: view.frame.size.height - bottomLayoutGuide.length, width: view.frame.size.width, height: 44.0), document: document) - pageScrubber.scrubberDelegate = self - pageScrubber.translatesAutoresizingMaskIntoConstraints = false - - collectionView = PDFSinglePageViewer(frame: view.bounds, document: document) - collectionView.translatesAutoresizingMaskIntoConstraints = false - collectionView.singlePageDelegate = self - - let flowLayout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout - flowLayout.scrollDirection = scrollDirection - - switch scrollDirection { - case .horizontal: - collectionView.isPagingEnabled = true - pageScrubber.isHidden = !showsScrubber - case .vertical: - collectionView.isPagingEnabled = false - pageScrubber.isHidden = true - } - - self.setupUI() - collectionView.reloadItems(at: [IndexPath(row: 0, section: 0)]) - } - - fileprivate func setupUI() { - view.addSubview(collectionView) - view.addSubview(pageScrubber) - view.addSubview(annotationController.view) - - collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true - collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true - collectionView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true - collectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true - - pageScrubber.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true - pageScrubber.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true - pageScrubber.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true - pageScrubber.heightAnchor.constraint(equalToConstant: 44.0).isActive = true - - pageScrubber.sizeToFit() - - reloadBarButtons() - } - - open override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - - collectionView.collectionViewLayout.invalidateLayout() - } - - open override func viewDidLayoutSubviews() { - super.viewDidLayoutSubviews() - - collectionView.collectionViewLayout.invalidateLayout() - - view.layoutSubviews() - } - - open override func viewWillDisappear(_ animated: Bool) { - super.viewWillDisappear(animated) - - self.annotationController.finishAnnotation() - self.document.annotations = self.annotationController.annotations - self.document.save() - } - - open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { - super.viewWillTransition(to: size, with: coordinator) - - coordinator.animate(alongsideTransition: { (context) in - self.collectionView.contentInset = UIEdgeInsetsMake(self.topLayoutGuide.length, 0, self.bottomLayoutGuide.length, 0) - self.collectionView.collectionViewLayout.invalidateLayout() - self.pageScrubber.sizeToFit() - }, completion: { (context) in - self.collectionView.displayPage(self.document.currentPage, animated: false) - }) - } - - //MARK: - Private helpers - fileprivate func scrollTo(page: Int) { - document.currentPage = page - collectionView.displayPage(page, animated: false) - if showsScrubber { - pageScrubber.updateScrubber() - } - } - - fileprivate func reloadBarButtons() { - navigationItem.rightBarButtonItems = rightBarButtons() - - if isPresentingInModal { - navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Done", - style: .plain, - target: self, - action: #selector(PDFViewController.dismissModal)) - } - } - - open func rightBarButtons() -> [UIBarButtonItem] { - var buttons: [UIBarButtonItem] = [] - - if allowsSharing { - - let shareFormBarButtonItem = PDFBarButton( - image: UIImage.bundledImage("share"), - toggled: false, - target: self, - action: #selector(PDFViewController.shareDocument) - ) - buttons.append(shareFormBarButtonItem) - self.shareBarButtonItem = shareFormBarButtonItem - } - - buttons.append(PDFBarButton( - image: UIImage.bundledImage("thumbs"), - toggled: false, - target: self, - action: #selector(PDFViewController.showThumbnailView) - ) - ) - - - if allowsAnnotations { - if showingAnnotations { - buttons.append(annotationController.undoButton) - for button in annotationController.buttons.reversed() { - buttons.append(button) - } - } - - buttons.append(PDFBarButton( - image: UIImage.bundledImage("annot"), - toggled: showingAnnotations, - target: self, - action: #selector(PDFViewController.toggleAnnotations(_:)) - ) - ) - } - - return buttons - } - - func toggleAnnotations(_ button: PDFBarButton) { - showingAnnotations = !showingAnnotations - reloadBarButtons() - } - - func showActivitySheet() { - let renderer = PDFRenderController(document: document, controllers: [ - annotationController, - formController - ]) - let pdf = renderer.renderOntoPDF() - - let items = [pdf] - let activityVC = UIActivityViewController(activityItems: items, applicationActivities: nil) - - if UIDevice.current.userInterfaceIdiom == .pad { - activityVC.modalPresentationStyle = .popover - let popController = activityVC.popoverPresentationController - popController?.barButtonItem = shareBarButtonItem - popController?.permittedArrowDirections = .up - } - present(activityVC, animated: true, completion: nil) - } - - func showThumbnailView() { - let vc = PDFThumbnailViewController(document: document) - vc.delegate = self - let nvc = UINavigationController(rootViewController: vc) - nvc.modalTransitionStyle = .crossDissolve - present(nvc, animated: true, completion: nil) - } - - func hideBars(state: Bool) { - navigationController?.setNavigationBarHidden(state, animated: true) - - switch scrollDirection { - case .horizontal: - if showsScrubber { - pageScrubber.isHidden = state - } - else { - pageScrubber.isHidden = true - } - case .vertical: - pageScrubber.isHidden = true - } - } - - /// Toggles the display of the navigation bar and scrubber bar - func toggleBars() { - collectionView.collectionViewLayout.invalidateLayout() - hideBars(state: !(navigationController?.isNavigationBarHidden ?? false)) - } - - //MARK: - IBActions - func handleTap(_ gestureRecognizer: UIGestureRecognizer) { - self.toggleBars() - } - - func shareDocument() { - self.shareBarButtonAction() - } - - func dismissModal() { - dismiss(animated: true, completion: nil) - } -} - -extension PDFViewController: PDFAnnotationControllerProtocol { - public func annotationWillStart(touch: UITouch) -> Int? { - let tapPoint = touch.location(in: collectionView) - guard let pageIndex = collectionView.indexPathForItem(at: tapPoint)?.row else { return nil } - return pageIndex + 1 - } -} - - -extension PDFViewController: PDFPageScrubberDelegate { - public func scrubber(_ scrubber: PDFPageScrubber, selectedPage: Int) { - self.scrollTo(page: selectedPage) - } -} - -extension PDFViewController: PDFSinglePageViewerDelegate { - public func singlePageViewer(_ collectionView: PDFSinglePageViewer, didDisplayPage page: Int) { - document.currentPage = page - if showsScrubber { - pageScrubber.updateScrubber() - } - } - - public func singlePageViewer(_ collectionView: PDFSinglePageViewer, loadedContent content: PDFPageContentView) { -// if allowsFormFilling { -// formController.showForm(content) -// } - if allowsAnnotations { - annotationController.showAnnotations(content) - } - } - - public func singlePageViewer(_ collectionView: PDFSinglePageViewer, selected action: PDFAction) { - if let action = action as? PDFActionURL { - let svc = SFSafariViewController(url: action.url as URL) - present(svc, animated: true, completion: nil) - } else if let action = action as? PDFActionGoTo { - collectionView.displayPage(action.pageIndex, animated: true) - } - } - - public func singlePageViewer(_ collectionView: PDFSinglePageViewer, selected annotation: PDFAnnotationView) { - if let annotation = annotation.parent { - annotationController.select(annotation: annotation) - } - } - - public func singlePageViewer(_ collectionView: PDFSinglePageViewer, tapped recognizer: UITapGestureRecognizer) { - if hidesBarsOnTap { - handleTap(recognizer) - } - annotationController.select(annotation: nil) - } - - public func singlePageViewerDidBeginDragging() { - self.hideBars(state: true) - } - - public func singlePageViewerDidEndDragging() { } -} - -extension PDFViewController: PDFThumbnailViewControllerDelegate { - public func thumbnailCollection(_ collection: PDFThumbnailViewController, didSelect page: Int) { - self.scrollTo(page: page) - self.dismiss(animated: true, completion: nil) - } -} diff --git a/Pod/Classes/Renderer/PDFDocumentLink.swift b/Pod/Classes/Renderer/UXMDocumentLink.swift old mode 100644 new mode 100755 similarity index 82% rename from Pod/Classes/Renderer/PDFDocumentLink.swift rename to Pod/Classes/Renderer/UXMDocumentLink.swift index 446151e..bfa20e5 --- a/Pod/Classes/Renderer/PDFDocumentLink.swift +++ b/Pod/Classes/Renderer/UXMDocumentLink.swift @@ -1,5 +1,5 @@ // -// PDFDocumentLink.swift +// UXMDocumentLink.swift // Pods // // Created by Ricardo Nunez on 11/11/16. @@ -8,7 +8,7 @@ import UIKit -internal class PDFDocumentLink { +internal class UXMDocumentLink { let rect: CGRect let dictionary: CGPDFDictionaryRef diff --git a/Pod/Classes/Renderer/PDFDocument.swift b/Pod/Classes/Renderer/UXMPDFDocument.swift old mode 100644 new mode 100755 similarity index 80% rename from Pod/Classes/Renderer/PDFDocument.swift rename to Pod/Classes/Renderer/UXMPDFDocument.swift index 82b9704..84686dd --- a/Pod/Classes/Renderer/PDFDocument.swift +++ b/Pod/Classes/Renderer/UXMPDFDocument.swift @@ -1,5 +1,5 @@ // -// PDFDocument.swift +// UXMPDFDocument.swift // Pods // // Created by Chris Anderson on 3/5/16. @@ -8,7 +8,7 @@ import UIKit -open class PDFDocument: NSObject, NSCoding { +open class UXMPDFDocument: NSObject, NSCoding { open var documentRef: CGPDFDocument? @@ -34,22 +34,22 @@ open class PDFDocument: NSObject, NSCoding { open var creationDate: Date? open var version: Float = 0.0 - /// Document annotations - open var annotations: PDFAnnotationStore = PDFAnnotationStore() + /// Document annotations store + open var annotationsStore: UXMAnnotationStore = UXMAnnotationStore() - public static func from(filePath: String, password: String? = nil) throws -> PDFDocument? { - if let document = try PDFDocument.unarchiveDocument(filePath: filePath, password: password) { + public static func from(filePath: String, password: String? = nil) throws -> UXMPDFDocument? { + if let document = try UXMPDFDocument.unarchiveDocument(filePath: filePath, password: password) { return document } else { - return try PDFDocument(filePath: filePath, password: password) + return try UXMPDFDocument(filePath: filePath, password: password) } } - static func unarchiveDocument(filePath: String, password: String?) throws -> PDFDocument? { - - let archiveFilePath = PDFDocument.archiveFilePathForFile(path: filePath) - if let document = NSKeyedUnarchiver.unarchiveObject(withFile: archiveFilePath) as? PDFDocument { + static func unarchiveDocument(filePath: String, password: String?) throws -> UXMPDFDocument? { + + let archiveFilePath = UXMPDFDocument.archiveFilePathForFile(path: filePath) + if let document = NSKeyedUnarchiver.unarchiveObject(withFile: archiveFilePath) as? UXMPDFDocument { document.fileUrl = URL(fileURLWithPath: filePath, isDirectory: false) document.password = password @@ -64,11 +64,11 @@ open class PDFDocument: NSObject, NSCoding { self.currentPage = aDecoder.decodeInteger(forKey: "currentPage") self.bookmarks = aDecoder.decodeObject(forKey: "bookmarks") as! NSMutableIndexSet self.lastOpen = aDecoder.decodeObject(forKey: "lastOpen") as? Date - if let annotations = aDecoder.decodeObject(forKey: "annotations") as? PDFAnnotationStore { - self.annotations = annotations + if let annotations = aDecoder.decodeObject(forKey: "annotations") as? UXMAnnotationStore { + self.annotationsStore = annotations } else { - self.annotations = PDFAnnotationStore() + self.annotationsStore = UXMAnnotationStore() } super.init() @@ -76,7 +76,7 @@ open class PDFDocument: NSObject, NSCoding { public init(filePath: String, password: String? = nil) throws { - self.guid = PDFDocument.GUID() + self.guid = UXMPDFDocument.GUID() self.password = password self.fileUrl = URL(fileURLWithPath: filePath, isDirectory: false) self.lastOpen = Date() @@ -85,11 +85,11 @@ open class PDFDocument: NSObject, NSCoding { try self.loadDocument() - self.save() + // self.save() } public init(fileData: NSData, password: String? = nil) throws { - self.guid = PDFDocument.GUID() + self.guid = UXMPDFDocument.GUID() self.password = password self.fileData = fileData self.lastOpen = NSDate() as Date @@ -118,11 +118,12 @@ open class PDFDocument: NSObject, NSCoding { } func loadDocumentInformation() { - guard let pdfDocRef = documentRef else { - return - } + guard let pdfDocRef = documentRef else { return } + + self.pageCount = pdfDocRef.numberOfPages + + guard let infoDic = pdfDocRef.info else { return } - let infoDic: CGPDFDictionaryRef = pdfDocRef.info! var string: CGPDFStringRef? = nil if CGPDFDictionaryGetString(infoDic, "Title", &string) { @@ -180,13 +181,6 @@ open class PDFDocument: NSObject, NSCoding { self.modificationDate = ref as Date } } - - // let majorVersion = UnsafeMutablePointer() - // let minorVersion = UnsafeMutablePointer() - // CGPDFDocumentGetVersion(pdfDocRef, majorVersion, minorVersion) - // self.version = Float("\(majorVersion).\(minorVersion)")! - - self.pageCount = pdfDocRef.numberOfPages } func page(at page: Int) -> CGPDFPage? { @@ -205,38 +199,47 @@ open class PDFDocument: NSObject, NSCoding { return ProcessInfo.processInfo.globallyUniqueString } - open static func documentsPath() -> String { + public static func documentsPath() -> String { return NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] } - open static func applicationPath() -> String { + public static func applicationPath() -> String { let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) return (paths.first! as NSString).deletingLastPathComponent } - open static func applicationSupportPath() -> String { + public static func applicationSupportPath() -> String { let fileManager = FileManager() let pathURL = try! fileManager.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true) return pathURL.path } static func archiveFilePathForFile(path: String) -> String { - let archivePath = PDFDocument.applicationSupportPath() + let archivePath = UXMPDFDocument.applicationSupportPath() let archiveName = (path as NSString).lastPathComponent + ".plist" return (archivePath as NSString).appendingPathComponent(archiveName) } func archiveWithFileAtPath(_ filePath: String) -> Bool { - let archiveFilePath = PDFDocument.archiveFilePathForFile(path: filePath) + let archiveFilePath = UXMPDFDocument.archiveFilePathForFile(path: filePath) return NSKeyedArchiver.archiveRootObject(self, toFile: archiveFilePath) } open func save() { + guard let filePath = fileUrl?.path else { return } + + // TODO: Better solution to support NSData + let _ = self.archiveWithFileAtPath(filePath) + } + + open func clearEncodedAnnotations() { + guard let filePath = fileUrl?.path else { return } + + let archiveFilePath = UXMPDFDocument.archiveFilePathForFile(path: filePath) - //TODO: Better solution to support NSData - if let filePath = fileUrl?.path { - let _ = self.archiveWithFileAtPath(filePath) + if FileManager.default.fileExists(atPath: archiveFilePath) { + try? FileManager.default.removeItem(atPath: archiveFilePath) } } @@ -274,6 +277,6 @@ open class PDFDocument: NSObject, NSCoding { aCoder.encode(self.currentPage, forKey: "currentPage") aCoder.encode(self.bookmarks, forKey: "bookmarks") aCoder.encode(self.lastOpen, forKey: "lastOpen") - aCoder.encode(self.annotations, forKey: "annotations") + aCoder.encode(self.annotationsStore, forKey: "annotations") } } diff --git a/Pod/Classes/Renderer/UXMPDFViewController.swift b/Pod/Classes/Renderer/UXMPDFViewController.swift new file mode 100644 index 0000000..7bdbbfc --- /dev/null +++ b/Pod/Classes/Renderer/UXMPDFViewController.swift @@ -0,0 +1,483 @@ +// +// UXMPDFViewController.swift +// Pods +// +// Created by Chris Anderson on 5/7/16. +// +// + +import UIKit +import SafariServices + +public protocol UXMPDFViewControllerDelegate : class { + func editingDidEnd(_ document: UXMPDFDocument) +} + +open class UXMPDFViewController: UIViewController { + /// Delegate reference for editing events + open weak var delegate: UXMPDFViewControllerDelegate? = nil + + /// A boolean value that determines whether show and use only pen tool + open var signatureMode: Bool = false + + /// A boolean value that determines whether the navigation bar and scrubber bar hide on screen tap + open var hidesBarsOnTap: Bool = false + + /// A boolean value that determines if the scrubber bar should be visible + open var showsScrubber: Bool = true { + didSet { + pageScrubber?.isHidden = !showsScrubber + collectionView?.contentInset.bottom = showsScrubber && pageScrubber != nil ? pageScrubber!.frame.size.height : 0.0 + } + } + + /// A boolean value that determines if a PDF should have fillable form elements + open var allowsFormFilling: Bool = true + + /// A boolean value that determines if annotations are allowed + open var allowsAnnotations: Bool = true + + /// A boolean value that determines if sharing should be allowed + open var allowsSharing: Bool = true + + /// A boolean value that determines if view controller is displayed as modal + open var isPresentingInModal: Bool = false + + open var modalDoneButtonTouched: (() -> ())? + + /// The scroll direction of the reader + open var scrollDirection: UICollectionView.ScrollDirection = .horizontal + + /// A reference to the document that is being displayed + open var document: UXMPDFDocument? { + didSet { + self.setupUI() + } + } + + /// A reference to the share button + var shareBarButtonItem: UIBarButtonItem? + + /// A closure that defines an action to take upon selecting the share button. + /// The default action brings up a UIActivityViewController + open lazy var shareBarButtonAction: () -> () = { self.showActivitySheet() } + + /// A closure that defines what happens on viewWillDisappear. + /// The default is to assign the annotations out of the annotationController into + /// the document, then call document.save() + open lazy var autoSaveAction: ((UXMPDFDocument, UXMAnnotationController) -> ())? = { document, annotationController in + document.annotationsStore = annotationController.annotationsStore + document.save() + + if self.edited { + self.delegate?.editingDidEnd(document) + } + } + + /// A reference to the collection view handling page presentation + var collectionView: UXMSinglePageViewer? + + /// A reference to the page scrubber bar + open var pageScrubber: UXMPageScrubber? + + open var hasAnnotations: Bool { + guard document != nil else { return false } + return annotationController.annotationsStore.hasAnnotations + } + + private(set) open lazy var formController: UXMFormViewController = UXMFormViewController(document: self.document!) + private(set) open lazy var annotationController: UXMAnnotationController = UXMAnnotationController(document: self.document!, delegate: self) + + fileprivate var showingAnnotations = false + fileprivate var showingFormFilling = true + + fileprivate var edited = false + + /** + Initializes a new reader with a given document + + - Parameters: + - document: The document to display + + - Returns: An instance of the UXMPDFViewController + */ + public init(document: UXMPDFDocument) { + super.init(nibName: nil, bundle: nil) + self.document = document + self.modalDoneButtonTouched = { [unowned self] in + self.dismiss(animated: true, completion: nil) + } + } + + /** + Initializes a new reader with a given document and annotation controller + + - Parameters: + - document: The document to display + - annotationController: The controller to supervise annotations + + - Returns: An instance of the UXMPDFViewController + */ + public convenience init(document: UXMPDFDocument, annotationController: UXMAnnotationController) { + self.init(document: document) + self.annotationController = annotationController + } + + required public init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + } + + override open func viewDidLoad() { + super.viewDidLoad() + + self.setupUI() + } + + fileprivate func setupUI() { + + guard self.isViewLoaded, let document = self.document, document.pageCount > 0 else { return } + + pageScrubber = UXMPageScrubber(frame: CGRect(x: 0, y: view.frame.size.height - bottomLayoutGuide.length, width: view.frame.size.width, height: 44), document: document) + pageScrubber!.scrubberDelegate = self + pageScrubber!.translatesAutoresizingMaskIntoConstraints = false + + collectionView = UXMSinglePageViewer(frame: view.bounds, document: document) + collectionView!.translatesAutoresizingMaskIntoConstraints = false + collectionView!.singlePageDelegate = self + + let flowLayout = collectionView!.collectionViewLayout as! UICollectionViewFlowLayout + flowLayout.scrollDirection = scrollDirection + + switch scrollDirection { + case .horizontal: + collectionView!.isPagingEnabled = true + pageScrubber!.isHidden = !showsScrubber + collectionView!.contentInset.bottom = showsScrubber ? pageScrubber!.frame.size.height : 0.0 + case .vertical: + collectionView!.isPagingEnabled = false + pageScrubber!.isHidden = true + } + + view.addSubview(collectionView!) + view.addSubview(pageScrubber!) + view.addSubview(annotationController.view) + + collectionView!.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true + collectionView!.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true + collectionView!.topAnchor.constraint(equalTo: view.topAnchor).isActive = true + collectionView!.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true + + if #available(iOS 11.0, *) { + pageScrubber!.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor).isActive = true + }else { + pageScrubber!.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true + } + + pageScrubber!.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true + pageScrubber!.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true + pageScrubber!.heightAnchor.constraint(equalToConstant: 44).isActive = true + pageScrubber!.sizeToFit() + + reloadBarButtons() + + collectionView!.reloadItems(at: [IndexPath(row: 0, section: 0)]) + } + + open override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + NotificationCenter.default.addObserver(self, selector: #selector(orientationDidChange(_:)), name: UIDevice.orientationDidChangeNotification, object: nil) + + collectionView?.collectionViewLayout.invalidateLayout() + } + + open override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + + collectionView?.collectionViewLayout.invalidateLayout() + + view.layoutSubviews() + } + + open override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + + NotificationCenter.default.removeObserver(self) + + guard document != nil else { return } + + self.annotationController.finishAnnotation() + autoSaveAction?(self.document!, self.annotationController) + } + + open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { + super.viewWillTransition(to: size, with: coordinator) + + guard document != nil else { return } + + coordinator.animate(alongsideTransition: { [weak self] (context) in + guard let zelf = self else { return } + zelf.collectionView?.contentInset = UIEdgeInsets(top: zelf.topLayoutGuide.length, left: 0, bottom: zelf.bottomLayoutGuide.length, right: 0) + zelf.collectionView?.collectionViewLayout.invalidateLayout() + zelf.pageScrubber?.sizeToFit() + }, completion: { [weak self] (context) in + guard let zelf = self else { return } + zelf.collectionView?.displayPage(zelf.document!.currentPage, animated: false) + }) + } + + //MARK: - Private helpers + fileprivate func scrollTo(page: Int) { + document?.currentPage = page + collectionView?.displayPage(page, animated: false) + if showsScrubber { + pageScrubber?.updateScrubber() + } + } + + fileprivate func reloadBarButtons() { + + guard document != nil else { return } + + navigationItem.rightBarButtonItems = rightBarButtons() + + if isPresentingInModal { + navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(UXMPDFViewController.dismissModal)) + } + } + + open func rightBarButtons() -> [UIBarButtonItem] { + if (signatureMode) { + var buttons = self.navigationItem.rightBarButtonItems ?? [] + + // undo button + buttons.append(annotationController.undoButton) + + // find the draw button (hopefully you added that thing huh?) + if let penButton = annotationController.buttons.filter({ (button: UXMBarButton) -> Bool in + if let annotationButton = button as? PDFAnnotationBarButton { + return annotationButton.annotationType == PDFPenAnnotation.self + } + return false + }).first { + buttons.append(penButton); + } + else { + assert(false, "Used 'signatureMode' of true, but did NOT provide the PDFPenAnnotationBarButton as an annotation! No Sign button for you!") + } + + return buttons + } + + var buttons: [UIBarButtonItem] = [] + + if allowsSharing { + + let shareFormBarButtonItem = UXMBarButton( + image: UIImage.bundledImage("share"), + toggled: false, + target: self, + action: #selector(UXMPDFViewController.shareDocument) + ) + buttons.append(shareFormBarButtonItem) + self.shareBarButtonItem = shareFormBarButtonItem + } + + buttons.append(UXMBarButton( + image: UIImage.bundledImage("thumbs"), + toggled: false, + target: self, + action: #selector(UXMPDFViewController.showThumbnailView) + ) + ) + + + if allowsAnnotations { + if showingAnnotations { + buttons.append(annotationController.undoButton) + for button in annotationController.buttons.reversed() { + buttons.append(button) + } + } + + buttons.append(UXMBarButton( + image: UIImage.bundledImage("annot"), + toggled: showingAnnotations, + target: self, + action: #selector(UXMPDFViewController.toggleAnnotations(_:)) + ) + ) + } + + return buttons + } + + @objc func toggleAnnotations(_ button: UXMBarButton) { + showingAnnotations = !showingAnnotations + reloadBarButtons() + } + + open func saveToPDFFile(overwriteOriginal: Bool = false) -> URL? { + + guard document != nil else { return nil } + + self.annotationController.finishAnnotation() + let renderer = UXMRenderController(document: document!, controllers: [ + annotationController, + formController + ]) + + if overwriteOriginal { + if renderer.save() { + document!.clearEncodedAnnotations() + return document!.fileUrl + } + return nil + } + + let pdf = renderer.renderOntoPDF() + return pdf + } + + func showActivitySheet() { + + guard document != nil else { return } + + self.annotationController.finishAnnotation() + let renderer = UXMRenderController(document: document!, controllers: [ + annotationController, + formController + ]) + let pdf = renderer.renderOntoPDF() + + let items = [pdf] + let activityVC = UIActivityViewController(activityItems: items, applicationActivities: nil) + + if UIDevice.current.userInterfaceIdiom == .pad { + activityVC.modalPresentationStyle = .popover + let popController = activityVC.popoverPresentationController + popController?.barButtonItem = shareBarButtonItem + popController?.permittedArrowDirections = .up + } + present(activityVC, animated: true, completion: nil) + } + + @objc func showThumbnailView() { + + guard document != nil else { return } + + let vc = UXMThumbnailViewController(document: document!) + vc.delegate = self + let nvc = UINavigationController(rootViewController: vc) + nvc.modalTransitionStyle = .crossDissolve + present(nvc, animated: true, completion: nil) + } + + func hideBars(state: Bool) { + navigationController?.setNavigationBarHidden(state, animated: true) + + switch scrollDirection { + case .horizontal: + if showsScrubber { + pageScrubber?.isHidden = state + } + else { + pageScrubber?.isHidden = true + } + case .vertical: + pageScrubber?.isHidden = true + } + } + + //MARK: - IBActions + + @objc func shareDocument() { + self.shareBarButtonAction() + } + + @objc func dismissModal() { + modalDoneButtonTouched?() + } + + @objc private func orientationDidChange(_ notification: Notification? = nil) { + self.pageScrubber?.refreshScrubber() + } +} + +extension UXMPDFViewController: UXMAnnotationControllerProtocol { + public func annotationWillStart(touch: UITouch) -> Int? { + self.edited = true + + let tapPoint = touch.location(in: collectionView) + guard let pageIndex = collectionView?.indexPathForItem(at: tapPoint)?.row else { return nil } + let index = pageIndex + 1 + return index + } +} + +extension UXMPDFViewController: UXMPageScrubberDelegate { + public func scrubber(_ scrubber: UXMPageScrubber, selectedPage: Int) { + self.scrollTo(page: selectedPage) + } +} + +extension UXMPDFViewController: UXMSinglePageViewerDelegate { + public func singlePageViewer(_ collectionView: UXMSinglePageViewer, didDisplayPage page: Int) { + + document?.currentPage = page + if showsScrubber { + pageScrubber?.updateScrubber() + } + } + + public func singlePageViewer(_ collectionView: UXMSinglePageViewer, loadedContent content: UXMPageContentView) { + + guard document != nil else { return } + + if allowsFormFilling { + formController.showForm(content) + } + if allowsAnnotations { + annotationController.showAnnotations(content) + } + } + + public func singlePageViewer(_ collectionView: UXMSinglePageViewer, selected action: UXMAction) { + if let action = action as? UXMActionURL, let scheme = action.url.scheme?.lowercased(), (scheme == "http" || scheme == "https") { + let svc = SFSafariViewController(url: action.url) + present(svc, animated: true, completion: nil) + } else if let action = action as? UXMActionGoTo { + collectionView.displayPage(action.pageIndex, animated: true) + } + } + + public func singlePageViewer(_ collectionView: UXMSinglePageViewer, selected annotation: UXMPDFAnnotationView) { + + guard document != nil else { return } + + if let annotation = annotation.parent { + annotationController.select(annotation: annotation) + } + } + + public func singlePageViewer(_ collectionView: UXMSinglePageViewer, tapped recognizer: UITapGestureRecognizer) { + + guard document != nil else { return } + + annotationController.select(annotation: nil) + } + + public func singlePageViewerDidBeginDragging() { + // Do not hide navbar + self.hideBars(state: false) + } + + public func singlePageViewerDidEndDragging() { } +} + +extension UXMPDFViewController: UXMThumbnailViewControllerDelegate { + public func thumbnailCollection(_ collection: UXMThumbnailViewController, didSelect page: Int) { + self.scrollTo(page: page) + self.dismiss(animated: true, completion: nil) + } +} diff --git a/Pod/Classes/Renderer/PDFPageContent.swift b/Pod/Classes/Renderer/UXMPageContent.swift old mode 100644 new mode 100755 similarity index 89% rename from Pod/Classes/Renderer/PDFPageContent.swift rename to Pod/Classes/Renderer/UXMPageContent.swift index 9272dd7..b16a822 --- a/Pod/Classes/Renderer/PDFPageContent.swift +++ b/Pod/Classes/Renderer/UXMPageContent.swift @@ -1,5 +1,5 @@ // -// PDFPageContent.swift +// UXMPageContent.swift // Pods // // Created by Chris Anderson on 3/5/16. @@ -8,27 +8,28 @@ import UIKit -public class PDFPageContent: UIView { +public class UXMPageContent: UIView { private let pdfDocRef: CGPDFDocument private let pdfPageRef: CGPDFPage? private let pageAngle: Int /// 0, 90, 180, 270 - private var links: [PDFDocumentLink] = [] + private var links: [UXMDocumentLink] = [] private var pageWidth: CGFloat = 0.0 private var pageHeight: CGFloat = 0.0 private var pageOffsetX: CGFloat = 0.0 private var pageOffsetY: CGFloat = 0.0 private var page: Int = 0 + private var cachedViewBounds: CGRect = CGRect.zero var cropBoxRect: CGRect var viewRect: CGRect = CGRect.zero override public class var layerClass : AnyClass { - return PDFPageTileLayer.self + return UXMPageTileLayer.self } //MARK: - Init - init(pdfDocument: PDFDocument, page: Int, password: String?) { + init(pdfDocument: UXMPDFDocument, page: Int, password: String?) { pdfDocRef = pdfDocument.documentRef! /// Limit the page let pages = pdfDocRef.numberOfPages @@ -85,16 +86,21 @@ public class PDFPageContent: UIView { autoresizesSubviews = false isUserInteractionEnabled = true contentMode = .redraw - autoresizingMask = UIViewAutoresizing() + autoresizingMask = UIView.AutoresizingMask() backgroundColor = UIColor.clear buildAnnotationLinksList() } - convenience init(document: PDFDocument, page: Int) { + convenience init(document: UXMPDFDocument, page: Int) { self.init(pdfDocument: document, page: page, password: document.password) } + public override func layoutSubviews() { + super.layoutSubviews() + self.cachedViewBounds = self.bounds + } + required public init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } @@ -115,14 +121,14 @@ public class PDFPageContent: UIView { highlight.autoresizesSubviews = false highlight.isUserInteractionEnabled = false highlight.contentMode = .redraw - highlight.autoresizingMask = UIViewAutoresizing() + highlight.autoresizingMask = UIView.AutoresizingMask() highlight.backgroundColor = color addSubview(highlight) } } - private func linkFromAnnotation(_ annotation: CGPDFDictionaryRef) -> PDFDocumentLink? { + private func linkFromAnnotation(_ annotation: CGPDFDictionaryRef) -> UXMDocumentLink? { var annotationRectArray: CGPDFArrayRef? = nil guard CGPDFDictionaryGetArray(annotation, "Rect", &annotationRectArray) else { return nil } @@ -189,7 +195,7 @@ public class PDFPageContent: UIView { let rect = CGRect(x: x, y: y, width: w, height: h) - return PDFDocumentLink(rect: rect, dictionary:annotation) + return UXMDocumentLink(rect: rect, dictionary:annotation) } private func buildAnnotationLinksList() { @@ -219,7 +225,7 @@ public class PDFPageContent: UIView { let point = recognizer.location(in: self) for link in links where link.rect.contains(point) { - return PDFAction.fromPDFDictionary(link.dictionary, documentReference: pdfDocRef) + return UXMAction.fromPDFDictionary(link.dictionary, documentReference: pdfDocRef) } for annotation in subviews where annotation.frame.contains(point) { @@ -232,13 +238,14 @@ public class PDFPageContent: UIView { //MARK: - CATiledLayer Delegate Methods override open func draw(_ layer: CALayer, in ctx: CGContext) { guard let pdfPageRef = pdfPageRef else { return } + ctx.setFillColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) ctx.fill(ctx.boundingBoxOfClipPath) /// Translate for page - ctx.translateBy(x: 0.0, y: bounds.size.height) + ctx.translateBy(x: 0.0, y: self.cachedViewBounds.size.height) ctx.scaleBy(x: 1.0, y: -1.0) - ctx.concatenate((pdfPageRef.getDrawingTransform(.cropBox, rect: bounds, rotate: 0, preserveAspectRatio: true))) + ctx.concatenate((pdfPageRef.getDrawingTransform(.cropBox, rect: self.cachedViewBounds, rotate: 0, preserveAspectRatio: true))) /// Render the PDF page into the context ctx.drawPDFPage(pdfPageRef) diff --git a/Pod/Classes/Renderer/PDFPageContentView.swift b/Pod/Classes/Renderer/UXMPageContentView.swift similarity index 77% rename from Pod/Classes/Renderer/PDFPageContentView.swift rename to Pod/Classes/Renderer/UXMPageContentView.swift index 1ea7967..8d8563a 100644 --- a/Pod/Classes/Renderer/PDFPageContentView.swift +++ b/Pod/Classes/Renderer/UXMPageContentView.swift @@ -1,5 +1,5 @@ // -// PDFPageContentView.swift +// UXMPageContentView.swift // Pods // // Created by Chris Anderson on 3/5/16. @@ -8,28 +8,28 @@ import UIKit -public protocol PDFPageContentViewDelegate { - func contentView(_ contentView: PDFPageContentView, didSelect action: PDFAction) - func contentView(_ contentView: PDFPageContentView, didSelect annotation: PDFAnnotationView) - func contentView(_ contentView: PDFPageContentView, tapped recognizer: UITapGestureRecognizer) - func contentView(_ contentView: PDFPageContentView, doubleTapped recognizer: UITapGestureRecognizer) +public protocol UXMPageContentViewDelegate : class { + func contentView(_ contentView: UXMPageContentView, didSelect action: UXMAction) + func contentView(_ contentView: UXMPageContentView, didSelect annotation: UXMPDFAnnotationView) + func contentView(_ contentView: UXMPageContentView, tapped recognizer: UITapGestureRecognizer) + func contentView(_ contentView: UXMPageContentView, doubleTapped recognizer: UITapGestureRecognizer) } -open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { - public let contentView: PDFPageContent +open class UXMPageContentView: UIScrollView, UIScrollViewDelegate { + public let contentView: UXMPageContent let containerView: UIView open var page: Int - open var contentDelegate: PDFPageContentViewDelegate? + open weak var contentDelegate: UXMPageContentViewDelegate? open var viewDidZoom: ((CGFloat) -> Void)? fileprivate var PDFPageContentViewContext = 0 fileprivate var previousScale: CGFloat = 1.0 let bottomKeyboardPadding: CGFloat = 20.0 - init(frame: CGRect, document: PDFDocument, page: Int) { + init(frame: CGRect, document: UXMPDFDocument, page: Int) { self.page = page - contentView = PDFPageContent(document: document, page: page) + contentView = UXMPageContent(document: document, page: page) containerView = UIView(frame: contentView.bounds) containerView.isUserInteractionEnabled = true @@ -52,7 +52,7 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { bouncesZoom = true delegate = self isScrollEnabled = true - clipsToBounds = true + clipsToBounds = false autoresizingMask = [.flexibleHeight, .flexibleWidth] @@ -71,19 +71,19 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { NotificationCenter.default.addObserver( self, - selector: #selector(PDFPageContentView.keyboardWillShowNotification(_:)), - name: .UIKeyboardWillShow, + selector: #selector(UXMPageContentView.keyboardWillShowNotification(_:)), + name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver( self, - selector: #selector(PDFPageContentView.keyboardWillHideNotification(_:)), - name: .UIKeyboardWillHide, + selector: #selector(UXMPageContentView.keyboardWillHideNotification(_:)), + name: UIResponder.keyboardWillHideNotification, object: nil ) let singleTapRecognizer = UITapGestureRecognizer( target: self, - action: #selector(PDFPageContentView.processSingleTap(_:)) + action: #selector(UXMPageContentView.processSingleTap(_:)) ) singleTapRecognizer.numberOfTouchesRequired = 1 singleTapRecognizer.numberOfTapsRequired = 1 @@ -92,7 +92,7 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { let doubleTapRecognizer = UITapGestureRecognizer( target: self, - action: #selector(PDFPageContentView.processDoubleTap(_:)) + action: #selector(UXMPageContentView.processDoubleTap(_:)) ) doubleTapRecognizer.numberOfTouchesRequired = 1 doubleTapRecognizer.numberOfTapsRequired = 2 @@ -106,8 +106,8 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { } deinit { - NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillShow, object: nil) - NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillHide, object: nil) + NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil) + NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil) self.removeObserver(self, forKeyPath: "frame") } @@ -139,7 +139,7 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { guard context == &PDFPageContentViewContext, let keyPath = keyPath, keyPath == "frame", - self == (object as? PDFPageContentView) else { + self == (object as? UXMPageContentView) else { return } @@ -147,11 +147,11 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { self.zoomReset() } - open func processSingleTap(_ recognizer: UITapGestureRecognizer) { - if let action = contentView.processSingleTap(recognizer) as? PDFAction { + @objc open func processSingleTap(_ recognizer: UITapGestureRecognizer) { + if let action = contentView.processSingleTap(recognizer) as? UXMAction { contentDelegate?.contentView(self, didSelect: action) } - else if let annotation = contentView.processSingleTap(recognizer) as? PDFAnnotationView { + else if let annotation = contentView.processSingleTap(recognizer) as? UXMPDFAnnotationView { contentDelegate?.contentView(self, didSelect: annotation) } else { @@ -159,7 +159,7 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { } } - open func processDoubleTap(_ recognizer: UITapGestureRecognizer) { + @objc open func processDoubleTap(_ recognizer: UITapGestureRecognizer) { contentDelegate?.contentView(self, doubleTapped: recognizer) } @@ -200,7 +200,7 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { } open func zoomReset() { - zoomScale = minimumZoomScale + zoomScale = minimumZoomScale == CGFloat.infinity || minimumZoomScale == CGFloat.nan ? 0 : minimumZoomScale let offsetX = max((self.bounds.size.width - self.contentSize.width) * 0.5, 0.0) let offsetY = max((self.bounds.size.height - self.contentSize.height) * 0.5, 0.0) @@ -218,18 +218,18 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { viewDidZoom?(scrollView.zoomScale) } - func keyboardWillShowNotification(_ notification: Notification) { + @objc func keyboardWillShowNotification(_ notification: Notification) { updateBottomLayoutConstraintWithNotification(notification, show: true) } - func keyboardWillHideNotification(_ notification: Notification) { + @objc func keyboardWillHideNotification(_ notification: Notification) { updateBottomLayoutConstraintWithNotification(notification, show: false) } func updateBottomLayoutConstraintWithNotification(_ notification: Notification, show:Bool) { let userInfo = (notification as NSNotification).userInfo! - let keyboardEndFrame = (userInfo[UIKeyboardFrameEndUserInfoKey] as! NSValue).cgRectValue + let keyboardEndFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue let convertedKeyboardEndFrame = self.convert(keyboardEndFrame, from: self.window) let height: CGFloat @@ -239,7 +239,7 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { height = 0 } - contentInset = UIEdgeInsetsMake(0, 0, height, 0) + contentInset = UIEdgeInsets.init(top: 0, left: 0, bottom: height, right: 0) } @@ -253,7 +253,7 @@ open class PDFPageContentView: UIScrollView, UIScrollViewDelegate { func updateMinimumMaximumZoom() { previousScale = self.zoomScale let targetRect = bounds.insetBy(dx: 0, dy: 0) - let zoomScale = PDFPageContentView.zoomScaleThatFits(targetRect.size, source: contentView.bounds.size) + let zoomScale = UXMPageContentView.zoomScaleThatFits(targetRect.size, source: contentView.bounds.size) minimumZoomScale = zoomScale maximumZoomScale = zoomScale * 16.0 diff --git a/Pod/Classes/Renderer/PDFPageScrubber.swift b/Pod/Classes/Renderer/UXMPageScrubber.swift similarity index 76% rename from Pod/Classes/Renderer/PDFPageScrubber.swift rename to Pod/Classes/Renderer/UXMPageScrubber.swift index 46fe01c..3079e3a 100644 --- a/Pod/Classes/Renderer/PDFPageScrubber.swift +++ b/Pod/Classes/Renderer/UXMPageScrubber.swift @@ -1,5 +1,5 @@ // -// PDFPageScrubber.swift +// UXMPageScrubber.swift // Pods // // Created by Chris Anderson on 5/6/16. @@ -8,30 +8,30 @@ import UIKit -public protocol PDFPageScrubberDelegate { - func scrubber(_ scrubber: PDFPageScrubber, selectedPage: Int) +public protocol UXMPageScrubberDelegate : class { + func scrubber(_ scrubber: UXMPageScrubber, selectedPage: Int) } -open class PDFPageScrubber: UIToolbar { - let document: PDFDocument - var scrubber = PDFPageScrubberTrackControl() +open class UXMPageScrubber: UIToolbar { + let document: UXMPDFDocument + var scrubber = UXMPageScrubberTrackControl() - open var scrubberDelegate: PDFPageScrubberDelegate? + open weak var scrubberDelegate: UXMPageScrubberDelegate? let thumbBackgroundColor = UIColor.white.withAlphaComponent(0.7) let thumbSmallGap: CGFloat = 2.0 let thumbSmallWidth: CGFloat = 22.0 let thumbSmallHeight: CGFloat = 28.0 let thumbLargeWidth: CGFloat = 32.0 - let thumbLargeHeight: CGFloat = 42.0 + let thumbLargeHeight: CGFloat = 36.0 let pageNumberWidth: CGFloat = 96.0 let pageNumberHeight: CGFloat = 30.0 let pageNumberSpace: CGFloat = 20.0 - var thumbViews: [Int: PDFThumbnailView] = [:] + var thumbViews: [Int: UXMThumbnailView] = [:] - var pageThumbView: PDFPageScrubberThumb? + var pageThumbView: UXMPageScrubberThumb? var enableTimer: Timer? var trackTimer: Timer? @@ -39,7 +39,7 @@ open class PDFPageScrubber: UIToolbar { lazy var containerView: UIView = { let containerWidth = UIScreen.main.bounds.size.width let containerView = UIView(frame: CGRect(x: 0, y: 0, width: containerWidth - self.pageNumberSpace * 2, height: 44.0)) - containerView.autoresizesSubviews = false + containerView.autoresizesSubviews = true containerView.isUserInteractionEnabled = false containerView.contentMode = .redraw containerView.autoresizingMask = [.flexibleWidth, .flexibleTopMargin] @@ -70,7 +70,6 @@ open class PDFPageScrubber: UIToolbar { let pageNumberLabel = UILabel(frame: textRect) pageNumberLabel.autoresizesSubviews = false - pageNumberLabel.autoresizingMask = UIViewAutoresizing() pageNumberLabel.textAlignment = .center pageNumberLabel.backgroundColor = UIColor.clear pageNumberLabel.textColor = UIColor.darkText @@ -81,7 +80,7 @@ open class PDFPageScrubber: UIToolbar { return pageNumberLabel }() - public init(frame: CGRect, document: PDFDocument) { + public init(frame: CGRect, document: UXMPDFDocument) { self.document = document super.init(frame: frame) @@ -94,15 +93,14 @@ open class PDFPageScrubber: UIToolbar { let pageNumberToolbar = UIToolbar(frame: pageNumberView.bounds.insetBy(dx: -2, dy: -2)) pageNumberView.addSubview(pageNumberToolbar) pageNumberView.addSubview(pageNumberLabel) - containerView.addSubview(pageNumberView) - scrubber = PDFPageScrubberTrackControl(frame: containerView.bounds) + scrubber = UXMPageScrubberTrackControl(frame: containerView.bounds) - scrubber.addTarget(self, action: #selector(PDFPageScrubber.scrubberTouchDown(_:)), for: .touchDown) - scrubber.addTarget(self, action: #selector(PDFPageScrubber.scrubberValueChanged(_:)), for: .valueChanged) - scrubber.addTarget(self, action: #selector(PDFPageScrubber.scrubberTouchUp(_:)), for: .touchUpInside) - scrubber.addTarget(self, action: #selector(PDFPageScrubber.scrubberTouchUp(_:)), for: .touchUpOutside) + scrubber.addTarget(self, action: #selector(UXMPageScrubber.scrubberTouchDown(_:)), for: .touchDown) + scrubber.addTarget(self, action: #selector(UXMPageScrubber.scrubberValueChanged(_:)), for: .valueChanged) + scrubber.addTarget(self, action: #selector(UXMPageScrubber.scrubberTouchUp(_:)), for: .touchUpInside) + scrubber.addTarget(self, action: #selector(UXMPageScrubber.scrubberTouchUp(_:)), for: .touchUpOutside) containerView.addSubview(scrubber) @@ -115,8 +113,6 @@ open class PDFPageScrubber: UIToolbar { open override func layoutSubviews() { - let containerWidth = UIScreen.main.bounds.size.width - containerView.frame = CGRect(x: 0, y: 0, width: containerWidth - pageNumberSpace * 2, height: 44.0) super.layoutSubviews() @@ -133,8 +129,8 @@ open class PDFPageScrubber: UIToolbar { controlRect.size.width = controlWidth let widthDelta = containerView.bounds.size.width - controlWidth - let x = Int(widthDelta / 2.0) - controlRect.origin.x = CGFloat(x) + let x = CGFloat(widthDelta / 2.0) + controlRect.origin.x = x scrubber.frame = controlRect if pageThumbView == nil { @@ -144,7 +140,7 @@ open class PDFPageScrubber: UIToolbar { let thumbRect = CGRect(x: thumbX, y: thumbY, width: thumbLargeWidth, height: thumbLargeHeight) - pageThumbView = PDFPageScrubberThumb(frame: thumbRect, small: false, color: thumbBackgroundColor) + pageThumbView = UXMPageScrubberThumb(frame: thumbRect, small: false, color: thumbBackgroundColor) pageThumbView?.layer.zPosition = 1.0 scrubber.addSubview(pageThumbView!) @@ -180,7 +176,7 @@ open class PDFPageScrubber: UIToolbar { smallThumbView.frame = thumbRect } } else { - let smallThumbView = PDFPageScrubberThumb(frame: thumbRect, + let smallThumbView = UXMPageScrubberThumb(frame: thumbRect, small: true, color: thumbBackgroundColor) smallThumbView.showImage(document, page: page) @@ -215,9 +211,36 @@ open class PDFPageScrubber: UIToolbar { pageNumberLabel.text = "\(page) of \(pages)" pageNumberLabel.tag = page + + scheduleIfNeededHidePageNumberText() } } + // Interval <= 0.0: page numer not automatically hidden + open var autoHidePageNumberTimeInterval = 0.0 { + didSet { + scheduleIfNeededHidePageNumberText() + } + } + + var autoHidePageNumberTimer: Timer? + + func scheduleIfNeededHidePageNumberText() { + autoHidePageNumberTimer?.invalidate() + if autoHidePageNumberTimeInterval > 0.0 { + UIView.animate(withDuration: 0.25, animations: { + self.pageNumberView.alpha = 1.0 + }) + autoHidePageNumberTimer = Timer.scheduledTimer(timeInterval: autoHidePageNumberTimeInterval, target: self, selector: #selector(hidePageNumberText), userInfo: nil, repeats: false) + } + } + + @objc func hidePageNumberText() { + UIView.animate(withDuration: 0.25, animations: { + self.pageNumberView.alpha = 0.0 + }) + } + func updatePageThumbView(_ page: Int) { let pages = document.pageCount @@ -245,7 +268,7 @@ open class PDFPageScrubber: UIToolbar { } } - func trackTimerFired(_ timer: Timer) { + @objc func trackTimerFired(_ timer: Timer) { trackTimer?.invalidate() trackTimer = nil if scrubber.tag != document.currentPage { @@ -253,7 +276,7 @@ open class PDFPageScrubber: UIToolbar { } } - func enableTimerFired(_ timer: Timer) { + @objc func enableTimerFired(_ timer: Timer) { enableTimer?.invalidate() enableTimer = nil scrubber.isUserInteractionEnabled = true @@ -266,7 +289,7 @@ open class PDFPageScrubber: UIToolbar { } trackTimer = Timer.scheduledTimer(timeInterval: 0.25, target: self, - selector: #selector(PDFPageScrubber.trackTimerFired(_:)), + selector: #selector(UXMPageScrubber.trackTimerFired(_:)), userInfo: nil, repeats: false) } @@ -279,12 +302,12 @@ open class PDFPageScrubber: UIToolbar { enableTimer = Timer.scheduledTimer(timeInterval: 0.25, target: self, - selector: #selector(PDFPageScrubber.enableTimerFired(_:)), + selector: #selector(UXMPageScrubber.enableTimerFired(_:)), userInfo: nil, repeats: false) } - func scrubberPageNumber(_ scrubber: PDFPageScrubberTrackControl) -> Int { + func scrubberPageNumber(_ scrubber: UXMPageScrubberTrackControl) -> Int { let controlWidth = scrubber.bounds.size.width let stride = controlWidth / CGFloat(document.pageCount) let page = Int(scrubber.value / stride) @@ -292,19 +315,23 @@ open class PDFPageScrubber: UIToolbar { return page + 1 } - func scrubberTouchDown(_ scrubber: PDFPageScrubberTrackControl) { - let page = scrubberPageNumber(scrubber) + func refreshScrubber(_ scrubber: UXMPageScrubberTrackControl? = nil) { + let innerScrubber = scrubber ?? self.scrubber + let page = scrubberPageNumber(innerScrubber) if page != document.currentPage { updatePageNumberText(page) updatePageThumbView(page) - - restartTrackTimer() } - scrubber.tag = page + + innerScrubber.tag = page + } + + @objc func scrubberTouchDown(_ scrubber: UXMPageScrubberTrackControl) { + refreshScrubber(scrubber) } - func scrubberTouchUp(_ scrubber: PDFPageScrubberTrackControl) { + @objc func scrubberTouchUp(_ scrubber: UXMPageScrubberTrackControl) { if trackTimer != nil { trackTimer?.invalidate() trackTimer = nil @@ -319,7 +346,7 @@ open class PDFPageScrubber: UIToolbar { scrubber.tag = 0 } - func scrubberValueChanged(_ scrubber: PDFPageScrubberTrackControl) { + @objc func scrubberValueChanged(_ scrubber: UXMPageScrubberTrackControl) { let page = self.scrubberPageNumber(scrubber) if page != scrubber.tag { updatePageNumberText(page) diff --git a/Pod/Classes/Renderer/PDFPageScrubberThumb.swift b/Pod/Classes/Renderer/UXMPageScrubberThumb.swift old mode 100644 new mode 100755 similarity index 90% rename from Pod/Classes/Renderer/PDFPageScrubberThumb.swift rename to Pod/Classes/Renderer/UXMPageScrubberThumb.swift index ec5cd22..6839ad6 --- a/Pod/Classes/Renderer/PDFPageScrubberThumb.swift +++ b/Pod/Classes/Renderer/UXMPageScrubberThumb.swift @@ -1,5 +1,5 @@ // -// PDFPageScrubberThumb.swift +// UXMPageScrubberThumb.swift // Pods // // Created by Ricardo Nunez on 11/11/16. @@ -8,7 +8,7 @@ import UIKit -internal class PDFPageScrubberThumb: PDFThumbnailView { +internal class UXMPageScrubberThumb: UXMThumbnailView { let small: Bool let color: UIColor diff --git a/Pod/Classes/Renderer/PDFPageScrubberTrackControl.swift b/Pod/Classes/Renderer/UXMPageScrubberTrackControl.swift old mode 100644 new mode 100755 similarity index 91% rename from Pod/Classes/Renderer/PDFPageScrubberTrackControl.swift rename to Pod/Classes/Renderer/UXMPageScrubberTrackControl.swift index 38840f3..2c4a3eb --- a/Pod/Classes/Renderer/PDFPageScrubberTrackControl.swift +++ b/Pod/Classes/Renderer/UXMPageScrubberTrackControl.swift @@ -1,5 +1,5 @@ // -// PDFPageScrubberTrackControl.swift +// UXMPageScrubberTrackControl.swift // Pods // // Created by Ricardo Nunez on 11/11/16. @@ -8,7 +8,7 @@ import UIKit -internal class PDFPageScrubberTrackControl: UIControl { +internal class UXMPageScrubberTrackControl: UIControl { var value: CGFloat = 0.0 override init(frame: CGRect) { @@ -17,7 +17,7 @@ internal class PDFPageScrubberTrackControl: UIControl { autoresizesSubviews = false isUserInteractionEnabled = true contentMode = .redraw - autoresizingMask = UIViewAutoresizing() + autoresizingMask = UIView.AutoresizingMask() backgroundColor = UIColor.clear isExclusiveTouch = true } diff --git a/Pod/Classes/Renderer/PDFPageTileLayer.swift b/Pod/Classes/Renderer/UXMPageTileLayer.swift old mode 100644 new mode 100755 similarity index 92% rename from Pod/Classes/Renderer/PDFPageTileLayer.swift rename to Pod/Classes/Renderer/UXMPageTileLayer.swift index a1f82c5..f364e4d --- a/Pod/Classes/Renderer/PDFPageTileLayer.swift +++ b/Pod/Classes/Renderer/UXMPageTileLayer.swift @@ -1,5 +1,5 @@ // -// PDFPageTileLayer.swift +// UXMPageTileLayer.swift // Pods // // Created by Chris Anderson on 3/5/16. @@ -8,7 +8,7 @@ import UIKit -internal class PDFPageTileLayer: CATiledLayer { +internal class UXMPageTileLayer: CATiledLayer { override init() { super.init() diff --git a/Pod/Classes/Renderer/UXMRenderer.swift b/Pod/Classes/Renderer/UXMRenderer.swift new file mode 100755 index 0000000..b361eba --- /dev/null +++ b/Pod/Classes/Renderer/UXMRenderer.swift @@ -0,0 +1,75 @@ +// +// UXMRenderer.swift +// Pods +// +// Created by Chris Anderson on 6/25/16. +// +// + +import Foundation + +public protocol UXMRenderer { + func render(_ page: Int, context:CGContext, bounds: CGRect) +} + +open class UXMRenderController { + let document: UXMPDFDocument + let renderControllers: [UXMRenderer] + + public init(document: UXMPDFDocument, controllers: [UXMRenderer]) { + self.document = document + self.renderControllers = controllers + } + + open func renderOntoPDF() -> URL { + let documentRef = document.documentRef + let pages = document.pageCount + let title = document.fileUrl?.lastPathComponent ?? "annotated.pdf" + let tempPath = NSTemporaryDirectory() + title + + UIGraphicsBeginPDFContextToFile(tempPath, CGRect.zero, nil) + if pages > 0 { + for i in 1...pages { + let page = documentRef?.page(at: i) + let bounds = document.boundsForPDFPage(i) + + guard let context = UIGraphicsGetCurrentContext() else { continue } + UIGraphicsBeginPDFPageWithInfo(bounds, nil) + context.translateBy(x: 0, y: bounds.size.height) + context.scaleBy(x: 1.0, y: -1.0) + context.drawPDFPage (page!) + + context.scaleBy(x: 1.0, y: -1.0) + context.translateBy(x: 0, y: -bounds.size.height) + + for controller in renderControllers { + controller.render(i, context:context, bounds:bounds) + } + } + } + UIGraphicsEndPDFContext() + + return URL(fileURLWithPath: tempPath) + } + + open func save(_ url: URL? = nil) -> Bool { + guard let url = url ?? document.fileUrl else { + return false + } + let tempUrl = self.renderOntoPDF() + if url == tempUrl { + return true + } + let fileManager = FileManager.default + do { + if fileManager.fileExists(atPath: url.path) { + _ = try fileManager.replaceItemAt(url, withItemAt: tempUrl) + } else { + try fileManager.copyItem(at: tempUrl, to: url) + } + } catch { + return false + } + return true + } +} diff --git a/Pod/Classes/Renderer/PDFSinglePageCell.swift b/Pod/Classes/Renderer/UXMSinglePageCell.swift old mode 100644 new mode 100755 similarity index 78% rename from Pod/Classes/Renderer/PDFSinglePageCell.swift rename to Pod/Classes/Renderer/UXMSinglePageCell.swift index 8df0fef..3795b55 --- a/Pod/Classes/Renderer/PDFSinglePageCell.swift +++ b/Pod/Classes/Renderer/UXMSinglePageCell.swift @@ -1,5 +1,5 @@ // -// PDFSinglePageCell.swift +// UXMSinglePageCell.swift // Pods // // Created by Ricardo Nunez on 11/11/16. @@ -8,10 +8,10 @@ import UIKit -open class PDFSinglePageCell: UICollectionViewCell { - private var _pageContentView: PDFPageContentView? +open class UXMSinglePageCell: UICollectionViewCell { + private var _pageContentView: UXMPageContentView? - open var pageContentView: PDFPageContentView? { + open var pageContentView: UXMPageContentView? { get { return _pageContentView } diff --git a/Pod/Classes/Renderer/PDFSinglePageViewer.swift b/Pod/Classes/Renderer/UXMSinglePageViewer.swift old mode 100644 new mode 100755 similarity index 69% rename from Pod/Classes/Renderer/PDFSinglePageViewer.swift rename to Pod/Classes/Renderer/UXMSinglePageViewer.swift index 4676ae1..034c1e2 --- a/Pod/Classes/Renderer/PDFSinglePageViewer.swift +++ b/Pod/Classes/Renderer/UXMSinglePageViewer.swift @@ -8,37 +8,37 @@ import UIKit -public protocol PDFSinglePageViewerDelegate { - func singlePageViewer(_ collectionView: PDFSinglePageViewer, didDisplayPage page: Int) - func singlePageViewer(_ collectionView: PDFSinglePageViewer, loadedContent content: PDFPageContentView) - func singlePageViewer(_ collectionView: PDFSinglePageViewer, selected action: PDFAction) - func singlePageViewer(_ collectionView: PDFSinglePageViewer, selected annotation: PDFAnnotationView) - func singlePageViewer(_ collectionView: PDFSinglePageViewer, tapped recognizer: UITapGestureRecognizer) +public protocol UXMSinglePageViewerDelegate : class { + func singlePageViewer(_ collectionView: UXMSinglePageViewer, didDisplayPage page: Int) + func singlePageViewer(_ collectionView: UXMSinglePageViewer, loadedContent content: UXMPageContentView) + func singlePageViewer(_ collectionView: UXMSinglePageViewer, selected action: UXMAction) + func singlePageViewer(_ collectionView: UXMSinglePageViewer, selected annotation: UXMPDFAnnotationView) + func singlePageViewer(_ collectionView: UXMSinglePageViewer, tapped recognizer: UITapGestureRecognizer) func singlePageViewerDidBeginDragging() func singlePageViewerDidEndDragging() } -open class PDFSinglePageFlowLayout: UICollectionViewFlowLayout { +open class UXMSinglePageFlowLayout: UICollectionViewFlowLayout { open override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool { return true } } -open class PDFSinglePageViewer: UICollectionView { +open class UXMSinglePageViewer: UICollectionView { - open var singlePageDelegate: PDFSinglePageViewerDelegate? - open var document: PDFDocument? + open weak var singlePageDelegate: UXMSinglePageViewerDelegate? + open var document: UXMPDFDocument? var internalPage: Int = 0 - var scrollDirection: UICollectionViewScrollDirection { + var scrollDirection: UICollectionView.ScrollDirection { let flowLayout = collectionViewLayout as! UICollectionViewFlowLayout return flowLayout.scrollDirection } private static var flowLayout: UICollectionViewFlowLayout { - let layout = PDFSinglePageFlowLayout() + let layout = UXMSinglePageFlowLayout() layout.scrollDirection = .horizontal layout.sectionInset = UIEdgeInsets.zero layout.minimumLineSpacing = 0.0 @@ -46,17 +46,17 @@ open class PDFSinglePageViewer: UICollectionView { return layout } - public init(frame: CGRect, document: PDFDocument) { + public init(frame: CGRect, document: UXMPDFDocument) { self.document = document - super.init(frame: frame, collectionViewLayout: PDFSinglePageViewer.flowLayout) + super.init(frame: frame, collectionViewLayout: UXMSinglePageViewer.flowLayout) setupCollectionView() } required public init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) - collectionViewLayout = PDFSinglePageViewer.flowLayout + collectionViewLayout = UXMSinglePageViewer.flowLayout setupCollectionView() } @@ -65,7 +65,7 @@ open class PDFSinglePageViewer: UICollectionView { isPagingEnabled = true backgroundColor = UIColor.groupTableViewBackground showsHorizontalScrollIndicator = false - register(PDFSinglePageCell.self, forCellWithReuseIdentifier: "ContentCell") + register(UXMSinglePageCell.self, forCellWithReuseIdentifier: "ContentCell") delegate = self dataSource = self @@ -79,19 +79,16 @@ open class PDFSinglePageViewer: UICollectionView { } } - open func indexForPage(_ page: Int) -> Int { - let currentPage = page - 1 - if currentPage <= 0 { - return 0 - } else if let pageCount = document?.pageCount, currentPage > pageCount { - return pageCount - 1 - } else { - return currentPage - } + open func indexForPage(_ page: Int) -> Int? { + guard let document = document, document.pageCount > 0 else { return nil } + var currentPage = page - 1 + currentPage = max(currentPage, 0) + currentPage = min(currentPage, document.pageCount - 1) + return currentPage } open func displayPage(_ page: Int, animated: Bool) { - let currentPage = indexForPage(page) + guard let currentPage = indexForPage(page) else { return } let indexPath = IndexPath(item: currentPage, section: 0) switch scrollDirection { case .horizontal: @@ -101,10 +98,9 @@ open class PDFSinglePageViewer: UICollectionView { } } - open func getPageContent(_ page: Int) -> PDFPageContentView? { - if document == nil { return nil } - let currentPage = indexForPage(page) - if let cell = self.collectionView(self, cellForItemAt: IndexPath(item: currentPage, section: 0)) as? PDFSinglePageCell, + open func getPageContent(_ page: Int) -> UXMPageContentView? { + guard let currentPage = indexForPage(page) else { return nil } + if let cell = self.collectionView(self, cellForItemAt: IndexPath(item: currentPage, section: 0)) as? UXMSinglePageCell, let pageContentView = cell.pageContentView { return pageContentView } @@ -118,7 +114,7 @@ open class PDFSinglePageViewer: UICollectionView { } } -extension PDFSinglePageViewer: UICollectionViewDataSource { +extension UXMSinglePageViewer: UICollectionViewDataSource { public func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } @@ -131,39 +127,44 @@ extension PDFSinglePageViewer: UICollectionViewDataSource { } public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = self.dequeueReusableCell(withReuseIdentifier: "ContentCell", for: indexPath) as! PDFSinglePageCell + let cell = self.dequeueReusableCell(withReuseIdentifier: "ContentCell", for: indexPath) as! UXMSinglePageCell let contentSize = self.collectionView(collectionView, layout: collectionViewLayout, sizeForItemAt: indexPath) let contentFrame = CGRect(origin: CGPoint.zero, size: contentSize) let page = indexPath.row + 1 - cell.pageContentView = PDFPageContentView(frame: contentFrame, document: document!, page: page) + cell.pageContentView = UXMPageContentView(frame: contentFrame, document: document!, page: page) cell.pageContentView?.contentDelegate = self return cell } } -extension PDFSinglePageViewer: UICollectionViewDelegate { +extension UXMSinglePageViewer: UICollectionViewDelegate { public func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { - if let pdfCell = cell as? PDFSinglePageCell, let pageContentView = pdfCell.pageContentView { + if let pdfCell = cell as? UXMSinglePageCell, let pageContentView = pdfCell.pageContentView { singlePageDelegate?.singlePageViewer(self, loadedContent: pageContentView) } } } -extension PDFSinglePageViewer: UICollectionViewDelegateFlowLayout { +extension UXMSinglePageViewer: UICollectionViewDelegateFlowLayout { public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { switch scrollDirection { case .horizontal: var size = bounds.size - let contentInsetHeight = contentInset.bottom + contentInset.top + 1 + let contentInsetHeight: CGFloat + if #available(iOS 11.0, *) { + contentInsetHeight = adjustedContentInset.bottom + adjustedContentInset.top + 1 + } else { + contentInsetHeight = contentInset.bottom + contentInset.top + 1 + } size.height -= contentInsetHeight return size case .vertical: let page = indexPath.row + 1 - let contentViewSize = PDFPageContentView(frame: bounds, document: document!, page: page).contentSize + let contentViewSize = UXMPageContentView(frame: bounds, document: document!, page: page).contentSize // Find proper aspect ratio so that cell is full width let widthMultiplier: CGFloat @@ -183,7 +184,7 @@ extension PDFSinglePageViewer: UICollectionViewDelegateFlowLayout { } } -extension PDFSinglePageViewer: UIScrollViewDelegate { +extension UXMSinglePageViewer: UIScrollViewDelegate { public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { self.singlePageDelegate?.singlePageViewerDidBeginDragging() @@ -221,7 +222,7 @@ extension PDFSinglePageViewer: UIScrollViewDelegate { singlePageDelegate?.singlePageViewer(self, didDisplayPage: page) let indexPath = IndexPath(row: page - 1, section: 0) - if let cell = cellForItem(at: indexPath) as? PDFSinglePageCell { + if let cell = cellForItem(at: indexPath) as? UXMSinglePageCell { if let pageContentView = cell.pageContentView { singlePageDelegate?.singlePageViewer(self, loadedContent: pageContentView) } @@ -229,22 +230,22 @@ extension PDFSinglePageViewer: UIScrollViewDelegate { } } -extension PDFSinglePageViewer: PDFPageContentViewDelegate { - public func contentView(_ contentView: PDFPageContentView, didSelect action: PDFAction) { +extension UXMSinglePageViewer: UXMPageContentViewDelegate { + public func contentView(_ contentView: UXMPageContentView, didSelect action: UXMAction) { if let singlePageDelegate = singlePageDelegate { singlePageDelegate.singlePageViewer(self, selected: action) - } else if let action = action as? PDFActionGoTo { + } else if let action = action as? UXMActionGoTo { displayPage(action.pageIndex, animated: true) } } - public func contentView(_ contentView: PDFPageContentView, didSelect annotation: PDFAnnotationView) { + public func contentView(_ contentView: UXMPageContentView, didSelect annotation: UXMPDFAnnotationView) { singlePageDelegate?.singlePageViewer(self, selected: annotation) } - public func contentView(_ contentView: PDFPageContentView, tapped recognizer: UITapGestureRecognizer) { + public func contentView(_ contentView: UXMPageContentView, tapped recognizer: UITapGestureRecognizer) { singlePageDelegate?.singlePageViewer(self, tapped: recognizer) } - public func contentView(_ contentView: PDFPageContentView, doubleTapped recognizer: UITapGestureRecognizer) {} + public func contentView(_ contentView: UXMPageContentView, doubleTapped recognizer: UITapGestureRecognizer) {} } diff --git a/Pod/Classes/Renderer/PDFSnapshotCache.swift b/Pod/Classes/Renderer/UXMSnapshotCache.swift similarity index 77% rename from Pod/Classes/Renderer/PDFSnapshotCache.swift rename to Pod/Classes/Renderer/UXMSnapshotCache.swift index b928243..feac890 100644 --- a/Pod/Classes/Renderer/PDFSnapshotCache.swift +++ b/Pod/Classes/Renderer/UXMSnapshotCache.swift @@ -1,5 +1,5 @@ // -// PDFSnapshotCache.swift +// UXMSnapshotCache.swift // Pods // // Created by Chris Anderson on 5/6/16. @@ -12,15 +12,15 @@ fileprivate enum SnapshotState { case new, started, finished, failed } -open class PDFSnapshot { +open class UXMSnapshot { fileprivate var state = SnapshotState.new var image: UIImage? - let document: PDFDocument + let document: UXMPDFDocument let page: Int let guid: String let size: CGSize - init(document: PDFDocument, page: Int, guid: String, size: CGSize) { + init(document: UXMPDFDocument, page: Int, guid: String, size: CGSize) { self.document = document self.page = page self.guid = guid @@ -28,7 +28,7 @@ open class PDFSnapshot { } } -open class PDFQueue { +open class UXMQueue { lazy var rendersInProgress = [String:Operation]() lazy var renderQueue: OperationQueue = { var queue = OperationQueue() @@ -37,22 +37,22 @@ open class PDFQueue { return queue }() - var progressBlock: ((PDFSnapshot) -> Void)? + var progressBlock: ((UXMSnapshot) -> Void)? - static let sharedQueue = PDFQueue() + static let sharedQueue = UXMQueue() - func fetchPage(_ document: PDFDocument, page: Int, size: CGSize, completion:((PDFSnapshot) -> Void)?) { + func fetchPage(_ document: UXMPDFDocument, page: Int, size: CGSize, completion:((UXMSnapshot) -> Void)?) { let guid = "\(document.guid)_\(page)" - let thumbnail = PDFSnapshot(document: document, page: page, guid: guid, size: size) - if let image = PDFSnapshotCache.sharedCache.objectForKey(guid) { + let thumbnail = UXMSnapshot(document: document, page: page, guid: guid, size: size) + if let image = UXMSnapshotCache.sharedCache.objectForKey(guid) { thumbnail.image = image DispatchQueue.main.async { completion?(thumbnail) } } - let thumbRender = PDFSnapshotRenderer(snapshot: thumbnail) + let thumbRender = UXMSnapshotRenderer(snapshot: thumbnail) thumbRender.completionBlock = { [unowned self] in self.rendersInProgress.removeValue(forKey: guid) DispatchQueue.main.async { @@ -65,15 +65,15 @@ open class PDFQueue { renderQueue.addOperation(thumbRender) } - open static func fetchPage(_ document: PDFDocument, page: Int, size: CGSize, completion:((PDFSnapshot) -> Void)?) { + public static func fetchPage(_ document: UXMPDFDocument, page: Int, size: CGSize, completion:((UXMSnapshot) -> Void)?) { self.sharedQueue.fetchPage(document, page: page, size: size, completion:completion) } } -fileprivate class PDFSnapshotRenderer: Operation { - let snapshot: PDFSnapshot +fileprivate class UXMSnapshotRenderer: Operation { + let snapshot: UXMSnapshot - init(snapshot: PDFSnapshot) { + init(snapshot: UXMSnapshot) { self.snapshot = snapshot } @@ -85,7 +85,7 @@ fileprivate class PDFSnapshotRenderer: Operation { } guard let image = renderPDF(snapshot.size) else { - PDFSnapshotCache.sharedCache.removeObjectForKey(self.snapshot.guid) + UXMSnapshotCache.sharedCache.removeObjectForKey(self.snapshot.guid) snapshot.state = .failed return } @@ -97,12 +97,12 @@ fileprivate class PDFSnapshotRenderer: Operation { } snapshot.image = image - PDFSnapshotCache.sharedCache.setObject(image, key: self.snapshot.guid) + UXMSnapshotCache.sharedCache.setObject(image, key: self.snapshot.guid) } func renderPDF(_ size: CGSize) -> UIImage? { let documentRef = self.snapshot.document.documentRef - guard let page = documentRef?.page(at: self.snapshot.page) else { return nil } + guard let page = documentRef?.page(at: self.snapshot.page), size.width > 0, size.height > 0 else { return nil } var pageRect = page.getBoxRect(.mediaBox) let scale = min(size.width / pageRect.size.width, size.height / pageRect.size.height) @@ -126,7 +126,7 @@ fileprivate class PDFSnapshotRenderer: Operation { context.translateBy(x: 0.0, y: pageRect.size.height / scale) context.scaleBy(x: 1.0, y: -1.0) - self.snapshot.document.annotations.renderInContext(context, + self.snapshot.document.annotationsStore.renderInContext(context, size: pageRect, page: self.snapshot.page) @@ -139,16 +139,16 @@ fileprivate class PDFSnapshotRenderer: Operation { } } -fileprivate class PDFSnapshotCache { +fileprivate class UXMSnapshotCache { lazy var cache: NSCache = { let cache: NSCache = NSCache() - cache.name = "PDFSnapshotCache" + cache.name = "UXMSnapshotCache" cache.countLimit = 150 cache.totalCostLimit = 10*1024*1024 return cache }() - static let sharedCache = PDFSnapshotCache() + static let sharedCache = UXMSnapshotCache() func objectForKey(_ key: String) -> UIImage? { return cache.object(forKey: (key as NSString)) diff --git a/Pod/Classes/Renderer/UXMThumbnailView.swift b/Pod/Classes/Renderer/UXMThumbnailView.swift new file mode 100644 index 0000000..ead396c --- /dev/null +++ b/Pod/Classes/Renderer/UXMThumbnailView.swift @@ -0,0 +1,42 @@ +// +// UXMThumbnailView.swift +// Pods +// +// Created by Chris Anderson on 5/6/16. +// +// + +import UIKit + +internal class UXMThumbnailView: UIView { + let imageView: UIImageView + + override init(frame: CGRect) { + imageView = UIImageView() + imageView.autoresizingMask = [.flexibleWidth, .flexibleHeight] + imageView.contentMode = .scaleAspectFit + + super.init(frame: frame) + + imageView.frame = self.bounds + addSubview(imageView) + + isUserInteractionEnabled = false + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + convenience init(frame: CGRect, document: UXMPDFDocument, page: Int) { + self.init(frame: frame) + showImage(document, page: page) + } + + func showImage(_ document: UXMPDFDocument, page: Int) { + imageView.image = nil + UXMQueue.sharedQueue.fetchPage(document, page: page, size: frame.size) { (thumbnail) in + self.imageView.image = thumbnail.image + } + } +} diff --git a/Pod/Classes/Renderer/PDFThumbnailViewCell.swift b/Pod/Classes/Renderer/UXMThumbnailViewCell.swift old mode 100644 new mode 100755 similarity index 79% rename from Pod/Classes/Renderer/PDFThumbnailViewCell.swift rename to Pod/Classes/Renderer/UXMThumbnailViewCell.swift index 3405c1b..dd55900 --- a/Pod/Classes/Renderer/PDFThumbnailViewCell.swift +++ b/Pod/Classes/Renderer/UXMThumbnailViewCell.swift @@ -1,5 +1,5 @@ // -// PDFThumbnailViewCell.swift +// UXMThumbnailViewCell.swift // Pods // // Created by Chris Anderson on 11/14/16. @@ -8,9 +8,9 @@ import UIKit -class PDFThumbnailViewCell: UICollectionViewCell { +class UXMThumbnailViewCell: UICollectionViewCell { - var pageThumbnail: PDFThumbnailView? + var pageThumbnail: UXMThumbnailView? override init(frame: CGRect) { super.init(frame: frame) @@ -24,9 +24,9 @@ class PDFThumbnailViewCell: UICollectionViewCell { self.backgroundColor = UIColor.lightGray } - func configure(document: PDFDocument, page: Int) { + func configure(document: UXMPDFDocument, page: Int) { pageThumbnail?.removeFromSuperview() - pageThumbnail = PDFThumbnailView(frame: CGRect(x: 1, + pageThumbnail = UXMThumbnailView(frame: CGRect(x: 1, y: 1, width: self.frame.width - 2, height: self.frame.height - 2), diff --git a/Pod/Classes/Renderer/PDFThumbnailViewController.swift b/Pod/Classes/Renderer/UXMThumbnailViewController.swift similarity index 78% rename from Pod/Classes/Renderer/PDFThumbnailViewController.swift rename to Pod/Classes/Renderer/UXMThumbnailViewController.swift index 4e41301..8f37798 100644 --- a/Pod/Classes/Renderer/PDFThumbnailViewController.swift +++ b/Pod/Classes/Renderer/UXMThumbnailViewController.swift @@ -1,5 +1,5 @@ // -// PDFThumbnailViewController.swift +// UXMThumbnailViewController.swift // Pods // // Created by Chris Anderson on 11/14/16. @@ -8,27 +8,28 @@ import UIKit -public protocol PDFThumbnailViewControllerDelegate { - func thumbnailCollection(_ collection: PDFThumbnailViewController, didSelect page: Int) +public protocol UXMThumbnailViewControllerDelegate : class { + func thumbnailCollection(_ collection: UXMThumbnailViewController, didSelect page: Int) } -open class PDFThumbnailViewController: UIViewController { +open class UXMThumbnailViewController: UIViewController { - var document: PDFDocument! + var document: UXMPDFDocument! var collectionView: UICollectionView! + + public weak var delegate: UXMThumbnailViewControllerDelegate? + private var flowLayout: UICollectionViewFlowLayout { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .vertical - layout.sectionInset = UIEdgeInsetsMake(20, 20, 20, 20) - layout.minimumLineSpacing = 0.0 + layout.sectionInset = UIEdgeInsets.init(top: 20, left: 20, bottom: 20, right: 20) + layout.minimumLineSpacing = 20.0 layout.minimumInteritemSpacing = 0.0 return layout } - - public var delegate: PDFThumbnailViewControllerDelegate? - public init(document: PDFDocument) { + public init(document: UXMPDFDocument) { super.init(nibName: nil, bundle: nil) self.document = document } @@ -43,7 +44,7 @@ open class PDFThumbnailViewController: UIViewController { collectionView.delegate = self collectionView.dataSource = self - self.collectionView.register(PDFThumbnailViewCell.self, forCellWithReuseIdentifier: "ThumbnailCell") + self.collectionView.register(UXMThumbnailViewCell.self, forCellWithReuseIdentifier: "ThumbnailCell") self.setupUI() } @@ -55,7 +56,7 @@ open class PDFThumbnailViewController: UIViewController { self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Done", style: .plain, target: self, - action: #selector(PDFThumbnailViewController.tappedDone)) + action: #selector(UXMThumbnailViewController.tappedDone)) view.addSubview(collectionView) collectionView.backgroundColor = UIColor.white @@ -72,7 +73,7 @@ open class PDFThumbnailViewController: UIViewController { } } -extension PDFThumbnailViewController: UICollectionViewDataSource { +extension UXMThumbnailViewController: UICollectionViewDataSource { public func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } @@ -86,7 +87,7 @@ extension PDFThumbnailViewController: UICollectionViewDataSource { public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = self.collectionView.dequeueReusableCell(withReuseIdentifier: "ThumbnailCell", for: indexPath) as! PDFThumbnailViewCell + let cell = self.collectionView.dequeueReusableCell(withReuseIdentifier: "ThumbnailCell", for: indexPath) as! UXMThumbnailViewCell let page = indexPath.row + 1 cell.configure(document: document, page: page) @@ -95,14 +96,14 @@ extension PDFThumbnailViewController: UICollectionViewDataSource { } } -extension PDFThumbnailViewController: UICollectionViewDelegate { +extension UXMThumbnailViewController: UICollectionViewDelegate { public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { self.delegate?.thumbnailCollection(self, didSelect: indexPath.row + 1) } } -extension PDFThumbnailViewController: UICollectionViewDelegateFlowLayout { +extension UXMThumbnailViewController: UICollectionViewDelegateFlowLayout { public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let bounds = document.boundsForPDFPage(indexPath.row + 1) diff --git a/Pod/Classes/TextParser/PDFTextParser.swift b/Pod/Classes/TextParser/UXMTextParser.swift old mode 100644 new mode 100755 similarity index 84% rename from Pod/Classes/TextParser/PDFTextParser.swift rename to Pod/Classes/TextParser/UXMTextParser.swift index 4fa4002..2cce801 --- a/Pod/Classes/TextParser/PDFTextParser.swift +++ b/Pod/Classes/TextParser/UXMTextParser.swift @@ -1,5 +1,5 @@ // -// PDFTextParser.swift +// UXMTextParser.swift // Pods // // Created by Chris Anderson on 11/15/16. @@ -8,22 +8,22 @@ import UIKit -enum PDFTextParserError: Error { +enum UXMTextParserError: Error { case noPageRef } -class PDFTextParser { +class UXMTextParser { - var document: PDFDocument + var document: UXMPDFDocument var pageRef: CGPDFPage? - init(document: PDFDocument, page: Int) throws { + init(document: UXMPDFDocument, page: Int) throws { self.document = document self.pageRef = document.page(at: page) guard let pageRef = self.pageRef else { - throw PDFTextParserError.noPageRef + throw UXMTextParserError.noPageRef } var pageDict: CGPDFDictionaryRef? = pageRef.dictionary diff --git a/Pod/Classes/View/ResizeableView.swift b/Pod/Classes/View/ResizeableView.swift old mode 100644 new mode 100755 index cced88a..9b66806 --- a/Pod/Classes/View/ResizeableView.swift +++ b/Pod/Classes/View/ResizeableView.swift @@ -27,7 +27,7 @@ struct CGPointResizableViewAnchorPointPair { var anchorPoint: ResizableViewAnchorPoint } -protocol ResizableViewDelegate { +protocol ResizableViewDelegate : class { func resizableViewDidBeginEditing(view: ResizableView) func resizableViewDidEndEditing(view: ResizableView) func resizableViewDidSelectAction(view: ResizableView, action: String) @@ -42,7 +42,7 @@ open class ResizableView: UIView { var minWidth: CGFloat = 48.0 var minHeight: CGFloat = 48.0 var anchorPoint: ResizableViewAnchorPoint? - var delegate: ResizableViewDelegate? + weak var delegate: ResizableViewDelegate? var preventsPositionOutsideSuperview: Bool = true var isLocked = false { didSet { @@ -344,7 +344,7 @@ open class ResizableView: UIView { self.resignFirstResponder() } - func menuActionDelete(_ sender: Any!) { + @objc func menuActionDelete(_ sender: Any!) { self.delegate?.resizableViewDidSelectAction(view: self, action: "delete") } diff --git a/Pod/Classes/View/PDFBarButton.swift b/Pod/Classes/View/UXMBarButton.swift similarity index 69% rename from Pod/Classes/View/PDFBarButton.swift rename to Pod/Classes/View/UXMBarButton.swift index 9a49462..4b4e49d 100644 --- a/Pod/Classes/View/PDFBarButton.swift +++ b/Pod/Classes/View/UXMBarButton.swift @@ -1,5 +1,5 @@ // -// PDFBarButton.swift +// UXMBarButton.swift // Pods // // Created by Ricardo Nunez on 11/11/16. @@ -8,11 +8,11 @@ import UIKit -open class PDFBarButton: UIBarButtonItem { +open class UXMBarButton: UIBarButtonItem { fileprivate let button = UIButton(frame: CGRect(x: 0, y: 0, width: 32, height: 32)) fileprivate var toggled = false - fileprivate lazy var defaultTint = UIColor.blue - fileprivate var block: ((PDFBarButton) -> ())? + public static var defaultTint = UIColor.blue + fileprivate var block: ((UXMBarButton) -> ())? override open var tintColor: UIColor? { didSet { @@ -25,13 +25,12 @@ open class PDFBarButton: UIBarButtonItem { toggled: Bool, target: AnyObject? = nil, action: Selector? = nil, - block: ((PDFBarButton) -> ())? = nil + block: ((UXMBarButton) -> ())? = nil ) { self.init() customView = button - defaultTint = button.tintColor toggle(toggled) @@ -39,15 +38,15 @@ open class PDFBarButton: UIBarButtonItem { self.action = action self.block = block - button.addTarget(self, action: #selector(PDFBarButton.tapped), for: .touchUpInside) - button.setImage(image?.withRenderingMode(.alwaysTemplate), for: UIControlState()) + button.addTarget(self, action: #selector(UXMBarButton.tapped), for: .touchUpInside) + button.setImage(image?.withRenderingMode(.alwaysTemplate), for: UIControl.State()) } open func toggle(_ state: Bool) { toggled = state if toggled { button.tintColor = UIColor.white - button.layer.backgroundColor = (tintColor ?? defaultTint).cgColor + button.layer.backgroundColor = (tintColor ?? UXMBarButton.defaultTint).cgColor button.layer.cornerRadius = 4.0 } else { @@ -57,19 +56,19 @@ open class PDFBarButton: UIBarButtonItem { } } - func tapped() { + @objc func tapped() { let _ = self.target?.perform(self.action, with: self) self.block?(self) } } -open class PDFAnnotationBarButton: PDFBarButton { - var annotationType: PDFAnnotation.Type? = nil +open class PDFAnnotationBarButton: UXMBarButton { + var annotationType: UXMAnnotation.Type? = nil convenience init( toggled: Bool, - type: PDFAnnotationButtonable.Type, - block: ((PDFBarButton) -> ())? = nil + type: UXMPDFAnnotationButtonable.Type, + block: ((UXMBarButton) -> ())? = nil ) { self.init(image: type.buttonImage, toggled: toggled, target: nil, action: nil, block: block) self.annotationType = type diff --git a/README.md b/README.md old mode 100644 new mode 100755 index ad4b7aa..8d6f609 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ -![UXM Token Field](https://uxmstudio.com/public/images/uxmpdfkit.png) +![UXM Token Field](https://avatars3.githubusercontent.com/u/13734873?s=400&v=4) -[![CI Status](http://img.shields.io/travis/uxmstudio/UXMPDFKit.svg?style=flat)](https://travis-ci.org/uxmstudio/UXMPDFKit) +[![CI Status](http://img.shields.io/travis/uxmstudio/UXMPDFKit.svg?style=flat)](https://travis-ci.org/diegostamigni/UXMPDFKit.svg?branch=master) [![Version](https://img.shields.io/cocoapods/v/UXMPDFKit.svg?style=flat)](http://cocoapods.org/pods/UXMPDFKit) -![Swift](https://img.shields.io/badge/%20in-swift%203.0-orange.svg) +![Swift](https://img.shields.io/badge/%20in-swift%204.2-orange.svg) [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![License](https://img.shields.io/cocoapods/l/UXMPDFKit.svg?style=flat)](http://cocoapods.org/pods/UXMPDFKit) [![Platform](https://img.shields.io/cocoapods/p/UXMPDFKit.svg?style=flat)](http://cocoapods.org/pods/UXMPDFKit) ## Requirements - iOS 9 or above -- Xcode 8 or above -- Swift 3.0 +- Xcode 10 or above +- Swift 4.2 ## Note @@ -27,11 +27,6 @@ it, simply add the following line to your Podfile: pod "UXMPDFKit" ``` -If you wish to use the Swift 2.3 version, use the following instead: -```ruby -pod "UXMPDFKit", "~> 0.3.0" -``` - ### Carthage UXMPDFKit is also available through [Carthage](https://github.com/Carthage/Carthage). @@ -129,7 +124,7 @@ public protocol PDFAnnotation { /// Boolean representing if the annotation has been saved var saved: Bool { get set } - var delegate: PDFAnnotationEvent? { get set } + weak var delegate: UXMPDFAnnotationEvent? { get set } /// Force implementations to have an init init() @@ -156,10 +151,10 @@ An annotation should be an object that contains its position and value, not a vi Additionally, it is recommended that the view passed by ```mutableView()``` extend ```ResizableView``` as this allows the annotation to be moved, resized and deleted individually. -In order for annotations to be able to be listed inside of the toolbar, they must also extend ```PDFAnnotationButtonable```. +In order for annotations to be able to be listed inside of the toolbar, they must also extend ```UXMPDFAnnotationButtonable```. ```swift -public protocol PDFAnnotationButtonable: PDFAnnotation { +public protocol UXMPDFAnnotationButtonable: UXMPDFAnnotation { /// Name for UIBarButtonItem representation of annotation static var name: String? { get } @@ -182,13 +177,13 @@ Currently supported actions: - [ ] Javascript - [ ] Rich Media -Tapped actions are passed to your view controller by the PDFSinglePageViewer in its ```contentDelegate``` +Tapped actions are passed to your view controller by the UXMPDFSinglePageViewer in its ```contentDelegate``` ### Renderer In order to perform write operations back onto a PDF in an efficient format, a renderer is used. Each type of form, annotation, etc that needs to be rendered back onto the PDF should extend the following protocol: ```swift -protocol PDFRenderer { +protocol UXMRenderer { func render(page: Int, context:CGContext, bounds: CGRect) } ``` @@ -196,7 +191,7 @@ protocol PDFRenderer { Controllers or objects that extend this protocol can then be passed to the PDFRenderer to be written onto a temporary document or saved permanently onto the document. ```swift -let renderer = PDFRenderController(document: self.document, controllers: [ +let renderer = UXMPDFRenderController(document: self.document, controllers: [ self.annotationController, self.formController ]) diff --git a/UXMPDFKit.podspec b/UXMPDFKit.podspec old mode 100644 new mode 100755 index 6767ff3..d791ee0 --- a/UXMPDFKit.podspec +++ b/UXMPDFKit.podspec @@ -8,16 +8,17 @@ Pod::Spec.new do |s| s.name = "UXMPDFKit" - s.version = "0.7.2" + s.version = "0.8.3" s.summary = "A fully functioning PDF reader written completely in Swift" - s.homepage = "https://github.com/uxmstudio/UXMPDFKit" + s.homepage = "https://github.com/diegostamigni/UXMPDFKit" # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2" s.license = 'MIT' s.author = { "Chris Anderson" => "chris@uxmstudio.com" } - s.source = { :git => "https://github.com/uxmstudio/UXMPDFKit.git", :tag => s.version.to_s } + s.source = { :git => "https://github.com/diegostamigni/UXMPDFKit.git", :tag => s.version.to_s } s.requires_arc = true + s.swift_version = '4.2' s.ios.deployment_target = '9.0' s.ios.source_files = 'Pod/Classes/**/*' diff --git a/_Pods.xcodeproj b/_Pods.xcodeproj deleted file mode 120000 index 3c5a8e7..0000000 --- a/_Pods.xcodeproj +++ /dev/null @@ -1 +0,0 @@ -Example/Pods/Pods.xcodeproj \ No newline at end of file