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..9a3251a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,10 @@ # * https://github.com/supermarin/xcpretty#usage language: objective-c -osx_image: xcode8 +osx_image: xcode10.1 # cache: cocoapods # podfile: Example/Podfile before_install: - - gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet -# - pod install --project-directory=Example + - gem install cocoapods script: - pod lib lint diff --git a/Example/Podfile b/Example/Podfile index f7eb15f..f716a5f 100644 --- 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 index 0311943..7d0c64e 100644 --- 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: d7e86a0f04333c1d92c194c98c836db944ac6ac9 -PODFILE CHECKSUM: 46572415aec518e632bcccd6baa0dcc394d5ae6e +PODFILE CHECKSUM: 99f7e6a2df6f7352ce2866a0d466eb324e287eea -COCOAPODS: 1.1.1 +COCOAPODS: 1.5.3 diff --git a/Example/Pods/Local Podspecs/UXMPDFKit.podspec.json b/Example/Pods/Local Podspecs/UXMPDFKit.podspec.json index 3ffd12a..5709a21 100644 --- a/Example/Pods/Local Podspecs/UXMPDFKit.podspec.json +++ b/Example/Pods/Local Podspecs/UXMPDFKit.podspec.json @@ -1,15 +1,15 @@ { "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, "platforms": { diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock index 0311943..7d0c64e 100644 --- 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: d7e86a0f04333c1d92c194c98c836db944ac6ac9 -PODFILE CHECKSUM: 46572415aec518e632bcccd6baa0dcc394d5ae6e +PODFILE CHECKSUM: 99f7e6a2df6f7352ce2866a0d466eb324e287eea -COCOAPODS: 1.1.1 +COCOAPODS: 1.5.3 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 28222e8..c602af0 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -7,455 +7,458 @@ 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 */; }; + 02798A524A7CBCE5DB49DFA47C2C5FC5 /* ResizeableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3A3ADEEDA29EFEF6E2C1BB18B2E5AF7 /* ResizeableView.swift */; }; + 0DD0A11B57E07D48A968CED6149F7056 /* UXMPDFDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B38CC7D280010C92C92D234A514FD90 /* UXMPDFDocument.swift */; }; + 134315F0050BE13DFD4A0BE314796461 /* CGPDFDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90D900B436BC24DE19DDDD0D89EA9E92 /* CGPDFDocument.swift */; }; + 15E9FAC53D7DB518180004CB28D9F1DD /* UIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA8417704B584274DDC235C2A12C2BDF /* UIView.swift */; }; + 252148958FE49945B3AFA89A8869FF24 /* UXMAnnotationStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF0E8D8C6D2D3846822F2C2F32AB20C /* UXMAnnotationStore.swift */; }; + 272E41C214AA2DFADFC0827E794C11C0 /* UXMFormPageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 069C62A72AE4016785F0D745044068C6 /* UXMFormPageView.swift */; }; + 2C915C11653444D64CB2024747D91609 /* UXMThumbnailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70C3AE2202AFAC854F879DDBD06E8CE5 /* UXMThumbnailViewController.swift */; }; + 30164774051607BF2FB6139F59933426 /* UXMSinglePageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C59B2E20AA0381F05C7C5864BB2CAFD /* UXMSinglePageCell.swift */; }; + 3141244A06410F9A6B5AE310097F94CD /* UXMToggleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAF3822D400E9763E4108BDC45C9AF7F /* UXMToggleButton.swift */; }; + 3CDF6810A1E458C0AA95F219EA050C57 /* UXMPageScrubber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27545BFEDACB21C6B2CE0B1478D10021 /* UXMPageScrubber.swift */; }; + 4196F308202CE2EF255AC08D1740C894 /* UXMPageTileLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DFC25E9894854FCCEEB5EE34ACE7F17 /* UXMPageTileLayer.swift */; }; + 42F74805B02C7BAE9EF70F7D93A4816D /* UXMPathAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 116C66862581124F1FF813C4D6DF83DA /* UXMPathAnnotation.swift */; }; + 5D10A4A5E77765384B25F1B39F41B599 /* UXMPDFViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 485D802F0468A120C898CFDAF4BAC736 /* UXMPDFViewController.swift */; }; + 5E64377EE5189C0A23F0C4640516FA82 /* UXMPageScrubberThumb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74BAD51EE893E2622F893C3C45CD9727 /* UXMPageScrubberThumb.swift */; }; + 5F7C8D178C29981F94574AB42A2D480C /* UXMDocumentLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A96E61F5149566B121A108A04D4BFF8 /* UXMDocumentLink.swift */; }; + 635ECB5150050C2F81A0D5E040856904 /* UXMPageScrubberTrackControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87F132520EC2774655DE5C74455881A /* UXMPageScrubberTrackControl.swift */; }; + 63EE5E2AE8EBE54E64AFDDBBF0022358 /* UXMSnapshotCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA24B61928C02C96A8994E71F14BF391 /* UXMSnapshotCache.swift */; }; + 643D6AFD0473E8FDFA7281A93C85987B /* Pods-UXMPDFKit_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C8356BA466A8C36BD5B3F24AF6F18CF /* Pods-UXMPDFKit_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 689DE6099E74ECE5EE6F63D90ED9E49B /* UXMPageContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A2EB90F81636C9412556E372330BE19 /* UXMPageContent.swift */; }; + 7032A15BD0F431104B465F3E8B32A762 /* UXMAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A072B262F250DC33E58F330C76A6EB1 /* UXMAnnotation.swift */; }; + 720F99DDA7114D95666513296A174F73 /* UXMPDFKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 27ACB82136688CFC5591D625711E55A0 /* UXMPDFKit-dummy.m */; }; + 741FD8C01E4A5C0DE62FCE1B78C82AA3 /* UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C824D3E4F019CAE35CB2A53885A0277 /* UIImage.swift */; }; + 752764F72298503E00663889 /* UXMChoiceFormField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752764F62298503E00663889 /* UXMChoiceFormField.swift */; }; + 7564193A229B63540062029B /* _UXMFormButtonField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75641939229B63540062029B /* _UXMFormButtonField.swift */; }; + 7751CD8A528E5248DD7FD8D0F3549CEA /* UXMThumbnailViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51815E9F7C21AD3F26AC430C51499D48 /* UXMThumbnailViewCell.swift */; }; + 7818660B09EA88BAB13E92BA65AD66E4 /* UXMRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6FA5CF513688292FB82207DC84F0CD6 /* UXMRenderer.swift */; }; + 86CB3268BFBC7317381943A5B9A817B6 /* UXMActionURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA84BC7F93EC8EBC23A281C4F96ED3A3 /* UXMActionURL.swift */; }; + 884C2B097A0F160E4CB193335A964E83 /* UXMThumbnailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E1BD467C18253F94E76138592573D79 /* UXMThumbnailView.swift */; }; + 94F4CD5A63778A601E7C1B921C545A2F /* UXMPageContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F7E79AA1610E74F4E0D96E7BEB2EC74 /* UXMPageContentView.swift */; }; + 9B132DE0BE2498EE5A92F11B851F7FDB /* CGPoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5E61067A5744200E3B01F096DA8A20 /* CGPoint.swift */; }; + 9B37F62EB9515513815A8475CBB8EFEF /* Pods-UXMPDFKit_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 68304DA41B0554D507A712F3AF1D64FE /* Pods-UXMPDFKit_Example-dummy.m */; }; + A042EEDE6967B7DB24E37C98E676117E /* UXMFormField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 118993A16DED1B3EF9839AD8E31C8ECC /* UXMFormField.swift */; }; + A163036888818D8CFB4AD59A12F89F11 /* UXMFormSignatureField.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE8249B812A5EE62F6B946573DC51BCA /* UXMFormSignatureField.swift */; }; + A3D5227796A49ABAABC94EF10DDA9915 /* UIScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1F962D37B9679310A0AA257E7520EA9 /* UIScreen.swift */; }; + A77CC9A312EB7DD1B9EAC26198A115D3 /* UXMSinglePageViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA7CD76FB2BB8F6447566F5FEC93E0CE /* UXMSinglePageViewer.swift */; }; + AA1C8629323D9E6075CB6C5D17ACC588 /* UXMDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FF5E526C9B0388E4ECB9D70406A46B1 /* UXMDictionary.swift */; }; + AD07C9708CD21C7566DC52C565828A1E /* UXMTextParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14C266FC2EAD496C9FE4B3E2FAA95AF7 /* UXMTextParser.swift */; }; + B0C89AF46C175B180EB2E3A68020C6CA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A16F4CFC63FAC439D7A04994F579A03 /* Foundation.framework */; }; + B89620160D64BBE73E43DC14FD594B78 /* CGRect.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD15A3295C964BC497218C99FFC45E6E /* CGRect.swift */; }; + BE4FF9560D49AD759DB908761BD78E64 /* UXMSignAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4B9EEB5E48BEEF2965BF0D7ECF84004 /* UXMSignAnnotation.swift */; }; + C55C65C41A7E3E532BFA105B0804D6D3 /* UXMPDFKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 73015568BD9C35CDB6B53C9733D91087 /* UXMPDFKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C662EAA6F0678F2EDAAA019785223AAD /* UXMFormButtonField.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3CB7E88EF35B9809D0E95AEDE0E49BD /* UXMFormButtonField.swift */; }; + C666FC37FA235CF4840751EE99B3A6C3 /* UXMPDFKit.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 258062D802CC9966192960524F8776B8 /* UXMPDFKit.bundle */; }; + C803127457D43D5F18FBADDF53457F56 /* UXMFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5AD68BE796217E65B58FCDA27A72913 /* UXMFormViewController.swift */; }; + CF415F2FD1C52DE13BD331BDDDA17E7C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 28252A47AB79EEAFE8D11E8512669322 /* Images.xcassets */; }; + D20DDDDB43C239386BEF2C6765C97524 /* UXMActionGoTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78DAD1A3227E5660016A538546AFA10D /* UXMActionGoTo.swift */; }; + D5521978021295C51A677985735A9C29 /* UXMArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A39153E51A212F32125A463827C621 /* UXMArray.swift */; }; + DA3D442F70B1A6491DE5D3D3FCFB1D08 /* UXMAnnotationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B6AD2EAC20014F624E1DC6C6E0FDE59 /* UXMAnnotationController.swift */; }; + DA851FBDAAE56CBC88657AA589641DA7 /* UXMFormTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183A7AD20AE707F4AB2CA962BB18F6ED /* UXMFormTextField.swift */; }; + DFD9F120E8E99CB17C24D155C37C62DB /* UXMAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6E0BFA469C86BFCE9351F5446E6F857 /* UXMAction.swift */; }; + E516A3D17DFA41273562C723E033F543 /* UIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54541AFFD5458026F47BAC394B4C4035 /* UIViewController.swift */; }; + E84E2B682D14AA607D161F0C72350840 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A16F4CFC63FAC439D7A04994F579A03 /* Foundation.framework */; }; + E8851001996BD61E43A4329FF9437C65 /* UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F341992E9ADC1298EEC1DDD2AE6B4306 /* UIColor.swift */; }; + F6993C2D24B427728776755607F943DA /* UXMBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DC90269E85835634780EFF2602B222D /* UXMBarButton.swift */; }; + FC5322C1A19943A40ABA3B813118B0B9 /* UXMObjectParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67CD0163D513FCBDE08B50DC6A5B1C3B /* UXMObjectParser.swift */; }; + FFB73BCA00663BA5950173C67C35EA63 /* UXMTextAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D07B1B217F947BBBEC1A26E4F2579517 /* UXMTextAnnotation.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1E1EE300810192D509C81620ADAD5F2A /* PBXContainerItemProxy */ = { + 06667BCB1DC8C8D41BFA11008A7DA084 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 806AC9F20336348B8F1E6138E470491D; + remoteGlobalIDString = E8632CCE4967F0851A7FBFA63B9B34FB; remoteInfo = UXMPDFKit; }; - E19880B3709917456341F3D38E3AAC50 /* PBXContainerItemProxy */ = { + 885BB99F1FE6B34F171B718323558E3A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 9C492BC63E45F8B8D516D6487251ECE8; + remoteGlobalIDString = D7C5EB5DB8CAEA6BC1D3A2B232DFBF1D; remoteInfo = "UXMPDFKit-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 = ""; }; + 069C62A72AE4016785F0D745044068C6 /* UXMFormPageView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormPageView.swift; sourceTree = ""; }; + 0BF0E8D8C6D2D3846822F2C2F32AB20C /* UXMAnnotationStore.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMAnnotationStore.swift; sourceTree = ""; }; + 0F42AC241370546235DFD82AB5BB63C4 /* Pods-UXMPDFKit_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-UXMPDFKit_Example-acknowledgements.plist"; sourceTree = ""; }; + 109DBFCEE935631959D13B1CA71C1047 /* UXMPDFKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = UXMPDFKit.modulemap; sourceTree = ""; }; + 116C66862581124F1FF813C4D6DF83DA /* UXMPathAnnotation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPathAnnotation.swift; sourceTree = ""; }; + 118993A16DED1B3EF9839AD8E31C8ECC /* UXMFormField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormField.swift; sourceTree = ""; }; + 14C266FC2EAD496C9FE4B3E2FAA95AF7 /* UXMTextParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMTextParser.swift; sourceTree = ""; }; + 183A7AD20AE707F4AB2CA962BB18F6ED /* UXMFormTextField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormTextField.swift; sourceTree = ""; }; + 1C824D3E4F019CAE35CB2A53885A0277 /* UIImage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UIImage.swift; sourceTree = ""; }; + 20D8649056F4D7C05EC8ABDB094F2732 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; + 23A8611284D21ACC1BD481BB5C9AF9A3 /* Pods-UXMPDFKit_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-UXMPDFKit_Example.modulemap"; sourceTree = ""; }; + 23BB80F9C96E1587A610604408D7B5FA /* Pods-UXMPDFKit_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-UXMPDFKit_Example-resources.sh"; sourceTree = ""; }; + 258062D802CC9966192960524F8776B8 /* UXMPDFKit.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UXMPDFKit.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; + 27545BFEDACB21C6B2CE0B1478D10021 /* UXMPageScrubber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageScrubber.swift; sourceTree = ""; }; + 27ACB82136688CFC5591D625711E55A0 /* UXMPDFKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UXMPDFKit-dummy.m"; sourceTree = ""; }; + 28252A47AB79EEAFE8D11E8512669322 /* Images.xcassets */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Pod/Assets/Images.xcassets; sourceTree = ""; }; + 2DFC25E9894854FCCEEB5EE34ACE7F17 /* UXMPageTileLayer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageTileLayer.swift; sourceTree = ""; }; + 36B56BCE64FA401C7A97FE7FA069A6C4 /* Pods-UXMPDFKit_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-UXMPDFKit_Example.release.xcconfig"; sourceTree = ""; }; + 3D125B5781FF16A5E7D88293D9A4FCD6 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 4235186082E46EC22F742656E1CBBB4A /* UXMPDFKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UXMPDFKit-prefix.pch"; sourceTree = ""; }; + 485D802F0468A120C898CFDAF4BAC736 /* UXMPDFViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPDFViewController.swift; sourceTree = ""; }; + 4B632CE0979E34E84DD43118DF67C77C /* ResourceBundle-UXMPDFKit-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-UXMPDFKit-Info.plist"; sourceTree = ""; }; + 51815E9F7C21AD3F26AC430C51499D48 /* UXMThumbnailViewCell.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMThumbnailViewCell.swift; sourceTree = ""; }; + 53C0940F551B91917F01E757358B9504 /* Pods-UXMPDFKit_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-UXMPDFKit_Example-frameworks.sh"; sourceTree = ""; }; + 54541AFFD5458026F47BAC394B4C4035 /* UIViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UIViewController.swift; sourceTree = ""; }; + 5A16F4CFC63FAC439D7A04994F579A03 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 5B38CC7D280010C92C92D234A514FD90 /* UXMPDFDocument.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPDFDocument.swift; sourceTree = ""; }; + 5E1BD467C18253F94E76138592573D79 /* UXMThumbnailView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMThumbnailView.swift; sourceTree = ""; }; + 67CD0163D513FCBDE08B50DC6A5B1C3B /* UXMObjectParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMObjectParser.swift; sourceTree = ""; }; + 68304DA41B0554D507A712F3AF1D64FE /* Pods-UXMPDFKit_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-UXMPDFKit_Example-dummy.m"; sourceTree = ""; }; + 6C59B2E20AA0381F05C7C5864BB2CAFD /* UXMSinglePageCell.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMSinglePageCell.swift; sourceTree = ""; }; + 6FBCB643D5357FD8C8504802F4ADE38D /* UXMPDFKit.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; path = UXMPDFKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 70C3AE2202AFAC854F879DDBD06E8CE5 /* UXMThumbnailViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMThumbnailViewController.swift; sourceTree = ""; }; + 73015568BD9C35CDB6B53C9733D91087 /* UXMPDFKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UXMPDFKit-umbrella.h"; sourceTree = ""; }; + 74BAD51EE893E2622F893C3C45CD9727 /* UXMPageScrubberThumb.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageScrubberThumb.swift; sourceTree = ""; }; + 752764F62298503E00663889 /* UXMChoiceFormField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UXMChoiceFormField.swift; sourceTree = ""; }; + 75641939229B63540062029B /* _UXMFormButtonField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = _UXMFormButtonField.swift; sourceTree = ""; }; + 78DAD1A3227E5660016A538546AFA10D /* UXMActionGoTo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMActionGoTo.swift; sourceTree = ""; }; + 7C8356BA466A8C36BD5B3F24AF6F18CF /* Pods-UXMPDFKit_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-UXMPDFKit_Example-umbrella.h"; sourceTree = ""; }; + 89E6CA2F27E8278F2CA1A97CB229F0DD /* Pods_UXMPDFKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_UXMPDFKit_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8A072B262F250DC33E58F330C76A6EB1 /* UXMAnnotation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMAnnotation.swift; sourceTree = ""; }; + 8A2EB90F81636C9412556E372330BE19 /* UXMPageContent.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageContent.swift; sourceTree = ""; }; + 8A96E61F5149566B121A108A04D4BFF8 /* UXMDocumentLink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMDocumentLink.swift; sourceTree = ""; }; + 8B6AD2EAC20014F624E1DC6C6E0FDE59 /* UXMAnnotationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMAnnotationController.swift; sourceTree = ""; }; + 8CB61B1F362B0955CE711BC28DD8A039 /* Pods-UXMPDFKit_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-UXMPDFKit_Example-acknowledgements.markdown"; sourceTree = ""; }; + 8DC90269E85835634780EFF2602B222D /* UXMBarButton.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMBarButton.swift; sourceTree = ""; }; + 8F7E79AA1610E74F4E0D96E7BEB2EC74 /* UXMPageContentView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageContentView.swift; sourceTree = ""; }; + 90D900B436BC24DE19DDDD0D89EA9E92 /* CGPDFDocument.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CGPDFDocument.swift; 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 = ""; }; + 9FF5E526C9B0388E4ECB9D70406A46B1 /* UXMDictionary.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMDictionary.swift; sourceTree = ""; }; + A3A3ADEEDA29EFEF6E2C1BB18B2E5AF7 /* ResizeableView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ResizeableView.swift; sourceTree = ""; }; + A6E0BFA469C86BFCE9351F5446E6F857 /* UXMAction.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMAction.swift; sourceTree = ""; }; + A87F132520EC2774655DE5C74455881A /* UXMPageScrubberTrackControl.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMPageScrubberTrackControl.swift; sourceTree = ""; }; + AA24B61928C02C96A8994E71F14BF391 /* UXMSnapshotCache.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMSnapshotCache.swift; sourceTree = ""; }; + AA7CD76FB2BB8F6447566F5FEC93E0CE /* UXMSinglePageViewer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMSinglePageViewer.swift; sourceTree = ""; }; + AA84BC7F93EC8EBC23A281C4F96ED3A3 /* UXMActionURL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMActionURL.swift; sourceTree = ""; }; + AAF3822D400E9763E4108BDC45C9AF7F /* UXMToggleButton.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMToggleButton.swift; sourceTree = ""; }; + AE5E61067A5744200E3B01F096DA8A20 /* CGPoint.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CGPoint.swift; sourceTree = ""; }; + B38DCC9DA7E5DAA0472B91AE5EF008B3 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BE8249B812A5EE62F6B946573DC51BCA /* UXMFormSignatureField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormSignatureField.swift; sourceTree = ""; }; + BE8D4B5610212D7AC6111026EC48A617 /* UXMPDFKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = UXMPDFKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C3CB7E88EF35B9809D0E95AEDE0E49BD /* UXMFormButtonField.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormButtonField.swift; sourceTree = ""; }; + C5AD68BE796217E65B58FCDA27A72913 /* UXMFormViewController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMFormViewController.swift; sourceTree = ""; }; + CD15A3295C964BC497218C99FFC45E6E /* CGRect.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CGRect.swift; sourceTree = ""; }; + D07B1B217F947BBBEC1A26E4F2579517 /* UXMTextAnnotation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMTextAnnotation.swift; sourceTree = ""; }; + D4B9EEB5E48BEEF2965BF0D7ECF84004 /* UXMSignAnnotation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMSignAnnotation.swift; sourceTree = ""; }; + D4CE5A8DDFD124701E04BA13F35D3535 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D7A9AB6A112A4FF5911ECD2983E0FFA4 /* Pods-UXMPDFKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-UXMPDFKit_Example.debug.xcconfig"; sourceTree = ""; }; + DA8417704B584274DDC235C2A12C2BDF /* UIView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UIView.swift; sourceTree = ""; }; + E440277A2E57FFB79D56B9CD68477512 /* UXMPDFKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = UXMPDFKit.xcconfig; sourceTree = ""; }; + F1F962D37B9679310A0AA257E7520EA9 /* UIScreen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UIScreen.swift; sourceTree = ""; }; + F341992E9ADC1298EEC1DDD2AE6B4306 /* UIColor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UIColor.swift; sourceTree = ""; }; + F6FA5CF513688292FB82207DC84F0CD6 /* UXMRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMRenderer.swift; sourceTree = ""; }; + F7A39153E51A212F32125A463827C621 /* UXMArray.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UXMArray.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 1D9AB7D6437976EB5224E6F01B05E400 /* Frameworks */ = { + 2002FB083C9ED8C624097CFB7E881C0A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - AEBCD8510D17EB5BB1AF97C56DA3E0A4 /* Foundation.framework in Frameworks */, + E84E2B682D14AA607D161F0C72350840 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 4CF0BB5202264D8B9A75BF1A4424E192 /* Frameworks */ = { + 33842366F2ED26D64C6F6A80B40AF62C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + B0C89AF46C175B180EB2E3A68020C6CA /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 849C03B3857198A4F0552B45D927C18B /* Frameworks */ = { + 3708A687379FFA1C0C1CC2FC5CEAFA0C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A541F16F605856534EE1CB630D115E97 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 00138C775C9CCC4143EBE26A0F9D141F /* UXMPDFKit */ = { + 213325BEBADEF66DFE76B37153BAF700 /* Form */ = { isa = PBXGroup; children = ( - A083585FF5599659E2041632E7C5F5C4 /* Pod */, - 979A0E9CA81EA780D9E508F7D7F685F3 /* Resources */, - 08E11616A3BF33064960AD15033FFA4E /* Support Files */, - ); - name = UXMPDFKit; - path = ../..; + F7A39153E51A212F32125A463827C621 /* UXMArray.swift */, + 9FF5E526C9B0388E4ECB9D70406A46B1 /* UXMDictionary.swift */, + C3CB7E88EF35B9809D0E95AEDE0E49BD /* UXMFormButtonField.swift */, + 75641939229B63540062029B /* _UXMFormButtonField.swift */, + 118993A16DED1B3EF9839AD8E31C8ECC /* UXMFormField.swift */, + 069C62A72AE4016785F0D745044068C6 /* UXMFormPageView.swift */, + BE8249B812A5EE62F6B946573DC51BCA /* UXMFormSignatureField.swift */, + 183A7AD20AE707F4AB2CA962BB18F6ED /* UXMFormTextField.swift */, + C5AD68BE796217E65B58FCDA27A72913 /* UXMFormViewController.swift */, + 67CD0163D513FCBDE08B50DC6A5B1C3B /* UXMObjectParser.swift */, + AAF3822D400E9763E4108BDC45C9AF7F /* UXMToggleButton.swift */, + 752764F62298503E00663889 /* UXMChoiceFormField.swift */, + ); + name = Form; + path = Pod/Classes/Form; sourceTree = ""; }; - 08E11616A3BF33064960AD15033FFA4E /* Support Files */ = { + 546BB7A2873A587864100A030E28B105 /* Targets Support Files */ = { 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 */, + B349126BECA899CAED105F787653301B /* Pods-UXMPDFKit_Example */, ); - name = "Support Files"; - path = "Example/Pods/Target Support Files/UXMPDFKit"; + name = "Targets Support Files"; sourceTree = ""; }; - 0D5534176FDA413966A2FA057AB7673C /* Annotations */ = { + 5E0D919E635D23B70123790B8308F8EF /* iOS */ = { isa = PBXGroup; children = ( - 46276AA25C0911175B06F6F426E499D5 /* PDFAnnotation.swift */, - 9731359E2EA43A65C0297BACA691EFDC /* PDFAnnotationController.swift */, - B68ECDBCA8C7CBFC7A4C746BEAA00756 /* PDFAnnotationStore.swift */, - B9875B88D900C485C9301E8616F19BC5 /* PDFPathAnnotation.swift */, - 36255D8C8E8839365B8EB3FF153756B5 /* PDFTextAnnotation.swift */, + 5A16F4CFC63FAC439D7A04994F579A03 /* Foundation.framework */, ); - path = Annotations; + name = iOS; sourceTree = ""; }; - 0F2EF4198B8CF05B867C8F5A18697809 /* Extensions */ = { + 5EFE35176A4DF223438FD191B150D1E4 /* Model */ = { isa = PBXGroup; children = ( - 0EF790A1D01AB3417430203D9D7EFB14 /* UIImage.swift */, - 612E003D1E424A7200C42D3E /* CGPoint.swift */, - 612E00401E424EBF00C42D3E /* CGRect.swift */, - 38629AEF1DDA548700DF2B43 /* UIColor.swift */, - 610688711E3A4F9900A85AF0 /* UIViewController.swift */, + A6E0BFA469C86BFCE9351F5446E6F857 /* UXMAction.swift */, + 78DAD1A3227E5660016A538546AFA10D /* UXMActionGoTo.swift */, + AA84BC7F93EC8EBC23A281C4F96ED3A3 /* UXMActionURL.swift */, ); - path = Extensions; + name = Model; + path = Pod/Classes/Model; sourceTree = ""; }; - 2267295D4FF13F19ED68658643D87819 /* Form */ = { + 6547F26D31E53BBB9687F574491184D4 /* 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; + AE5E61067A5744200E3B01F096DA8A20 /* CGPoint.swift */, + CD15A3295C964BC497218C99FFC45E6E /* CGRect.swift */, + F341992E9ADC1298EEC1DDD2AE6B4306 /* UIColor.swift */, + 1C824D3E4F019CAE35CB2A53885A0277 /* UIImage.swift */, + F1F962D37B9679310A0AA257E7520EA9 /* UIScreen.swift */, + DA8417704B584274DDC235C2A12C2BDF /* UIView.swift */, + 54541AFFD5458026F47BAC394B4C4035 /* UIViewController.swift */, + ); + name = Extensions; + path = Pod/Classes/Extensions; sourceTree = ""; }; - 318E3AFCB1B7A601FCFD36A1F1E2D215 /* Development Pods */ = { + 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( - 00138C775C9CCC4143EBE26A0F9D141F /* UXMPDFKit */, + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, + BD84A33DEF3AED1F12CEEF1C6E115A82 /* Development Pods */, + BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, + D05E5CCFB2D7FC42B823B6906408BAD1 /* Products */, + 546BB7A2873A587864100A030E28B105 /* Targets Support Files */, ); - name = "Development Pods"; sourceTree = ""; }; - 324D8889BBF1842A8967F51028F0D554 /* Pod */ = { + 968DF14CB15F40D130FF1739E0371FF0 /* Pod */ = { isa = PBXGroup; children = ( - AC09AA8151ECC4D8DF379AC7A4DE44F3 /* Assets */, + 20D8649056F4D7C05EC8ABDB094F2732 /* LICENSE */, + 3D125B5781FF16A5E7D88293D9A4FCD6 /* README.md */, + 6FBCB643D5357FD8C8504802F4ADE38D /* UXMPDFKit.podspec */, ); - path = Pod; + name = Pod; sourceTree = ""; }; - 459AC960074E2604A104023B48ECFF7C /* Renderer */ = { + 9B55C9193CE7A6000843F00C72CE4904 /* Annotations */ = { 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; + 8A072B262F250DC33E58F330C76A6EB1 /* UXMAnnotation.swift */, + 8B6AD2EAC20014F624E1DC6C6E0FDE59 /* UXMAnnotationController.swift */, + 0BF0E8D8C6D2D3846822F2C2F32AB20C /* UXMAnnotationStore.swift */, + 116C66862581124F1FF813C4D6DF83DA /* UXMPathAnnotation.swift */, + D4B9EEB5E48BEEF2965BF0D7ECF84004 /* UXMSignAnnotation.swift */, + D07B1B217F947BBBEC1A26E4F2579517 /* UXMTextAnnotation.swift */, + ); + name = Annotations; + path = Pod/Classes/Annotations; sourceTree = ""; }; - 546BB7A2873A587864100A030E28B105 /* Targets Support Files */ = { + 9BAE64AAEF587967CD03780A3AB6964E /* UXMPDFKit */ = { isa = PBXGroup; children = ( - 5B7D162BC35F470E2CAC1257E8A5946E /* Pods-UXMPDFKit_Example */, + 9B55C9193CE7A6000843F00C72CE4904 /* Annotations */, + 6547F26D31E53BBB9687F574491184D4 /* Extensions */, + 213325BEBADEF66DFE76B37153BAF700 /* Form */, + 5EFE35176A4DF223438FD191B150D1E4 /* Model */, + 968DF14CB15F40D130FF1739E0371FF0 /* Pod */, + F7C7AF9601A24AC6556C4CA9D375100A /* Renderer */, + B00DA5A08F9DB944262DBF7AD85E3B3E /* Resources */, + BCEB153A2572F6043BA8F548BC628F5E /* Support Files */, + F6FD8F1B6996A9F6F0C5B1A649214AC1 /* TextParser */, + BFB46AEC665804AD057AEE5DFB6516AC /* View */, ); - name = "Targets Support Files"; + name = UXMPDFKit; + path = ../..; sourceTree = ""; }; - 5A90FE0DFE2EBD8FE99BC387BEBFF1BC /* Products */ = { + B00DA5A08F9DB944262DBF7AD85E3B3E /* Resources */ = { isa = PBXGroup; children = ( - 0E25E22600004B87F1FD6DE65F353057 /* Pods_UXMPDFKit_Example.framework */, - 36816B3ABA7674FDDFE94F22C8EC3FAB /* UXMPDFKit.bundle */, - EC338060A25E46404C16949C136E122D /* UXMPDFKit.framework */, + 28252A47AB79EEAFE8D11E8512669322 /* Images.xcassets */, ); - name = Products; + name = Resources; sourceTree = ""; }; - 5B7D162BC35F470E2CAC1257E8A5946E /* Pods-UXMPDFKit_Example */ = { + B349126BECA899CAED105F787653301B /* Pods-UXMPDFKit_Example */ = { 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 */, + B38DCC9DA7E5DAA0472B91AE5EF008B3 /* Info.plist */, + 23A8611284D21ACC1BD481BB5C9AF9A3 /* Pods-UXMPDFKit_Example.modulemap */, + 8CB61B1F362B0955CE711BC28DD8A039 /* Pods-UXMPDFKit_Example-acknowledgements.markdown */, + 0F42AC241370546235DFD82AB5BB63C4 /* Pods-UXMPDFKit_Example-acknowledgements.plist */, + 68304DA41B0554D507A712F3AF1D64FE /* Pods-UXMPDFKit_Example-dummy.m */, + 53C0940F551B91917F01E757358B9504 /* Pods-UXMPDFKit_Example-frameworks.sh */, + 23BB80F9C96E1587A610604408D7B5FA /* Pods-UXMPDFKit_Example-resources.sh */, + 7C8356BA466A8C36BD5B3F24AF6F18CF /* Pods-UXMPDFKit_Example-umbrella.h */, + D7A9AB6A112A4FF5911ECD2983E0FFA4 /* Pods-UXMPDFKit_Example.debug.xcconfig */, + 36B56BCE64FA401C7A97FE7FA069A6C4 /* Pods-UXMPDFKit_Example.release.xcconfig */, ); name = "Pods-UXMPDFKit_Example"; path = "Target Support Files/Pods-UXMPDFKit_Example"; sourceTree = ""; }; - 61C3A26F1EC3C0DF00807C4B /* View */ = { - isa = PBXGroup; - children = ( - BC1A9EB3AA234A93FFED5E5EC31C26C0 /* PDFBarButton.swift */, - 61C3A26D1EC2859A00807C4B /* ResizeableView.swift */, - ); - path = View; - sourceTree = ""; - }; - 61D72DBF1DDB7BEF003CE472 /* TextParser */ = { - isa = PBXGroup; - children = ( - 61D72DC01DDB7C15003CE472 /* PDFTextParser.swift */, - ); - path = TextParser; - sourceTree = ""; - }; - 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */ = { - isa = PBXGroup; - children = ( - CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */, - ); - name = iOS; - sourceTree = ""; - }; - 7DB346D0F39D3F0E887471402A8071AB = { + BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { isa = PBXGroup; children = ( - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 318E3AFCB1B7A601FCFD36A1F1E2D215 /* Development Pods */, - BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, - 5A90FE0DFE2EBD8FE99BC387BEBFF1BC /* Products */, - 546BB7A2873A587864100A030E28B105 /* Targets Support Files */, + 5E0D919E635D23B70123790B8308F8EF /* iOS */, ); + name = Frameworks; sourceTree = ""; }; - 81336BCA9643382D6508CC16CB35EE81 /* Model */ = { + BCEB153A2572F6043BA8F548BC628F5E /* Support Files */ = { isa = PBXGroup; children = ( - 69FD1010A27EE6442B7768D3B955DBF9 /* PDFAction.swift */, - 61D72DBA1DDB7039003CE472 /* PDFActionGoTo.swift */, - 61D72DBC1DDB705B003CE472 /* PDFActionURL.swift */, + D4CE5A8DDFD124701E04BA13F35D3535 /* Info.plist */, + 4B632CE0979E34E84DD43118DF67C77C /* ResourceBundle-UXMPDFKit-Info.plist */, + 109DBFCEE935631959D13B1CA71C1047 /* UXMPDFKit.modulemap */, + E440277A2E57FFB79D56B9CD68477512 /* UXMPDFKit.xcconfig */, + 27ACB82136688CFC5591D625711E55A0 /* UXMPDFKit-dummy.m */, + 4235186082E46EC22F742656E1CBBB4A /* UXMPDFKit-prefix.pch */, + 73015568BD9C35CDB6B53C9733D91087 /* UXMPDFKit-umbrella.h */, ); - path = Model; + name = "Support Files"; + path = "Example/Pods/Target Support Files/UXMPDFKit"; sourceTree = ""; }; - 979A0E9CA81EA780D9E508F7D7F685F3 /* Resources */ = { + BD84A33DEF3AED1F12CEEF1C6E115A82 /* Development Pods */ = { isa = PBXGroup; children = ( - 324D8889BBF1842A8967F51028F0D554 /* Pod */, + 9BAE64AAEF587967CD03780A3AB6964E /* UXMPDFKit */, ); - name = Resources; + name = "Development Pods"; sourceTree = ""; }; - A083585FF5599659E2041632E7C5F5C4 /* Pod */ = { + BFB46AEC665804AD057AEE5DFB6516AC /* View */ = { isa = PBXGroup; children = ( - D17F081B2041A570628ABBA6B6B55AA2 /* Classes */, + A3A3ADEEDA29EFEF6E2C1BB18B2E5AF7 /* ResizeableView.swift */, + 8DC90269E85835634780EFF2602B222D /* UXMBarButton.swift */, ); - path = Pod; + name = View; + path = Pod/Classes/View; sourceTree = ""; }; - AC09AA8151ECC4D8DF379AC7A4DE44F3 /* Assets */ = { + D05E5CCFB2D7FC42B823B6906408BAD1 /* Products */ = { isa = PBXGroup; children = ( - C22425B0A3F84BE18A46849E29C823A0 /* Images.xcassets */, + 89E6CA2F27E8278F2CA1A97CB229F0DD /* Pods_UXMPDFKit_Example.framework */, + 258062D802CC9966192960524F8776B8 /* UXMPDFKit.bundle */, + BE8D4B5610212D7AC6111026EC48A617 /* UXMPDFKit.framework */, ); - path = Assets; + name = Products; sourceTree = ""; }; - BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { + F6FD8F1B6996A9F6F0C5B1A649214AC1 /* TextParser */ = { isa = PBXGroup; children = ( - 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */, + 14C266FC2EAD496C9FE4B3E2FAA95AF7 /* UXMTextParser.swift */, ); - name = Frameworks; + name = TextParser; + path = Pod/Classes/TextParser; sourceTree = ""; }; - D17F081B2041A570628ABBA6B6B55AA2 /* Classes */ = { + F7C7AF9601A24AC6556C4CA9D375100A /* Renderer */ = { isa = PBXGroup; children = ( - 61C3A26F1EC3C0DF00807C4B /* View */, - 0D5534176FDA413966A2FA057AB7673C /* Annotations */, - 0F2EF4198B8CF05B867C8F5A18697809 /* Extensions */, - 2267295D4FF13F19ED68658643D87819 /* Form */, - 81336BCA9643382D6508CC16CB35EE81 /* Model */, - 459AC960074E2604A104023B48ECFF7C /* Renderer */, - 61D72DBF1DDB7BEF003CE472 /* TextParser */, - ); - path = Classes; + 90D900B436BC24DE19DDDD0D89EA9E92 /* CGPDFDocument.swift */, + 8A96E61F5149566B121A108A04D4BFF8 /* UXMDocumentLink.swift */, + 8A2EB90F81636C9412556E372330BE19 /* UXMPageContent.swift */, + 8F7E79AA1610E74F4E0D96E7BEB2EC74 /* UXMPageContentView.swift */, + 27545BFEDACB21C6B2CE0B1478D10021 /* UXMPageScrubber.swift */, + 74BAD51EE893E2622F893C3C45CD9727 /* UXMPageScrubberThumb.swift */, + A87F132520EC2774655DE5C74455881A /* UXMPageScrubberTrackControl.swift */, + 2DFC25E9894854FCCEEB5EE34ACE7F17 /* UXMPageTileLayer.swift */, + 5B38CC7D280010C92C92D234A514FD90 /* UXMPDFDocument.swift */, + 485D802F0468A120C898CFDAF4BAC736 /* UXMPDFViewController.swift */, + F6FA5CF513688292FB82207DC84F0CD6 /* UXMRenderer.swift */, + 6C59B2E20AA0381F05C7C5864BB2CAFD /* UXMSinglePageCell.swift */, + AA7CD76FB2BB8F6447566F5FEC93E0CE /* UXMSinglePageViewer.swift */, + AA24B61928C02C96A8994E71F14BF391 /* UXMSnapshotCache.swift */, + 5E1BD467C18253F94E76138592573D79 /* UXMThumbnailView.swift */, + 51815E9F7C21AD3F26AC430C51499D48 /* UXMThumbnailViewCell.swift */, + 70C3AE2202AFAC854F879DDBD06E8CE5 /* UXMThumbnailViewController.swift */, + ); + name = Renderer; + path = Pod/Classes/Renderer; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 53C150893EDE3FF26B25F4389C91540E /* Headers */ = { + 8D1D563198EB14C7D274D815A86EFF31 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 4431B8FC918BE6C9C21DCC72EDA860E6 /* Pods-UXMPDFKit_Example-umbrella.h in Headers */, + 643D6AFD0473E8FDFA7281A93C85987B /* Pods-UXMPDFKit_Example-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - E7AD556DFBA75846E3964ECDB643C739 /* Headers */ = { + 8E057DDF71200A50449424125C9DBA49 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - DE4A344370F68EA63CCA245BB42FF44A /* UXMPDFKit-umbrella.h in Headers */, + C55C65C41A7E3E532BFA105B0804D6D3 /* UXMPDFKit-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 806AC9F20336348B8F1E6138E470491D /* UXMPDFKit */ = { + AA6F04976C20E809DFC05CA90D6CE068 /* Pods-UXMPDFKit_Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 5C7D5A2662D2A9AB5E7CE59CD239DB95 /* Build configuration list for PBXNativeTarget "UXMPDFKit" */; + buildConfigurationList = 2205D1C6176FB6839831D2A2E3FC69E6 /* Build configuration list for PBXNativeTarget "Pods-UXMPDFKit_Example" */; buildPhases = ( - 98A56FB3FD3FB5519F98F60AFCE59D1B /* Sources */, - 849C03B3857198A4F0552B45D927C18B /* Frameworks */, - ED93727C0550098E76C04AE96D4B68BE /* Resources */, - E7AD556DFBA75846E3964ECDB643C739 /* Headers */, + 2230C6B750624388A7211FB43E8FFFEE /* Sources */, + 33842366F2ED26D64C6F6A80B40AF62C /* Frameworks */, + 8D1D563198EB14C7D274D815A86EFF31 /* Headers */, ); buildRules = ( ); dependencies = ( - 9BE6807A248AAB746DE7056F757EB31F /* PBXTargetDependency */, + B0C2E00F762F7910120A2AF0965251FA /* PBXTargetDependency */, ); - name = UXMPDFKit; - productName = UXMPDFKit; - productReference = EC338060A25E46404C16949C136E122D /* UXMPDFKit.framework */; + name = "Pods-UXMPDFKit_Example"; + productName = "Pods-UXMPDFKit_Example"; + productReference = 89E6CA2F27E8278F2CA1A97CB229F0DD /* Pods_UXMPDFKit_Example.framework */; productType = "com.apple.product-type.framework"; }; - 9C492BC63E45F8B8D516D6487251ECE8 /* UXMPDFKit-UXMPDFKit */ = { + D7C5EB5DB8CAEA6BC1D3A2B232DFBF1D /* UXMPDFKit-UXMPDFKit */ = { isa = PBXNativeTarget; - buildConfigurationList = 3ACF369ACBEDC0AF392EC3B7BC0E7802 /* Build configuration list for PBXNativeTarget "UXMPDFKit-UXMPDFKit" */; + buildConfigurationList = DA32C4E90D1ABFFCE187BBE1B9441683 /* Build configuration list for PBXNativeTarget "UXMPDFKit-UXMPDFKit" */; buildPhases = ( - 073A74B0A07977AD05C916BD9C12A883 /* Sources */, - 4CF0BB5202264D8B9A75BF1A4424E192 /* Frameworks */, - 03347CCBCE02AC7AC604FD79263C2BAF /* Resources */, + EE77F57A3A7BCF8BDEA1EC088A046BC0 /* Sources */, + 3708A687379FFA1C0C1CC2FC5CEAFA0C /* Frameworks */, + 2475AA8D1FDCD7507DB622938F8B81DB /* Resources */, ); buildRules = ( ); @@ -463,25 +466,26 @@ ); name = "UXMPDFKit-UXMPDFKit"; productName = "UXMPDFKit-UXMPDFKit"; - productReference = 36816B3ABA7674FDDFE94F22C8EC3FAB /* UXMPDFKit.bundle */; + productReference = 258062D802CC9966192960524F8776B8 /* UXMPDFKit.bundle */; productType = "com.apple.product-type.bundle"; }; - D7C77B95095598F2FFA1E9456D29905E /* Pods-UXMPDFKit_Example */ = { + E8632CCE4967F0851A7FBFA63B9B34FB /* UXMPDFKit */ = { isa = PBXNativeTarget; - buildConfigurationList = 525FD211AF92A10F91F03DE95E6719D1 /* Build configuration list for PBXNativeTarget "Pods-UXMPDFKit_Example" */; + buildConfigurationList = 46CE43620308118B089C18AF1B54517A /* Build configuration list for PBXNativeTarget "UXMPDFKit" */; buildPhases = ( - 9369D7C8F41BAF85CC912243F0FC33B6 /* Sources */, - 1D9AB7D6437976EB5224E6F01B05E400 /* Frameworks */, - 53C150893EDE3FF26B25F4389C91540E /* Headers */, + 3FD19058A9145C15A2284673D6D64087 /* Sources */, + 2002FB083C9ED8C624097CFB7E881C0A /* Frameworks */, + C8CEA50E05D73B84A2AA6CF88F856E8E /* Resources */, + 8E057DDF71200A50449424125C9DBA49 /* Headers */, ); buildRules = ( ); dependencies = ( - C3EEE5E9BEFB08C924139EBE6E10FF70 /* PBXTargetDependency */, + A31020DFD626B718DEC96D5B92F23CAE /* PBXTargetDependency */, ); - name = "Pods-UXMPDFKit_Example"; - productName = "Pods-UXMPDFKit_Example"; - productReference = 0E25E22600004B87F1FD6DE65F353057 /* Pods_UXMPDFKit_Example.framework */; + name = UXMPDFKit; + productName = UXMPDFKit; + productReference = BE8D4B5610212D7AC6111026EC48A617 /* UXMPDFKit.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -490,11 +494,11 @@ D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0830; + LastSwiftUpdateCheck = 0930; + LastUpgradeCheck = 1010; TargetAttributes = { - D7C77B95095598F2FFA1E9456D29905E = { - LastSwiftMigration = 0820; + AA6F04976C20E809DFC05CA90D6CE068 = { + LastSwiftMigration = 1020; }; }; }; @@ -503,148 +507,169 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = 5A90FE0DFE2EBD8FE99BC387BEBFF1BC /* Products */; + productRefGroup = D05E5CCFB2D7FC42B823B6906408BAD1 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - D7C77B95095598F2FFA1E9456D29905E /* Pods-UXMPDFKit_Example */, - 806AC9F20336348B8F1E6138E470491D /* UXMPDFKit */, - 9C492BC63E45F8B8D516D6487251ECE8 /* UXMPDFKit-UXMPDFKit */, + AA6F04976C20E809DFC05CA90D6CE068 /* Pods-UXMPDFKit_Example */, + E8632CCE4967F0851A7FBFA63B9B34FB /* UXMPDFKit */, + D7C5EB5DB8CAEA6BC1D3A2B232DFBF1D /* UXMPDFKit-UXMPDFKit */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 03347CCBCE02AC7AC604FD79263C2BAF /* Resources */ = { + 2475AA8D1FDCD7507DB622938F8B81DB /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 4DFC30C056451573A629F3EA2C9378B7 /* Images.xcassets in Resources */, + CF415F2FD1C52DE13BD331BDDDA17E7C /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; - ED93727C0550098E76C04AE96D4B68BE /* Resources */ = { + C8CEA50E05D73B84A2AA6CF88F856E8E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3718081077F2A6A3CB9DB4259C52A9A6 /* UXMPDFKit.bundle in Resources */, + C666FC37FA235CF4840751EE99B3A6C3 /* UXMPDFKit.bundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 073A74B0A07977AD05C916BD9C12A883 /* Sources */ = { + 2230C6B750624388A7211FB43E8FFFEE /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 9B37F62EB9515513815A8475CBB8EFEF /* Pods-UXMPDFKit_Example-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 9369D7C8F41BAF85CC912243F0FC33B6 /* Sources */ = { + 3FD19058A9145C15A2284673D6D64087 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6CBA8437445A566C49E81E0FA15F8B89 /* Pods-UXMPDFKit_Example-dummy.m in Sources */, + 134315F0050BE13DFD4A0BE314796461 /* CGPDFDocument.swift in Sources */, + 9B132DE0BE2498EE5A92F11B851F7FDB /* CGPoint.swift in Sources */, + B89620160D64BBE73E43DC14FD594B78 /* CGRect.swift in Sources */, + 02798A524A7CBCE5DB49DFA47C2C5FC5 /* ResizeableView.swift in Sources */, + E8851001996BD61E43A4329FF9437C65 /* UIColor.swift in Sources */, + 741FD8C01E4A5C0DE62FCE1B78C82AA3 /* UIImage.swift in Sources */, + A3D5227796A49ABAABC94EF10DDA9915 /* UIScreen.swift in Sources */, + 15E9FAC53D7DB518180004CB28D9F1DD /* UIView.swift in Sources */, + E516A3D17DFA41273562C723E033F543 /* UIViewController.swift in Sources */, + DFD9F120E8E99CB17C24D155C37C62DB /* UXMAction.swift in Sources */, + D20DDDDB43C239386BEF2C6765C97524 /* UXMActionGoTo.swift in Sources */, + 86CB3268BFBC7317381943A5B9A817B6 /* UXMActionURL.swift in Sources */, + 7032A15BD0F431104B465F3E8B32A762 /* UXMAnnotation.swift in Sources */, + DA3D442F70B1A6491DE5D3D3FCFB1D08 /* UXMAnnotationController.swift in Sources */, + 252148958FE49945B3AFA89A8869FF24 /* UXMAnnotationStore.swift in Sources */, + D5521978021295C51A677985735A9C29 /* UXMArray.swift in Sources */, + 752764F72298503E00663889 /* UXMChoiceFormField.swift in Sources */, + F6993C2D24B427728776755607F943DA /* UXMBarButton.swift in Sources */, + AA1C8629323D9E6075CB6C5D17ACC588 /* UXMDictionary.swift in Sources */, + 5F7C8D178C29981F94574AB42A2D480C /* UXMDocumentLink.swift in Sources */, + C662EAA6F0678F2EDAAA019785223AAD /* UXMFormButtonField.swift in Sources */, + A042EEDE6967B7DB24E37C98E676117E /* UXMFormField.swift in Sources */, + 272E41C214AA2DFADFC0827E794C11C0 /* UXMFormPageView.swift in Sources */, + A163036888818D8CFB4AD59A12F89F11 /* UXMFormSignatureField.swift in Sources */, + DA851FBDAAE56CBC88657AA589641DA7 /* UXMFormTextField.swift in Sources */, + C803127457D43D5F18FBADDF53457F56 /* UXMFormViewController.swift in Sources */, + FC5322C1A19943A40ABA3B813118B0B9 /* UXMObjectParser.swift in Sources */, + 689DE6099E74ECE5EE6F63D90ED9E49B /* UXMPageContent.swift in Sources */, + 94F4CD5A63778A601E7C1B921C545A2F /* UXMPageContentView.swift in Sources */, + 3CDF6810A1E458C0AA95F219EA050C57 /* UXMPageScrubber.swift in Sources */, + 5E64377EE5189C0A23F0C4640516FA82 /* UXMPageScrubberThumb.swift in Sources */, + 635ECB5150050C2F81A0D5E040856904 /* UXMPageScrubberTrackControl.swift in Sources */, + 4196F308202CE2EF255AC08D1740C894 /* UXMPageTileLayer.swift in Sources */, + 42F74805B02C7BAE9EF70F7D93A4816D /* UXMPathAnnotation.swift in Sources */, + 0DD0A11B57E07D48A968CED6149F7056 /* UXMPDFDocument.swift in Sources */, + 720F99DDA7114D95666513296A174F73 /* UXMPDFKit-dummy.m in Sources */, + 7564193A229B63540062029B /* _UXMFormButtonField.swift in Sources */, + 5D10A4A5E77765384B25F1B39F41B599 /* UXMPDFViewController.swift in Sources */, + 7818660B09EA88BAB13E92BA65AD66E4 /* UXMRenderer.swift in Sources */, + BE4FF9560D49AD759DB908761BD78E64 /* UXMSignAnnotation.swift in Sources */, + 30164774051607BF2FB6139F59933426 /* UXMSinglePageCell.swift in Sources */, + A77CC9A312EB7DD1B9EAC26198A115D3 /* UXMSinglePageViewer.swift in Sources */, + 63EE5E2AE8EBE54E64AFDDBBF0022358 /* UXMSnapshotCache.swift in Sources */, + FFB73BCA00663BA5950173C67C35EA63 /* UXMTextAnnotation.swift in Sources */, + AD07C9708CD21C7566DC52C565828A1E /* UXMTextParser.swift in Sources */, + 884C2B097A0F160E4CB193335A964E83 /* UXMThumbnailView.swift in Sources */, + 7751CD8A528E5248DD7FD8D0F3549CEA /* UXMThumbnailViewCell.swift in Sources */, + 2C915C11653444D64CB2024747D91609 /* UXMThumbnailViewController.swift in Sources */, + 3141244A06410F9A6B5AE310097F94CD /* UXMToggleButton.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 98A56FB3FD3FB5519F98F60AFCE59D1B /* Sources */ = { + EE77F57A3A7BCF8BDEA1EC088A046BC0 /* 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 */ = { + A31020DFD626B718DEC96D5B92F23CAE /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "UXMPDFKit-UXMPDFKit"; - target = 9C492BC63E45F8B8D516D6487251ECE8 /* UXMPDFKit-UXMPDFKit */; - targetProxy = E19880B3709917456341F3D38E3AAC50 /* PBXContainerItemProxy */; + target = D7C5EB5DB8CAEA6BC1D3A2B232DFBF1D /* UXMPDFKit-UXMPDFKit */; + targetProxy = 885BB99F1FE6B34F171B718323558E3A /* PBXContainerItemProxy */; }; - C3EEE5E9BEFB08C924139EBE6E10FF70 /* PBXTargetDependency */ = { + B0C2E00F762F7910120A2AF0965251FA /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = UXMPDFKit; - target = 806AC9F20336348B8F1E6138E470491D /* UXMPDFKit */; - targetProxy = 1E1EE300810192D509C81620ADAD5F2A /* PBXContainerItemProxy */; + target = E8632CCE4967F0851A7FBFA63B9B34FB /* UXMPDFKit */; + targetProxy = 06667BCB1DC8C8D41BFA11008A7DA084 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 16FD4E82C3422F35D6BECF3CA34D7D33 /* Debug */ = { + 6B2EC55505FB9CFD19AE5BD3586AEB3E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A4813EE89CCCB14693E9B61A6CD6117F /* UXMPDFKit.xcconfig */; + baseConfigurationReference = E440277A2E57FFB79D56B9CD68477512 /* 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"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/UXMPDFKit/UXMPDFKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/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"; + PRODUCT_MODULE_NAME = UXMPDFKit; PRODUCT_NAME = UXMPDFKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; - WRAPPER_EXTENSION = bundle; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - 4292339A0A86E71445EE70994681FDEB /* Release */ = { + 6E29F0BB66C71EAD49ACD217E5AAB616 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A4813EE89CCCB14693E9B61A6CD6117F /* UXMPDFKit.xcconfig */; + baseConfigurationReference = E440277A2E57FFB79D56B9CD68477512 /* 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"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; PRODUCT_NAME = UXMPDFKit; @@ -653,278 +678,293 @@ TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = bundle; }; - name = Release; + name = Debug; }; - 79C5EF50AA494113B2C3B5F8DC79D20C /* Release */ = { + 7E22F40B2662911899114F26613ACAD4 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A4813EE89CCCB14693E9B61A6CD6117F /* UXMPDFKit.xcconfig */; + baseConfigurationReference = E440277A2E57FFB79D56B9CD68477512 /* UXMPDFKit.xcconfig */; buildSettings = { - "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"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/UXMPDFKit"; + INFOPLIST_FILE = "Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-Info.plist"; 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_NAME = UXMPDFKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; + WRAPPER_EXTENSION = bundle; }; name = Release; }; - 9175E73BFC95BA3C68150FC02E443C40 /* Debug */ = { + 9423B6F51870CC39DA32ACD3C743D830 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A4813EE89CCCB14693E9B61A6CD6117F /* UXMPDFKit.xcconfig */; + baseConfigurationReference = E440277A2E57FFB79D56B9CD68477512 /* 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; 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"; 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 = YES; + PRODUCT_MODULE_NAME = UXMPDFKit; PRODUCT_NAME = UXMPDFKit; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; - A50DC6C4213258C6A36D31EB3282422B /* Release */ = { + 9B9D45A1FA553066CCF4A9AA06C14141 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = CF95F142877C93B0BAB858F7187F7D1C /* Pods-UXMPDFKit_Example.release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + 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; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; + 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; + CODE_SIGNING_ALLOWED = NO; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-UXMPDFKit_Example/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + 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.1; - 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; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_VERSION = 4.2; + SYMROOT = "${SRCROOT}/../build"; }; name = Release; }; - AD24A8B772A3AB80F338EF6B452909A0 /* Release */ = { + A2E4C2C6CAC978F5245C3D94FA8499F5 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = E440277A2E57FFB79D56B9CD68477512 /* UXMPDFKit.xcconfig */; 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_ALLOWED = NO; CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + 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_RELEASE=1", + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=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/; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; STRIP_INSTALLED_PRODUCT = NO; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 4.2; SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; }; - name = Release; + name = Debug; }; - BDEC3DA845473F8FD47C9EE623A1CC11 /* Debug */ = { + D1F8A91A36171F80C3CAFE576B8E9447 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 98269C964ED3DBB303CBAA1006CEE6AC /* Pods-UXMPDFKit_Example.debug.xcconfig */; + baseConfigurationReference = 36B56BCE64FA401C7A97FE7FA069A6C4 /* Pods-UXMPDFKit_Example.release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 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"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.1; 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; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - F15098F4E21DD883A1445CB810C455E8 /* Debug */ = { + E016BACC44DA89B5042A97E0B3A912C6 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = D7A9AB6A112A4FF5911ECD2983E0FFA4 /* Pods-UXMPDFKit_Example.debug.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 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; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-UXMPDFKit_Example/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.1; - ONLY_ACTIVE_ARCH = YES; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; + 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"; + 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_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; }; name = Debug; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + 2205D1C6176FB6839831D2A2E3FC69E6 /* Build configuration list for PBXNativeTarget "Pods-UXMPDFKit_Example" */ = { isa = XCConfigurationList; buildConfigurations = ( - F15098F4E21DD883A1445CB810C455E8 /* Debug */, - AD24A8B772A3AB80F338EF6B452909A0 /* Release */, + E016BACC44DA89B5042A97E0B3A912C6 /* Debug */, + D1F8A91A36171F80C3CAFE576B8E9447 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 3ACF369ACBEDC0AF392EC3B7BC0E7802 /* Build configuration list for PBXNativeTarget "UXMPDFKit-UXMPDFKit" */ = { + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - 16FD4E82C3422F35D6BECF3CA34D7D33 /* Debug */, - 4292339A0A86E71445EE70994681FDEB /* Release */, + A2E4C2C6CAC978F5245C3D94FA8499F5 /* Debug */, + 9B9D45A1FA553066CCF4A9AA06C14141 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 525FD211AF92A10F91F03DE95E6719D1 /* Build configuration list for PBXNativeTarget "Pods-UXMPDFKit_Example" */ = { + 46CE43620308118B089C18AF1B54517A /* Build configuration list for PBXNativeTarget "UXMPDFKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - BDEC3DA845473F8FD47C9EE623A1CC11 /* Debug */, - A50DC6C4213258C6A36D31EB3282422B /* Release */, + 9423B6F51870CC39DA32ACD3C743D830 /* Debug */, + 6B2EC55505FB9CFD19AE5BD3586AEB3E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 5C7D5A2662D2A9AB5E7CE59CD239DB95 /* Build configuration list for PBXNativeTarget "UXMPDFKit" */ = { + DA32C4E90D1ABFFCE187BBE1B9441683 /* Build configuration list for PBXNativeTarget "UXMPDFKit-UXMPDFKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 9175E73BFC95BA3C68150FC02E443C40 /* Debug */, - 79C5EF50AA494113B2C3B5F8DC79D20C /* Release */, + 6E29F0BB66C71EAD49ACD217E5AAB616 /* Debug */, + 7E22F40B2662911899114F26613ACAD4 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/Pods/Pods.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/UXMPDFKit.xcodeproj/xcshareddata/xcschemes/UXMPDFKit-Example.xcscheme b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-UXMPDFKit_Example.xcscheme similarity index 55% rename from Example/UXMPDFKit.xcodeproj/xcshareddata/xcschemes/UXMPDFKit-Example.xcscheme rename to Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-UXMPDFKit_Example.xcscheme index 180fa0a..d4db287 100644 --- a/Example/UXMPDFKit.xcodeproj/xcshareddata/xcschemes/UXMPDFKit-Example.xcscheme +++ b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-UXMPDFKit_Example.xcscheme @@ -1,6 +1,6 @@ - - - - + ReferencedContainer = "container:Pods.xcodeproj"> @@ -43,15 +29,6 @@ shouldUseLaunchSchemeArgsEnv = "YES"> - - - - @@ -65,16 +42,15 @@ debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> - + + BlueprintIdentifier = "AA6F04976C20E809DFC05CA90D6CE068" + BuildableName = "Pods_UXMPDFKit_Example.framework" + BlueprintName = "Pods-UXMPDFKit_Example" + ReferencedContainer = "container:Pods.xcodeproj"> - + @@ -84,16 +60,15 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> - + + BlueprintIdentifier = "AA6F04976C20E809DFC05CA90D6CE068" + BuildableName = "Pods_UXMPDFKit_Example.framework" + BlueprintName = "Pods-UXMPDFKit_Example" + ReferencedContainer = "container:Pods.xcodeproj"> - + diff --git a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit-UXMPDFKit.xcscheme b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit-UXMPDFKit.xcscheme new file mode 100644 index 0000000..582a16a --- /dev/null +++ b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit-UXMPDFKit.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme index a2f2807..8bad491 100644 --- a/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme +++ b/Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/UXMPDFKit.xcscheme @@ -1,6 +1,6 @@ @@ -45,7 +45,7 @@ @@ -63,7 +63,7 @@ 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..4f0c83c 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,28 @@ #!/bin/sh set -e +set -u +set -o pipefail + +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 @@ -23,9 +40,9 @@ install_framework() 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")" @@ -54,24 +71,65 @@ 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 + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then # Use the current code_sign_identitiy 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 stripped="$stripped $arch" @@ -80,12 +138,16 @@ strip_invalid_archs() { 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 index a31bb47..6ec08b3 100644 --- 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 index b328b02..46433ed 100644 --- 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 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/UXMPDFKit/UXMPDFKit.framework/Headers" +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) +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.release.xcconfig b/Example/Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.release.xcconfig index b328b02..46433ed 100644 --- 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 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/UXMPDFKit/UXMPDFKit.framework/Headers" +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) +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 index 1c2e79e..7c555cf 100644 --- a/Example/Pods/Target Support Files/UXMPDFKit/Info.plist +++ b/Example/Pods/Target Support Files/UXMPDFKit/Info.plist @@ -2,25 +2,25 @@ - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 0.5.1 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.8.5 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + diff --git a/Example/Pods/Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-Info.plist b/Example/Pods/Target Support Files/UXMPDFKit/ResourceBundle-UXMPDFKit-Info.plist index 0a6e74f..d155756 100644 --- 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/UXMPDFKit-prefix.pch b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit-prefix.pch index aa992a4..beb2a24 100644 --- 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 index 5d16006..868f64b 100644 --- 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.xcconfig b/Example/Pods/Target Support Files/UXMPDFKit/UXMPDFKit.xcconfig index 91e4cd0..1d44b7a 100644 --- 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) +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..bb2fac7 100644 --- a/Example/UXMPDFKit.xcodeproj/project.pbxproj +++ b/Example/UXMPDFKit.xcodeproj/project.pbxproj @@ -15,15 +15,15 @@ 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 */; }; + 752764F9229921EE00663889 /* sample_short.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 752764F8229921EE00663889 /* sample_short.pdf */; }; + 754724EE229BEBAC00C5FECB /* sample_radiocheckbox.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 754724ED229BEBAC00C5FECB /* sample_radiocheckbox.pdf */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 20EBD11EFF06C30A3117928C /* Pods-UXMPDFKit_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UXMPDFKit_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.release.xcconfig"; sourceTree = ""; }; 21803DAC4DC99E3892836720 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; - 2796C7F95FF0FCF4538111B7 /* UXMPDFKit.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = UXMPDFKit.podspec; path = ../UXMPDFKit.podspec; sourceTree = ""; }; + 2796C7F95FF0FCF4538111B7 /* UXMPDFKit.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = UXMPDFKit.podspec; path = ../UXMPDFKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 607FACD01AFB9204008FA782 /* UXMPDFKit_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UXMPDFKit_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -36,8 +36,9 @@ 616B61051CF7395100B743A7 /* sample2.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = sample2.pdf; sourceTree = ""; }; 619D94B81EE7B5FA0009538F /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = ""; }; 61C453CC1E5758B500A7BC7B /* ISSUE_TEMPLATE.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = ISSUE_TEMPLATE.md; sourceTree = ""; }; - 61CBF9401D86EB7F00282554 /* sample3.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = sample3.pdf; sourceTree = ""; }; 61D3B3761CDE9C1600E7C3A6 /* ExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleViewController.swift; sourceTree = ""; }; + 752764F8229921EE00663889 /* sample_short.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = sample_short.pdf; sourceTree = ""; }; + 754724ED229BEBAC00C5FECB /* sample_radiocheckbox.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = sample_radiocheckbox.pdf; sourceTree = ""; }; A9FF669EE8472D82692EADE4 /* Pods-UXMPDFKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UXMPDFKit_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-UXMPDFKit_Example/Pods-UXMPDFKit_Example.debug.xcconfig"; sourceTree = ""; }; E9B04CB08B51CFCD484BF776 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; EDC69374388E5E5596A4A1B1 /* Pods_UXMPDFKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_UXMPDFKit_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -77,9 +78,10 @@ 607FACD21AFB9204008FA782 /* Example for UXMPDFKit */ = { isa = PBXGroup; children = ( + 754724ED229BEBAC00C5FECB /* sample_radiocheckbox.pdf */, 614D2EE21C8C8A9A00A856CD /* sample.pdf */, 616B61051CF7395100B743A7 /* sample2.pdf */, - 61CBF9401D86EB7F00282554 /* sample3.pdf */, + 752764F8229921EE00663889 /* sample_short.pdf */, 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 607FACD71AFB9204008FA782 /* ViewController.swift */, 61D3B3761CDE9C1600E7C3A6 /* ExampleViewController.swift */, @@ -142,7 +144,6 @@ 607FACCD1AFB9204008FA782 /* Frameworks */, 607FACCE1AFB9204008FA782 /* Resources */, 11FEA666DA65959F0F40E4BD /* [CP] Embed Pods Frameworks */, - 19016150C960787A2E91681A /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -160,13 +161,14 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 1010; ORGANIZATIONNAME = CocoaPods; TargetAttributes = { 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - DevelopmentTeam = 9592M4L4J8; - LastSwiftMigration = 0800; + DevelopmentTeam = 92PG6ZR74V; + LastSwiftMigration = ""; + ProvisioningStyle = Automatic; }; }; }; @@ -175,6 +177,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -196,9 +199,10 @@ 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, - 61CBF9411D86EB7F00282554 /* sample3.pdf in Resources */, + 754724EE229BEBAC00C5FECB /* sample_radiocheckbox.pdf in Resources */, 616B61061CF7395100B743A7 /* sample2.pdf in Resources */, 614D2EE31C8C8A9A00A856CD /* sample.pdf in Resources */, + 752764F9229921EE00663889 /* sample_short.pdf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -211,43 +215,34 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/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"; - showEnvVarsInLog = 0; - }; 8FE2420313AAD9BD47D333C2 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; 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 +255,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 +288,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 +332,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 +345,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 +381,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,15 +391,15 @@ isa = XCBuildConfiguration; baseConfigurationReference = A9FF669EE8472D82692EADE4 /* Pods-UXMPDFKit_Example.debug.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 9592M4L4J8; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 92PG6ZR74V; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(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 +411,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.uxmstudio.uxmpdfit; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -408,15 +421,15 @@ isa = XCBuildConfiguration; baseConfigurationReference = 20EBD11EFF06C30A3117928C /* Pods-UXMPDFKit_Example.release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 9592M4L4J8; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 92PG6ZR74V; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(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 +441,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.uxmstudio.uxmpdfit; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; 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..08cf265 100644 --- a/Example/UXMPDFKit/AppDelegate.swift +++ b/Example/UXMPDFKit/AppDelegate.swift @@ -11,14 +11,38 @@ import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { - - let dirPaths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) - print("App Path: \(dirPaths)") - - return true + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { + + let dirPaths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) + print("App Path: \(dirPaths)") + + return true + } + + func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { + if let rootViewController = self.topViewControllerWithRootViewController(rootViewController: window?.rootViewController) { + if (rootViewController.responds(to: Selector("canRotate"))) { + // Unlock landscape view orientations for this view controller + return .landscapeLeft + } + } + + // Only allow portrait (standard behaviour) + return .portrait + } + + private func topViewControllerWithRootViewController(rootViewController: UIViewController!) -> UIViewController? { + if (rootViewController == nil) { return nil } + if (rootViewController.isKind(of: UITabBarController.self)) { + return topViewControllerWithRootViewController(rootViewController: (rootViewController as! UITabBarController).selectedViewController) + } else if (rootViewController.isKind(of: UINavigationController.self)) { + return topViewControllerWithRootViewController(rootViewController: (rootViewController as! UINavigationController).visibleViewController) + } else if (rootViewController.presentedViewController != nil) { + return topViewControllerWithRootViewController(rootViewController: rootViewController.presentedViewController) } + return rootViewController + } } diff --git a/Example/UXMPDFKit/Base.lproj/Main.storyboard b/Example/UXMPDFKit/Base.lproj/Main.storyboard index e077937..6e36159 100644 --- 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 index df4f9ae..bec9bf3 100644 --- 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 index 0dd5a35..144cd6a 100644 --- a/Example/UXMPDFKit/Info.plist +++ b/Example/UXMPDFKit/Info.plist @@ -30,12 +30,11 @@ armv7 + UIRequiresFullScreen + UISupportedInterfaceOrientations UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationPortraitUpsideDown diff --git a/Example/UXMPDFKit/ViewController.swift b/Example/UXMPDFKit/ViewController.swift index f325319..364992d 100644 --- 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/sample2.pdf b/Example/UXMPDFKit/sample2.pdf old mode 100755 new mode 100644 index 6251971..8df319b Binary files a/Example/UXMPDFKit/sample2.pdf and b/Example/UXMPDFKit/sample2.pdf differ diff --git a/Example/UXMPDFKit/sample3.pdf b/Example/UXMPDFKit/sample3.pdf deleted file mode 100644 index c163e16..0000000 Binary files a/Example/UXMPDFKit/sample3.pdf and /dev/null differ diff --git a/Example/UXMPDFKit/sample_short.pdf b/Example/UXMPDFKit/sample_short.pdf new file mode 100644 index 0000000..52800e3 Binary files /dev/null and b/Example/UXMPDFKit/sample_short.pdf differ 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/Annotations/PDFAnnotation.swift b/Pod/Classes/Annotations/UXMAnnotation.swift similarity index 74% rename from Pod/Classes/Annotations/PDFAnnotation.swift rename to Pod/Classes/Annotations/UXMAnnotation.swift index faedbf7..65b7b01 100644 --- 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 68% rename from Pod/Classes/Annotations/PDFAnnotationController.swift rename to Pod/Classes/Annotations/UXMAnnotationController.swift index e0cd2b0..4dcf3a1 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() + var annotations = 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,7 +83,7 @@ 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.annotationDelegate = delegate @@ -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 = (annotations.annotations.count > 0) } //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) @@ -136,22 +137,25 @@ open class PDFAnnotationController: UIViewController { 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 || annotations.annotations.count > 0) } open func finishAnnotation() { annotationType = .none addCurrentAnnotationToStore() + view.isUserInteractionEnabled = false + undoButton.isEnabled = (annotations.annotations.count > 0) } //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 +// 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, @@ -221,9 +231,9 @@ open class PDFAnnotationController: UIViewController { } } - 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,6 +298,7 @@ open class PDFAnnotationController: UIViewController { private func createNewAnnotation() { if let annotationType = self.annotationType { currentAnnotation = annotationType.init() + currentAnnotation?.delegate = self } } @@ -292,13 +311,13 @@ open class PDFAnnotationController: UIViewController { } } -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.annotations.remove(annotation: annotation) + /// VERY DIRTY FIX LATER if let annotationPage = annotation.page, let pageContentView = self.pageContentViewFor(page: annotationPage) { @@ -310,7 +329,7 @@ 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) } diff --git a/Pod/Classes/Annotations/PDFAnnotationStore.swift b/Pod/Classes/Annotations/UXMAnnotationStore.swift similarity index 65% rename from Pod/Classes/Annotations/PDFAnnotationStore.swift rename to Pod/Classes/Annotations/UXMAnnotationStore.swift index c35058b..20af898 100644 --- 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,30 @@ 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) { + 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 +41,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 +54,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 similarity index 90% rename from Pod/Classes/Annotations/PDFPathAnnotation.swift rename to Pod/Classes/Annotations/UXMPathAnnotation.swift index 1e37507..55cddd7 100644 --- 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..db2c396 --- /dev/null +++ b/Pod/Classes/Annotations/UXMSignAnnotation.swift @@ -0,0 +1,195 @@ +// +// 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") + } + + public func encode(with aCoder: NSCoder) { + aCoder.encode(page, forKey: "page") + aCoder.encode(image, forKey: "image") + aCoder.encode(rect, forKey: "rect") + } +} + +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 image = self.image else { return } + // Draw our CGImage in the context of our PDFAnnotation bounds + image.draw(in: self.rect) + + 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") } +} + +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 index 5dded27..de51470 100644 --- 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 index 94b9c25..8a8f2ae 100644 --- 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/UIImage.swift b/Pod/Classes/Extensions/UIImage.swift index 5b84de3..9dacfa9 100644 --- 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 index 1a64e4b..2725064 100644 --- 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/PDFFormField.swift b/Pod/Classes/Form/PDFFormField.swift deleted file mode 100644 index e89a565..0000000 --- a/Pod/Classes/Form/PDFFormField.swift +++ /dev/null @@ -1,215 +0,0 @@ -// -// PDFFormField.swift -// Pods -// -// Created by Chris Anderson on 5/26/16. -// -// - -import UIKit - -protocol PDFFormViewDelegate { - func formFieldValueChanged(_ widget: PDFFormField) - func formFieldEntered(_ widget: PDFFormField) - func formFieldOptionsChanged(_ widget: PDFFormField) -} - -open class PDFFormFieldObject { - var value: AnyObject? - var options: PDFFormViewOptions? - - let dict: PDFDictionary - - init(dict: PDFDictionary) { - self.dict = dict - - guard let type = dict["FT"] as? String else { - return - } - guard let rect = dict.arrayForKey("Rect")?.rect else { - return - } - - let flags: [PDFFormFlag] - if let flagsObj = dict["Ff"] as? NSNumber { - flags = self.determineFlags(UInt(flagsObj)) - } - else { - flags = [] - } - - let export = self.determineExportValue(dict) - let name = dict.stringForKey("T") ?? "" - - options = PDFFormViewOptions( - type: type, - rect: rect, - flags: flags, - name: name, - exportValue: export, - options: [] - ) - } - - func createFormField() -> PDFFormField? { - if let options = self.options { - if options.type == "Btn" { - return self.createButtonField(options) - } - else if options.type == "Tx" { - return self.createTextField(options) - } - else if options.type == "Sig" { - return self.createSignatureField(options) - } - } - return nil - } - - func determineFlags(_ flags: UInt) -> [PDFFormFlag] { - var flagsArr: [PDFFormFlag] = [] - if ((flags & PDFFormFlag.ReadOnly.rawValue) > 0) { - flagsArr.append(PDFFormFlag.ReadOnly) - } - if ((flags & PDFFormFlag.Required.rawValue) > 0) { - flagsArr.append(PDFFormFlag.Required) - } - if ((flags & PDFFormFlag.NoExport.rawValue) > 0) { - flagsArr.append(PDFFormFlag.NoExport) - } - if ((flags & PDFFormFlag.ButtonNoToggleToOff.rawValue) > 0) { - flagsArr.append(PDFFormFlag.ButtonNoToggleToOff) - } - if ((flags & PDFFormFlag.ButtonRadio.rawValue) > 0) { - flagsArr.append(PDFFormFlag.ButtonRadio) - } - if ((flags & PDFFormFlag.ButtonPushButton.rawValue) > 0) { - flagsArr.append(PDFFormFlag.ButtonPushButton) - } - if ((flags & PDFFormFlag.TextFieldMultiline.rawValue) > 0) { - flagsArr.append(PDFFormFlag.TextFieldMultiline) - } - return flagsArr - } - - func determineExportValue(_ dict: PDFDictionary) -> String { - if let apObj = dict["AP"] as? PDFDictionary { - if let nObj = apObj["N"] as? PDFDictionary { - for key in nObj.allKeys() { - if key == "Off" || key == "OFF" { - return key - } - } - } - } - - if let asObj = dict["AS"] as? String { - return asObj - } - 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) - field.delegate = self - if let value = self.value { - field.value = value - } - 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) - field.name = options.name - field.exportValue = options.exportValue - field.delegate = self - if let value = self.value { - field.value = value - } - - return field - } - - func createSignatureField(_ options: PDFFormViewOptions) -> PDFFormField { - let field = PDFFormSignatureField(frame: options.rect) - field.delegate = self - if let value = self.value { - field.value = value - } - return field - } -} - -extension PDFFormFieldObject: PDFFormViewDelegate { - func formFieldValueChanged(_ widget: PDFFormField) { - self.value = widget.value - } - - func formFieldEntered(_ widget: PDFFormField) { } - - func formFieldOptionsChanged(_ widget: PDFFormField) { } -} - -open class PDFFormField: UIView { - var zoomScale: CGFloat = 1.0 - var options: [AnyObject] = [] - var baseFrame: CGRect - var value: AnyObject? { - didSet { - self.didSetValue(value) - } - } - - var delegate: PDFFormViewDelegate? - - override init(frame: CGRect) { - self.baseFrame = frame - super.init(frame: frame) - } - - convenience init(rect: CGRect, value: String) { - self.init(frame: rect) - self.value = value as AnyObject? - } - - required public init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - open func refresh() { - self.setNeedsDisplay() - } - - func didSetValue(_ value: AnyObject?) { } - - func updateForZoomScale(_ scale: CGFloat) { - zoomScale = scale - let screenAndZoomScale = scale * UIScreen.main.scale - applyScale(screenAndZoomScale, toView: self) - applyScale(screenAndZoomScale, toLayer: self.layer) - } - - func applyScale(_ scale: CGFloat, toView view:UIView) { - view.contentScaleFactor = scale - for subview in view.subviews { - applyScale(scale, toView: subview) - } - } - - func applyScale(_ scale: CGFloat, toLayer layer:CALayer) { - layer.contentsScale = scale - - guard let sublayers = layer.sublayers else { - return - } - for sublayer in sublayers { - applyScale(scale, toLayer: sublayer) - } - } - - func renderInContext(_ context: CGContext) { - - } -} diff --git a/Pod/Classes/Form/PDFArray.swift b/Pod/Classes/Form/UXMArray.swift similarity index 88% rename from Pod/Classes/Form/PDFArray.swift rename to Pod/Classes/Form/UXMArray.swift index 25bb87f..250620d 100644 --- 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] = [] @@ -71,6 +71,7 @@ internal class PDFArray: PDFObject { case CGPDFObjectType.array: return arrayAtIndex(index) case CGPDFObjectType.dictionary: return dictionaryAtIndex(index) case CGPDFObjectType.stream: return streamAtIndex(index) + case CGPDFObjectType.null: return nil default: break } @@ -79,18 +80,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 +140,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 +162,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/UXMChoiceFormField.swift b/Pod/Classes/Form/UXMChoiceFormField.swift new file mode 100644 index 0000000..2f4766f --- /dev/null +++ b/Pod/Classes/Form/UXMChoiceFormField.swift @@ -0,0 +1,216 @@ +// +// UXMChoiceFormField.swift +// UXMPDFKit +// +// Created by Brian Mwakima on 24/05/2019. +// + +import UIKit + +class FormDropdownIndicator: UIView { + + override open func draw(_ rect: CGRect) { + guard let context = UIGraphicsGetCurrentContext() else { return } + context.saveGState() + + let margin: CGFloat = rect.size.width/3 + context.setFillColor(UIColor.black.cgColor) + context.move(to: CGPoint(x: margin, y: margin)) + context.addLine(to: CGPoint(x: rect.size.width-margin, y: rect.size.height/2)) + context.addLine(to: CGPoint(x: margin, y: rect.size.height-margin)) + context.addLine(to: CGPoint(x: margin, y: margin)) + context.fillPath() + } +} + +open class UXMChoiceFormField: UXMFormField { + + var _dropDownIndicator: FormDropdownIndicator = FormDropdownIndicator(frame: CGRect.zero) + var _tableView: UITableView = UITableView(frame: CGRect.zero) + var _options: Array = [] + var _selectedIndex: Int = NSNotFound + var _selection: UILabel = UILabel(frame: CGRect.zero) + var _dropped: Bool = false + var _baseFontHeight: CGFloat = 12 + + init(frame: CGRect, options: Array) { + super.init(frame: frame) + self._options = options + backgroundColor = UIColor.pdfBackgroundBlue().withAlphaComponent(0.7) + self.layer.cornerRadius = self.frame.size.height/6; + + self._tableView = UITableView.init(frame: CGRect(x: 0, y: frame.size.height, width: frame.size.width, height: frame.size.height * CGFloat(min(5,_options.count))), style: .plain) + self._tableView.dataSource = self + self._tableView.delegate = self + self._tableView.isOpaque = false + self._tableView.backgroundColor = UIColor.clear + self._tableView.backgroundView = nil + self._tableView.alpha = 0 + self._tableView.layer.cornerRadius = 4 + self._tableView.separatorStyle = .none + self._tableView.separatorColor = .clear + self.clipsToBounds = true + self._baseFontHeight = 10.0 + self._selection = UILabel.init(frame: CGRect(x: 1, y: 0, width: (frame.size.width - frame.size.height), height: frame.size.height)) + self._selection.isOpaque = false + self._selection.adjustsFontSizeToFitWidth = true + self._selection.backgroundColor = .clear + self._selection.textColor = .black + + self.addSubview(_selection) + + self._dropDownIndicator = FormDropdownIndicator.init(frame: CGRect(x: (frame.size.width-frame.size.height*1.5), y: (-frame.size.height*0.25), width: (frame.size.height*1.5), height: frame.size.height*1.5)) + + self._dropDownIndicator.isOpaque = false + self._dropDownIndicator.backgroundColor = .clear + + self.addSubview(_dropDownIndicator) + + let _middleButton: UIButton = UIButton.init(frame: self.bounds) + _middleButton.isOpaque = false + _middleButton.backgroundColor = .clear + _middleButton.addTarget(self, action: #selector(dropdownPressed), for: UIControl.Event.touchUpInside) + + self.addSubview(_middleButton) + + self.addSubview(_tableView) + } + + required public init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + func setValue(value: String?) { + if let value = value { + let ind: Int = self._options.index(of: value)! + self._selectedIndex = ind + self._selection.text = value + } + } + + override func didSetValue(_ value: AnyObject?) { + + if(value != nil) { + let ind: Int = self._options.index(of: value as! String)! + self._selectedIndex = ind + } else { + self._selectedIndex = NSNotFound + } + + if let value = value as? String { + self._selection.text = value + } + } + + func setOptions(opts: Array) { + + if(_options != opts) { + _options = opts + } + + let sf: CGFloat = _selection.frame.size.height + _tableView.frame = CGRect(x: 0, y: sf, width: self.frame.size.width, height: sf * CGFloat(min(5,_options.count))) + } + + override open func refresh() { + super.refresh() + let sf: CGFloat = _selection.frame.size.height + _tableView.frame = CGRect(x: 0, y: sf, width: self.frame.size.width, height: sf * CGFloat(min(5,_options.count))) + _tableView.reloadData() + _tableView.selectRow(at: IndexPath(row: self._selectedIndex, section: 0), animated: false, scrollPosition: .none) + + } + + override func resign() { + if(self._dropped) { + self.dropdownPressed(sender: self._dropDownIndicator) + } + } + + override func renderInContext(_ context: CGContext) { + let text: String = _selection.text ?? "" + let font: UIFont = _selection.font! + + let attributes: [NSAttributedString.Key:AnyObject] = [ + NSAttributedString.Key.font: font, + NSAttributedString.Key.foregroundColor: UIColor.black + ] + text.draw(in: frame, withAttributes:attributes) + } + + @objc func dropdownPressed(sender: Any) { + self.superview?.bringSubviewToFront(self) + if(!self._dropped) { + self.delegate?.formFieldEntered(self) + } + self._dropped = !self._dropped + self._dropDownIndicator.setNeedsDisplay() + + if(self._dropped) { + self.parent?.activeWidgetAnnotationView = self + self._tableView.reloadData() + if(self._selectedIndex < self._options.count) { + _tableView.selectRow(at: IndexPath(row: self._selectedIndex, section: 0), animated: false, scrollPosition: .none) + _tableView.scrollToNearestSelectedRow(at: .middle, animated: false) + + } + + UIView.animate(withDuration: 0.3) { + self.frame = CGRect(x: self.frame.origin.x, y: self.frame.origin.y, width: self.frame.size.width, height: self.frame.size.height*(CGFloat(min(5,self._options.count))+1)) + self._tableView.alpha = 1 + self._dropDownIndicator.transform = CGAffineTransform.init(rotationAngle: CGFloat.pi/2) + } + } else { + self.parent?.activeWidgetAnnotationView = nil + UIView.animate(withDuration: 0.3) { + self.frame = CGRect(x: self.frame.origin.x, y: self.frame.origin.y, width: self.frame.size.width, height: self.frame.size.height/(CGFloat(min(5,self._options.count))+1)) + self._tableView.alpha = 0 + self._dropDownIndicator.transform = CGAffineTransform.init(rotationAngle: 0) + } + } + + self.setNeedsDisplay() + } + +} + +extension UXMChoiceFormField: UITableViewDelegate { + + public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return tableView.bounds.size.height / CGFloat(min(5,_options.count)) + } + + public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + self.setValue(value: _options[indexPath.row]) + delegate?.formFieldValueChanged(self) + } +} + +extension UXMChoiceFormField: UITableViewDataSource { + public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return _options.count + } + + public func numberOfSections(in tableView: UITableView) -> Int { + return 1 + } + + public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell: UITableViewCell = UITableViewCell.init(style: .default, reuseIdentifier: nil) + cell.isOpaque = false + cell.indentationWidth = 0 + cell.backgroundColor = .clear + cell.textLabel?.backgroundColor = .clear + cell.textLabel?.isOpaque = false + cell.detailTextLabel?.backgroundColor = .clear + cell.detailTextLabel?.isOpaque = false + cell.textLabel?.font = UIFont.systemFont(ofSize: 12) + cell.textLabel?.adjustsFontSizeToFitWidth = true + cell.textLabel?.text = _options[indexPath.row] + cell.textLabel?.textColor = .black + + return cell + } + + +} diff --git a/Pod/Classes/Form/PDFDictionary.swift b/Pod/Classes/Form/UXMDictionary.swift similarity index 89% rename from Pod/Classes/Form/PDFDictionary.swift rename to Pod/Classes/Form/UXMDictionary.swift index 9e0ceb9..b305afd 100644 --- 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,7 +165,7 @@ 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 } @@ -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 82% rename from Pod/Classes/Form/PDFFormButtonField.swift rename to Pod/Classes/Form/UXMFormButtonField.swift index 82a4d93..d555105 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,11 +18,12 @@ 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 = "" open var exportValue = "" + open var pushButton = false var isSelected: Bool { if let value = self.value as? String { @@ -31,7 +32,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 +61,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 +92,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 +106,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/UXMFormField.swift b/Pod/Classes/Form/UXMFormField.swift new file mode 100644 index 0000000..5f51eb3 --- /dev/null +++ b/Pod/Classes/Form/UXMFormField.swift @@ -0,0 +1,269 @@ +// +// UXMFormField.swift +// Pods +// +// Created by Chris Anderson on 5/26/16. +// +// + +import UIKit + +protocol UXMFormViewDelegate: class { + func formFieldValueChanged(_ widget: UXMFormField) + func formFieldEntered(_ widget: UXMFormField) + func formFieldOptionsChanged(_ widget: UXMFormField) +} + +open class UXMFormFieldObject { + var value: AnyObject? + var options: UXMFormViewOptions? + + let dict: UXMDictionary + + init(dict: UXMDictionary) { + self.dict = dict + + var tempOpts: [String] = [] + + if let opts = dict["Opt"] as? UXMArray { + for opt in opts { + if opt is UXMArray { + tempOpts.append((opt as! UXMArray).array[0] as! String) + } else { + tempOpts.append(opt as! String) + } + } + } + + if let value = dict["V"] { + self.value = value + } + + if let _ = dict["DV"] {} // default Value + + if let _ = dict["TU"] as? String {} // name + + guard let type = dict["FT"] as? String else { + return + } + + guard let rect = dict.arrayForKey("Rect")?.rect else { + return + } + + let flags: [UXMFormFlag] + if let flagsObj = dict["Ff"] as? NSNumber { + flags = self.determineFlags(UInt(truncating: flagsObj)) + } + else { + flags = [] + } + + let export = self.determineExportValue(dict) + let name = dict.stringForKey("T") ?? "" + + options = UXMFormViewOptions( + type: type, + rect: rect, + flags: flags, + name: name, + exportValue: export, + options: tempOpts + ) + } + + func createFormField() -> UXMFormField? { + if let options = self.options { + if options.type == "Btn" { + return self.createButtonField(options) + } + else if options.type == "Tx" { + return self.createTextField(options) + } + else if options.type == "Sig" { + return self.createSignatureField(options) + } + else if options.type == "Ch" { + return self.createDropdownField(options) + } + } + return nil + } + + func determineFlags(_ flags: UInt) -> [UXMFormFlag] { + var flagsArr: [UXMFormFlag] = [] + if ((flags & UXMFormFlag.ReadOnly.rawValue) > 0) { + flagsArr.append(UXMFormFlag.ReadOnly) + } + if ((flags & UXMFormFlag.Required.rawValue) > 0) { + flagsArr.append(UXMFormFlag.Required) + } + if ((flags & UXMFormFlag.NoExport.rawValue) > 0) { + flagsArr.append(UXMFormFlag.NoExport) + } + if ((flags & UXMFormFlag.ButtonNoToggleToOff.rawValue) > 0) { + flagsArr.append(UXMFormFlag.ButtonNoToggleToOff) + } + if ((flags & UXMFormFlag.ButtonRadio.rawValue) > 0) { + flagsArr.append(UXMFormFlag.ButtonRadio) + } + if ((flags & UXMFormFlag.ButtonPushButton.rawValue) > 0) { + flagsArr.append(UXMFormFlag.ButtonPushButton) + } + if ((flags & UXMFormFlag.TextFieldMultiline.rawValue) > 0) { + flagsArr.append(UXMFormFlag.TextFieldMultiline) + } + if ((flags & UXMFormFlag.ChoiceFieldSorted.rawValue) > 0) { + flagsArr.append(UXMFormFlag.ChoiceFieldSorted) + } + if ((flags & UXMFormFlag.ChoiceFieldIsCombo.rawValue) > 0) { + flagsArr.append(UXMFormFlag.ChoiceFieldIsCombo) + } + if ((flags & UXMFormFlag.ChoiceFieldEditable.rawValue) > 0) { + flagsArr.append(UXMFormFlag.ChoiceFieldEditable) + } + return flagsArr + } + + 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 + } + } + } + } + + if let asObj = dict["AS"] as? String { + return asObj + } + return "" + } + + func createDropdownField(_ options: UXMFormViewOptions) -> UXMFormField { + let field = UXMChoiceFormField(frame: options.rect, options: options.options) + field.delegate = self + if let value = self.value { + field.value = value + } + return field + } + + 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 + } + return field + } + + 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.pushButton = options.flags?.contains(where: { $0 == UXMFormFlag.ButtonPushButton }) ?? false + field.noOff = options.flags?.contains(where: { $0 == UXMFormFlag.ButtonNoToggleToOff }) ?? false + field.exportValue = options.exportValue + field.delegate = self + if let value = self.value { + field.value = value + } + + return field + } + + func createSignatureField(_ options: UXMFormViewOptions) -> UXMFormField { + let field = UXMFormSignatureField(frame: options.rect) + field.delegate = self + if let value = self.value { + field.value = value + } + return field + } +} + +extension UXMFormFieldObject: UXMFormViewDelegate { + func formFieldValueChanged(_ widget: UXMFormField) { + self.value = widget.value + } + + func formFieldEntered(_ widget: UXMFormField) { } + + func formFieldOptionsChanged(_ widget: UXMFormField) { } +} + +open class UXMFormField: UIView { + var zoomScale: CGFloat = 1.0 + var options: [AnyObject] = [] + var parent: UXMFormPageView? + var baseFrame: CGRect + var value: AnyObject? { + didSet { + self.didSetValue(value) + } + } + + weak var delegate: UXMFormViewDelegate? + + override init(frame: CGRect) { + self.baseFrame = frame + super.init(frame: frame) + } + + convenience init(rect: CGRect, value: String) { + self.init(frame: rect) + self.value = value as AnyObject? + } + + required public init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + open func refresh() { + self.setNeedsDisplay() + } + + func didSetValue(_ value: AnyObject?) { } + + func updateForZoomScale(_ scale: CGFloat) { + zoomScale = scale + let screenAndZoomScale = scale * UIScreen.main.scale + applyScale(screenAndZoomScale, toView: self) + applyScale(screenAndZoomScale, toLayer: self.layer) + } + + func applyScale(_ scale: CGFloat, toView view: UIView) { + view.contentScaleFactor = scale + for subview in view.subviews { + applyScale(scale, toView: subview) + } + } + + func applyScale(_ scale: CGFloat, toLayer layer: CALayer) { + layer.contentsScale = scale + + guard let sublayers = layer.sublayers else { + return + } + for sublayer in sublayers { + applyScale(scale, toLayer: sublayer) + } + } + + 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 similarity index 50% rename from Pod/Classes/Form/PDFFormPageView.swift rename to Pod/Classes/Form/UXMFormPageView.swift index 9e3b729..85f004e 100644 --- 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]? + 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..74b186f 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 83% rename from Pod/Classes/Form/PDFFormTextField.swift rename to Pod/Classes/Form/UXMFormTextField.swift index bb4040a..9a345d0 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.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 similarity index 73% rename from Pod/Classes/Form/PDFFormViewController.swift rename to Pod/Classes/Form/UXMFormViewController.swift index c236cd1..e439b74 100644 --- 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 similarity index 57% rename from Pod/Classes/Form/PDFObjectParser.swift rename to Pod/Classes/Form/UXMObjectParser.swift index 6a29c22..00d3327 100644 --- 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 similarity index 83% rename from Pod/Classes/Form/PDFToggleButton.swift rename to Pod/Classes/Form/UXMToggleButton.swift index 45a944c..bcdbbd8 100644 --- 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/Form/_UXMFormButtonField.swift b/Pod/Classes/Form/_UXMFormButtonField.swift new file mode 100644 index 0000000..943c925 --- /dev/null +++ b/Pod/Classes/Form/_UXMFormButtonField.swift @@ -0,0 +1,205 @@ +// +// UXMFormButtonField.swift +// Pods +// +// Created by Chris Anderson on 6/1/16. +// +// + +import UIKit + +open class _UXMFormButtonField: UXMFormField { + open var buttonType = ButtonType.radio + open var noOff = false + open var pushButton = false + open var name = "" + open var exportValue = "" + + var _value: AnyObject? + + var isSelected: Bool { + if let value = self.value as? String { + return value == exportValue + } + return false + } + + var _radio = false + + fileprivate var button = UIButton(type: .custom) // UXMToggleButton(frame: CGRect.zero) + fileprivate let inset: CGFloat = 1.0 + + init(frame: CGRect, radio: Bool) { + if radio { + self.buttonType = .radio + } + super.init(frame: frame) + self._radio = radio + setupUI() + } + + required public init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + fileprivate func setupUI() { + isOpaque = false + backgroundColor = UIColor.pdfBackgroundBlue().withAlphaComponent(0.7) + + let minDim = min(frame.size.width,frame.size.height) * 0.85 + let center: CGPoint = CGPoint(x: frame.size.width/2, y: frame.size.height/2) + + button.frame = CGRect( + x: center.x-minDim, + y: center.y-minDim, + width: minDim - inset * 2, + height: minDim * 2) + button.isOpaque = false + if _radio { + button.layer.cornerRadius = button.frame.width / 2 + } + button.backgroundColor = UIColor.clear + addSubview(button) + button.addTarget(self, action: #selector(UXMFormButtonField.buttonPressed), for: .touchUpInside) + isUserInteractionEnabled = false + button.isUserInteractionEnabled = true + button.isExclusiveTouch = true + } + + @objc func buttonPressed() { + value = (button.isSelected ? "" : exportValue) as AnyObject? + button.isSelected = !button.isSelected + delegate?.formFieldValueChanged(self) + } + + open func setButtonInSuperview() { + button.removeFromSuperview() + let frame = self.bounds + let minDim = min(frame.size.width,frame.size.height) * 0.85 + let center: CGPoint = CGPoint(x: frame.size.width/2, y: frame.size.height/2) + button.frame = CGRect(x: center.x-minDim+self.frame.origin.x, y: center.y-minDim+self.frame.origin.y, width: 2*minDim, height: 2*minDim) + self.superview?.insertSubview(button, aboveSubview: self) + } + + override func renderInContext(_ context: CGContext) { + switch buttonType { + case .radio: + break + case .checkbox: + renderCheckbox(in: context) + case .push: + break + } + } + + fileprivate func renderCheckbox(in context: CGContext) { + + UIGraphicsPushContext(context) + context.setAlpha(1.0) + + var frame = button.frame + frame.origin.x += self.frame.origin.x + frame.origin.y += self.frame.origin.y + + 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 + + let title1 = button.title(for: state) + + if let title1 = title1 { + title = title1 as NSString + } + + let paragraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle + paragraphStyle.alignment = NSTextAlignment.center + + let attributes: [NSAttributedString.Key:AnyObject] = [ + NSAttributedString.Key.font: font, + NSAttributedString.Key.foregroundColor: titleColor, + NSAttributedString.Key.paragraphStyle: paragraphStyle + ] + + title.draw(in: frame, withAttributes: attributes) + + UIGraphicsPopContext() + } + + override func didSetValue(_ value: AnyObject?) { + + if (value != nil) { + button.isSelected = value!.isEqual(exportValue) + } else { + button.isSelected = false + } + + setNeedsDisplay() + } + + func drawWithRect(frame: CGRect, context: CGContext, back: Bool, selected: Bool, radio: Bool) { + let minDim = min(frame.size.width,frame.size.height) * 0.85 + let center: CGPoint = CGPoint(x: frame.size.width/2, y: frame.size.height/2) + let rect: CGRect = CGRect(x: center.x/minDim/2, y: center.y-minDim/2, width: minDim, height: minDim) + + if (back) { + context.saveGState() + context.setFillColor(UIColor(red: 0.7, green: 0.85, blue: 1.0, alpha: 0.7).cgColor) + if (!radio) { + let radius = minDim/6 + context.move(to: CGPoint(x: rect.origin.x, y: rect.origin.y + radius)) + context.addLine(to: CGPoint(x: rect.origin.x, y: rect.origin.y + rect.size.height - radius)) + context.addArc(center: CGPoint(x: rect.origin.x + radius, y: rect.origin.y + rect.size.height - radius), radius: radius, startAngle: CGFloat.pi, endAngle: CGFloat.pi/2, clockwise: true) + context.addLine(to: CGPoint(x: rect.origin.x + rect.size.width - radius, y: rect.origin.y + rect.size.height)) + context.addArc(center: CGPoint(x: rect.origin.x + rect.size.width - radius, y: rect.origin.y + rect.size.height - radius), radius: radius, startAngle: CGFloat.pi, endAngle: CGFloat.pi/2, clockwise: true) + context.addLine(to: CGPoint(x: rect.origin.x + rect.size.width, y: rect.origin.y + radius)) + + context.addArc(center: CGPoint(x: rect.origin.x + rect.size.width - radius, y: rect.origin.y + radius), radius: radius, startAngle: 0.0, endAngle: -(CGFloat.pi/2), clockwise: true) + + context.addLine(to: CGPoint(x: rect.origin.x + radius, y: rect.origin.y)) + context.addArc(center: CGPoint(x: rect.origin.x + radius, y: rect.origin.y + radius), radius: radius, startAngle: -(CGFloat.pi/2), endAngle: CGFloat.pi, clockwise: true) + context.fillPath() + + } else { + context.fillEllipse(in: rect) + } + + context.restoreGState() + + } + + if(selected) { + context.saveGState() + let margin = minDim/3 + if (radio) { + context.setFillColor(UIColor.black.cgColor) + context.translateBy(x: rect.origin.x, y: rect.origin.y) + context.addEllipse(in: CGRect(x: margin, y: margin, width: rect.size.width-2*margin, height: rect.size.height-2*margin)) + context.fillPath() + } else { + context.translateBy(x: rect.origin.x, y: rect.origin.y) + context.setLineWidth(rect.size.width/8) + context.setLineCap(.round) + context.setStrokeColor(UIColor.black.cgColor) + context.move(to: CGPoint(x: margin*0.75, y: rect.size.height/2)) + context.addLine(to: CGPoint(x: rect.size.width/2-margin/4, y: rect.size.height-margin)) + context.addLine(to: CGPoint(x: rect.size.width-margin*0.75, y: margin/2)) + context.strokePath() + } + + context.restoreGState() + } + + } + + open override func draw(_ rect: CGRect) { + if(pushButton) { + super.draw(rect) + return + } + + guard let context = UIGraphicsGetCurrentContext() else { return } + drawWithRect(frame: rect, context: context, back: true, selected: button.isSelected, radio: self._radio) + + } +} 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 similarity index 84% rename from Pod/Classes/Model/PDFActionGoTo.swift rename to Pod/Classes/Model/UXMActionGoTo.swift index fdf5816..28c0054 100644 --- 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/PDFActionURL.swift b/Pod/Classes/Model/UXMActionURL.swift similarity index 81% rename from Pod/Classes/Model/PDFActionURL.swift rename to Pod/Classes/Model/UXMActionURL.swift index b23d619..982a740 100644 --- a/Pod/Classes/Model/PDFActionURL.swift +++ b/Pod/Classes/Model/UXMActionURL.swift @@ -1,5 +1,5 @@ // -// PDFActionURL.swift +// UXMActionURL.swift // Pods // // Created by Chris Anderson on 11/15/16. @@ -8,7 +8,7 @@ import Foundation -open class PDFActionURL: PDFAction { +open class UXMActionURL: UXMAction { var url: URL public init(url: URL) { diff --git a/Pod/Classes/Renderer/PDFDocumentLink.swift b/Pod/Classes/Renderer/UXMDocumentLink.swift similarity index 82% rename from Pod/Classes/Renderer/PDFDocumentLink.swift rename to Pod/Classes/Renderer/UXMDocumentLink.swift index 446151e..bfa20e5 100644 --- 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 similarity index 83% rename from Pod/Classes/Renderer/PDFDocument.swift rename to Pod/Classes/Renderer/UXMPDFDocument.swift index 82b9704..ad79daf 100644 --- 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? @@ -35,21 +35,21 @@ open class PDFDocument: NSObject, NSCoding { open var version: Float = 0.0 /// Document annotations - open var annotations: PDFAnnotationStore = PDFAnnotationStore() + open var annotations: 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 { + if let annotations = aDecoder.decodeObject(forKey: "annotations") as? UXMAnnotationStore { self.annotations = annotations } else { - self.annotations = PDFAnnotationStore() + self.annotations = 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 @@ -181,11 +181,6 @@ open class PDFDocument: NSObject, NSCoding { } } - // let majorVersion = UnsafeMutablePointer() - // let minorVersion = UnsafeMutablePointer() - // CGPDFDocumentGetVersion(pdfDocRef, majorVersion, minorVersion) - // self.version = Float("\(majorVersion).\(minorVersion)")! - self.pageCount = pdfDocRef.numberOfPages } @@ -205,38 +200,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) } } diff --git a/Pod/Classes/Renderer/PDFViewController.swift b/Pod/Classes/Renderer/UXMPDFViewController.swift similarity index 58% rename from Pod/Classes/Renderer/PDFViewController.swift rename to Pod/Classes/Renderer/UXMPDFViewController.swift index 9a964a2..2e2ff4e 100644 --- a/Pod/Classes/Renderer/PDFViewController.swift +++ b/Pod/Classes/Renderer/UXMPDFViewController.swift @@ -1,5 +1,5 @@ // -// PDFViewController.swift +// UXMPDFViewController.swift // Pods // // Created by Chris Anderson on 5/7/16. @@ -9,10 +9,19 @@ import UIKit import SafariServices -open class PDFViewController: UIViewController { +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 = true + open var hidesBarsOnTap: Bool = false /// A boolean value that determines if the scrubber bar should be visible open var showsScrubber: Bool = true { @@ -36,11 +45,13 @@ open class PDFViewController: UIViewController { /// 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: UICollectionViewScrollDirection = .horizontal + open var scrollDirection: UICollectionView.ScrollDirection = .horizontal /// A reference to the document that is being displayed - var document: PDFDocument! + var document: UXMPDFDocument! /// A reference to the share button var shareBarButtonItem: UIBarButtonItem? @@ -49,17 +60,31 @@ open class PDFViewController: UIViewController { /// 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.annotations = annotationController.annotations + document.save() + + if self.edited { + self.delegate?.editingDidEnd(document) + } + } + /// A reference to the collection view handling page presentation - var collectionView: PDFSinglePageViewer! + var collectionView: UXMSinglePageViewer! /// 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) + var pageScrubber: UXMPageScrubber! + + 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 @@ -67,11 +92,14 @@ open class PDFViewController: UIViewController { - Parameters: - document: The document to display - - Returns: An instance of the PDFViewController + - Returns: An instance of the UXMPDFViewController */ - public init(document: PDFDocument) { + public init(document: UXMPDFDocument) { super.init(nibName: nil, bundle: nil) self.document = document + self.modalDoneButtonTouched = { [unowned self] in + self.dismiss(animated: true, completion: nil) + } } /** @@ -81,11 +109,11 @@ open class PDFViewController: UIViewController { - document: The document to display - annotationController: The controller to supervise annotations - - Returns: An instance of the PDFViewController + - Returns: An instance of the UXMPDFViewController */ - public convenience init(document: PDFDocument, annotationController: PDFAnnotationController) { + public convenience init(document: UXMPDFDocument, annotationController: UXMAnnotationController) { self.init(document: document) - self.annotationController = PDFAnnotationController(document: self.document, delegate: self) + self.annotationController = UXMAnnotationController(document: self.document, delegate: self) } required public init?(coder aDecoder: NSCoder) { @@ -94,12 +122,12 @@ open class PDFViewController: UIViewController { 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 = 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 = PDFSinglePageViewer(frame: view.bounds, document: document) + collectionView = UXMSinglePageViewer(frame: view.bounds, document: document) collectionView.translatesAutoresizingMaskIntoConstraints = false collectionView.singlePageDelegate = self @@ -129,11 +157,15 @@ open class PDFViewController: UIViewController { collectionView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true collectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true - pageScrubber.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.0).isActive = true - + pageScrubber.heightAnchor.constraint(equalToConstant: 44).isActive = true pageScrubber.sizeToFit() reloadBarButtons() @@ -142,6 +174,8 @@ open class PDFViewController: UIViewController { open override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + NotificationCenter.default.addObserver(self, selector: #selector(orientationDidChange(_:)), name: UIDevice.orientationDidChangeNotification, object: nil) + collectionView.collectionViewLayout.invalidateLayout() } @@ -156,20 +190,23 @@ open class PDFViewController: UIViewController { open override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) + NotificationCenter.default.removeObserver(self) + self.annotationController.finishAnnotation() - self.document.annotations = self.annotationController.annotations - self.document.save() + autoSaveAction(self.document, self.annotationController) } 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) + 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) }) } @@ -189,30 +226,52 @@ open class PDFViewController: UIViewController { navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Done", style: .plain, target: self, - action: #selector(PDFViewController.dismissModal)) + 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 = PDFBarButton( + let shareFormBarButtonItem = UXMBarButton( image: UIImage.bundledImage("share"), toggled: false, target: self, - action: #selector(PDFViewController.shareDocument) + action: #selector(UXMPDFViewController.shareDocument) ) buttons.append(shareFormBarButtonItem) self.shareBarButtonItem = shareFormBarButtonItem } - buttons.append(PDFBarButton( + buttons.append(UXMBarButton( image: UIImage.bundledImage("thumbs"), toggled: false, target: self, - action: #selector(PDFViewController.showThumbnailView) + action: #selector(UXMPDFViewController.showThumbnailView) ) ) @@ -225,11 +284,11 @@ open class PDFViewController: UIViewController { } } - buttons.append(PDFBarButton( + buttons.append(UXMBarButton( image: UIImage.bundledImage("annot"), toggled: showingAnnotations, target: self, - action: #selector(PDFViewController.toggleAnnotations(_:)) + action: #selector(UXMPDFViewController.toggleAnnotations(_:)) ) ) } @@ -237,13 +296,29 @@ open class PDFViewController: UIViewController { return buttons } - func toggleAnnotations(_ button: PDFBarButton) { + @objc func toggleAnnotations(_ button: UXMBarButton) { showingAnnotations = !showingAnnotations reloadBarButtons() } + open func savePdfFile(_ clearEncodedAnnotations: Bool = false) -> URL { + self.annotationController.finishAnnotation() + let renderer = UXMRenderController(document: document, controllers: [ + annotationController, + formController + ]) + + let pdf = renderer.renderOntoPDF() + + if clearEncodedAnnotations { + document.clearEncodedAnnotations() + } + + return pdf + } + func showActivitySheet() { - let renderer = PDFRenderController(document: document, controllers: [ + let renderer = UXMRenderController(document: document, controllers: [ annotationController, formController ]) @@ -261,8 +336,8 @@ open class PDFViewController: UIViewController { present(activityVC, animated: true, completion: nil) } - func showThumbnailView() { - let vc = PDFThumbnailViewController(document: document) + @objc func showThumbnailView() { + let vc = UXMThumbnailViewController(document: document) vc.delegate = self let nvc = UINavigationController(rootViewController: vc) nvc.modalTransitionStyle = .crossDissolve @@ -285,89 +360,84 @@ open class PDFViewController: UIViewController { } } - /// 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() { + @objc func shareDocument() { self.shareBarButtonAction() } - func dismissModal() { - dismiss(animated: true, completion: nil) + @objc func dismissModal() { + modalDoneButtonTouched?() + } + + @objc private func orientationDidChange(_ notification: Notification? = nil) { + self.pageScrubber.refreshScrubber() } } -extension PDFViewController: PDFAnnotationControllerProtocol { +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 } - return pageIndex + 1 + let index = pageIndex + 1 + return index } } - -extension PDFViewController: PDFPageScrubberDelegate { - public func scrubber(_ scrubber: PDFPageScrubber, selectedPage: Int) { +extension UXMPDFViewController: UXMPageScrubberDelegate { + public func scrubber(_ scrubber: UXMPageScrubber, selectedPage: Int) { self.scrollTo(page: selectedPage) } } -extension PDFViewController: PDFSinglePageViewerDelegate { - public func singlePageViewer(_ collectionView: PDFSinglePageViewer, didDisplayPage page: Int) { +extension UXMPDFViewController: UXMSinglePageViewerDelegate { + public func singlePageViewer(_ collectionView: UXMSinglePageViewer, didDisplayPage page: Int) { document.currentPage = page if showsScrubber { pageScrubber.updateScrubber() } } - public func singlePageViewer(_ collectionView: PDFSinglePageViewer, loadedContent content: PDFPageContentView) { -// if allowsFormFilling { -// formController.showForm(content) -// } + public func singlePageViewer(_ collectionView: UXMSinglePageViewer, loadedContent content: UXMPageContentView) { + if allowsFormFilling { + formController.showForm(content) + } if allowsAnnotations { annotationController.showAnnotations(content) } } - public func singlePageViewer(_ collectionView: PDFSinglePageViewer, selected action: PDFAction) { - if let action = action as? PDFActionURL { + public func singlePageViewer(_ collectionView: UXMSinglePageViewer, selected action: UXMAction) { + if let action = action as? UXMActionURL { let svc = SFSafariViewController(url: action.url as URL) present(svc, animated: true, completion: nil) - } else if let action = action as? PDFActionGoTo { + } else if let action = action as? UXMActionGoTo { collectionView.displayPage(action.pageIndex, animated: true) } } - public func singlePageViewer(_ collectionView: PDFSinglePageViewer, selected annotation: PDFAnnotationView) { + public func singlePageViewer(_ collectionView: UXMSinglePageViewer, selected annotation: UXMPDFAnnotationView) { if let annotation = annotation.parent { annotationController.select(annotation: annotation) } } - public func singlePageViewer(_ collectionView: PDFSinglePageViewer, tapped recognizer: UITapGestureRecognizer) { - if hidesBarsOnTap { - handleTap(recognizer) - } + public func singlePageViewer(_ collectionView: UXMSinglePageViewer, tapped recognizer: UITapGestureRecognizer) { annotationController.select(annotation: nil) } public func singlePageViewerDidBeginDragging() { - self.hideBars(state: true) + // Do not hide navbar + self.hideBars(state: false) } public func singlePageViewerDidEndDragging() { } } -extension PDFViewController: PDFThumbnailViewControllerDelegate { - public func thumbnailCollection(_ collection: PDFThumbnailViewController, didSelect page: Int) { +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 similarity index 89% rename from Pod/Classes/Renderer/PDFPageContent.swift rename to Pod/Classes/Renderer/UXMPageContent.swift index 9272dd7..b16a822 100644 --- 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..ea214f0 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 @@ -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 ? 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 82% rename from Pod/Classes/Renderer/PDFPageScrubber.swift rename to Pod/Classes/Renderer/UXMPageScrubber.swift index 46fe01c..bec38a4 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? @@ -70,7 +70,7 @@ open class PDFPageScrubber: UIToolbar { let pageNumberLabel = UILabel(frame: textRect) pageNumberLabel.autoresizesSubviews = false - pageNumberLabel.autoresizingMask = UIViewAutoresizing() + pageNumberLabel.autoresizingMask = UIView.AutoresizingMask() pageNumberLabel.textAlignment = .center pageNumberLabel.backgroundColor = UIColor.clear pageNumberLabel.textColor = UIColor.darkText @@ -81,7 +81,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) @@ -97,12 +97,12 @@ open class PDFPageScrubber: UIToolbar { 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) @@ -133,8 +133,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 +144,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 +180,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) @@ -245,7 +245,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 +253,7 @@ open class PDFPageScrubber: UIToolbar { } } - func enableTimerFired(_ timer: Timer) { + @objc func enableTimerFired(_ timer: Timer) { enableTimer?.invalidate() enableTimer = nil scrubber.isUserInteractionEnabled = true @@ -266,7 +266,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 +279,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,8 +292,11 @@ open class PDFPageScrubber: UIToolbar { return page + 1 } - func scrubberTouchDown(_ scrubber: PDFPageScrubberTrackControl) { - let page = scrubberPageNumber(scrubber) + func refreshScrubber(_ scrubber: UXMPageScrubberTrackControl? = nil) { + let innerScrubber = scrubber != nil ? scrubber : self.scrubber + guard innerScrubber != nil else { return } + + let page = scrubberPageNumber(self.scrubber) if page != document.currentPage { updatePageNumberText(page) @@ -301,10 +304,15 @@ open class PDFPageScrubber: UIToolbar { 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 +327,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 similarity index 90% rename from Pod/Classes/Renderer/PDFPageScrubberThumb.swift rename to Pod/Classes/Renderer/UXMPageScrubberThumb.swift index ec5cd22..6839ad6 100644 --- 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 similarity index 91% rename from Pod/Classes/Renderer/PDFPageScrubberTrackControl.swift rename to Pod/Classes/Renderer/UXMPageScrubberTrackControl.swift index 38840f3..2c4a3eb 100644 --- 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 similarity index 92% rename from Pod/Classes/Renderer/PDFPageTileLayer.swift rename to Pod/Classes/Renderer/UXMPageTileLayer.swift index a1f82c5..f364e4d 100644 --- 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/PDFRenderer.swift b/Pod/Classes/Renderer/UXMRenderer.swift similarity index 87% rename from Pod/Classes/Renderer/PDFRenderer.swift rename to Pod/Classes/Renderer/UXMRenderer.swift index 94b1deb..b866e1e 100644 --- a/Pod/Classes/Renderer/PDFRenderer.swift +++ b/Pod/Classes/Renderer/UXMRenderer.swift @@ -1,5 +1,5 @@ // -// PDFRenderer.swift +// UXMRenderer.swift // Pods // // Created by Chris Anderson on 6/25/16. @@ -8,15 +8,15 @@ import Foundation -public protocol PDFRenderer { +public protocol UXMRenderer { func render(_ page: Int, context:CGContext, bounds: CGRect) } -open class PDFRenderController { - let document: PDFDocument - let renderControllers: [PDFRenderer] +open class UXMRenderController { + let document: UXMPDFDocument + let renderControllers: [UXMRenderer] - public init(document: PDFDocument, controllers: [PDFRenderer]) { + public init(document: UXMPDFDocument, controllers: [UXMRenderer]) { self.document = document self.renderControllers = controllers } diff --git a/Pod/Classes/Renderer/PDFSinglePageCell.swift b/Pod/Classes/Renderer/UXMSinglePageCell.swift similarity index 78% rename from Pod/Classes/Renderer/PDFSinglePageCell.swift rename to Pod/Classes/Renderer/UXMSinglePageCell.swift index 8df0fef..3795b55 100644 --- 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 similarity index 76% rename from Pod/Classes/Renderer/PDFSinglePageViewer.swift rename to Pod/Classes/Renderer/UXMSinglePageViewer.swift index 4676ae1..436ada7 100644 --- 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 @@ -101,10 +101,10 @@ open class PDFSinglePageViewer: UICollectionView { } } - open func getPageContent(_ page: Int) -> PDFPageContentView? { + open func getPageContent(_ page: Int) -> UXMPageContentView? { if document == nil { return nil } let currentPage = indexForPage(page) - if let cell = self.collectionView(self, cellForItemAt: IndexPath(item: currentPage, section: 0)) as? PDFSinglePageCell, + if let cell = self.collectionView(self, cellForItemAt: IndexPath(item: currentPage, section: 0)) as? UXMSinglePageCell, let pageContentView = cell.pageContentView { return pageContentView } @@ -118,7 +118,7 @@ open class PDFSinglePageViewer: UICollectionView { } } -extension PDFSinglePageViewer: UICollectionViewDataSource { +extension UXMSinglePageViewer: UICollectionViewDataSource { public func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } @@ -131,29 +131,29 @@ 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: @@ -163,7 +163,7 @@ extension PDFSinglePageViewer: UICollectionViewDelegateFlowLayout { 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 +183,7 @@ extension PDFSinglePageViewer: UICollectionViewDelegateFlowLayout { } } -extension PDFSinglePageViewer: UIScrollViewDelegate { +extension UXMSinglePageViewer: UIScrollViewDelegate { public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { self.singlePageDelegate?.singlePageViewerDidBeginDragging() @@ -221,7 +221,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 +229,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 75% rename from Pod/Classes/Renderer/PDFSnapshotCache.swift rename to Pod/Classes/Renderer/UXMSnapshotCache.swift index b928243..9bc2a46 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,26 +37,27 @@ 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) - thumbRender.completionBlock = { [unowned self] in - self.rendersInProgress.removeValue(forKey: guid) + let thumbRender = UXMSnapshotRenderer(snapshot: thumbnail) + thumbRender.completionBlock = { [weak self] in + guard let context = self else { return } + context.rendersInProgress.removeValue(forKey: guid) DispatchQueue.main.async { - self.progressBlock?(thumbRender.snapshot) + context.progressBlock?(thumbRender.snapshot) completion?(thumbRender.snapshot) } } @@ -65,15 +66,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 +86,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,7 +98,7 @@ 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? { @@ -139,16 +140,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/PDFThumbnailView.swift b/Pod/Classes/Renderer/UXMThumbnailView.swift similarity index 78% rename from Pod/Classes/Renderer/PDFThumbnailView.swift rename to Pod/Classes/Renderer/UXMThumbnailView.swift index 5c31902..64ab320 100644 --- a/Pod/Classes/Renderer/PDFThumbnailView.swift +++ b/Pod/Classes/Renderer/UXMThumbnailView.swift @@ -1,5 +1,5 @@ // -// PDFThumbnailView.swift +// UXMThumbnailView.swift // Pods // // Created by Chris Anderson on 5/6/16. @@ -8,14 +8,14 @@ import UIKit -internal class PDFThumbnailView: UIView { +internal class UXMThumbnailView: UIView { let imageView: UIImageView override init(frame: CGRect) { imageView = UIImageView() imageView.autoresizesSubviews = false imageView.isUserInteractionEnabled = false - imageView.autoresizingMask = UIViewAutoresizing() + imageView.autoresizingMask = UIView.AutoresizingMask() imageView.translatesAutoresizingMaskIntoConstraints = false imageView.contentMode = .scaleAspectFit @@ -27,7 +27,7 @@ internal class PDFThumbnailView: UIView { autoresizesSubviews = false isUserInteractionEnabled = false contentMode = .redraw - autoresizingMask = UIViewAutoresizing() + autoresizingMask = UIView.AutoresizingMask() backgroundColor = UIColor.clear var constraints = NSLayoutConstraint.constraints(withVisualFormat: "H:[image]|", options: .alignAllLastBaseline, metrics: nil, views: [ "superview": self, "image": imageView ]) @@ -40,14 +40,14 @@ internal class PDFThumbnailView: UIView { fatalError("init(coder:) has not been implemented") } - convenience init(frame: CGRect, document: PDFDocument, page: Int) { + convenience init(frame: CGRect, document: UXMPDFDocument, page: Int) { self.init(frame: frame) showImage(document, page: page) } - func showImage(_ document: PDFDocument, page: Int) { + func showImage(_ document: UXMPDFDocument, page: Int) { imageView.image = nil - PDFQueue.sharedQueue.fetchPage(document, page: page, size: frame.size) { (thumbnail) in + 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 similarity index 79% rename from Pod/Classes/Renderer/PDFThumbnailViewCell.swift rename to Pod/Classes/Renderer/UXMThumbnailViewCell.swift index 3405c1b..dd55900 100644 --- 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 similarity index 84% rename from Pod/Classes/TextParser/PDFTextParser.swift rename to Pod/Classes/TextParser/UXMTextParser.swift index 4fa4002..2cce801 100644 --- 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 index cced88a..9b66806 100644 --- 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 77% rename from Pod/Classes/View/PDFBarButton.swift rename to Pod/Classes/View/UXMBarButton.swift index 9a49462..37fc9db 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) -> ())? + fileprivate var block: ((UXMBarButton) -> ())? override open var tintColor: UIColor? { didSet { @@ -25,7 +25,7 @@ open class PDFBarButton: UIBarButtonItem { toggled: Bool, target: AnyObject? = nil, action: Selector? = nil, - block: ((PDFBarButton) -> ())? = nil + block: ((UXMBarButton) -> ())? = nil ) { self.init() @@ -39,8 +39,8 @@ 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) { @@ -57,19 +57,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 index ad4b7aa..b477fbf 100644 --- 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.0-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 9 or above +- Swift 4.0 ## 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). @@ -90,7 +85,7 @@ Form features implemented: - [x] Text Fields - [x] Checkboxes - [ ] Radio Buttons -- [ ] Choice Boxes +- [x] Choice Boxes Form parsing and handling is taken care of by the PDFFormViewController. It takes a document, and then is passed a PDFPageContentView to render form elements onto. ```swift @@ -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 index 6767ff3..869416f 100644 --- 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.5" 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