├── Images ├── 2017-01-03 10_43_32.gif └── PDF.001.jpeg ├── PDF Reader.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── apple.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── apple.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── PDF Reader.xcscheme │ └── xcschememanagement.plist ├── PDF Reader ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── 20@2x.png │ │ ├── 20@3x.png │ │ ├── 29@2x.png │ │ ├── 29@3x.png │ │ ├── 40@2x.png │ │ ├── 40@3x.png │ │ ├── 60@2x.png │ │ ├── 60@3x.png │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── PDF │ ├── HelpPlanetEarth.pdf │ ├── National Geographic Kids.pdf │ ├── OurSolarSystem2.pdf │ ├── TheNaturalChoice.pdf │ └── ThreatsReport.pdf ├── PDFListViewController.swift ├── PDFPageViewController.swift ├── PDFViewController.swift └── pdf-logo@3x.png └── README.md /Images/2017-01-03 10_43_32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/Images/2017-01-03 10_43_32.gif -------------------------------------------------------------------------------- /Images/PDF.001.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/Images/PDF.001.jpeg -------------------------------------------------------------------------------- /PDF Reader.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 18360B8F1DBA24C500CE2105 /* PDFViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18360B8E1DBA24C500CE2105 /* PDFViewController.swift */; }; 11 | 18360B9A1DBA2ABE00CE2105 /* HelpPlanetEarth.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 18360B951DBA2ABE00CE2105 /* HelpPlanetEarth.pdf */; }; 12 | 18360B9B1DBA2ABE00CE2105 /* National Geographic Kids.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 18360B961DBA2ABE00CE2105 /* National Geographic Kids.pdf */; }; 13 | 18360B9C1DBA2ABE00CE2105 /* OurSolarSystem2.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 18360B971DBA2ABE00CE2105 /* OurSolarSystem2.pdf */; }; 14 | 18360B9D1DBA2ABE00CE2105 /* TheNaturalChoice.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 18360B981DBA2ABE00CE2105 /* TheNaturalChoice.pdf */; }; 15 | 18360B9E1DBA2ABE00CE2105 /* ThreatsReport.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 18360B991DBA2ABE00CE2105 /* ThreatsReport.pdf */; }; 16 | 186159C11D953B3F001E64E3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 186159C01D953B3F001E64E3 /* AppDelegate.swift */; }; 17 | 186159C61D953B3F001E64E3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 186159C41D953B3F001E64E3 /* Main.storyboard */; }; 18 | 186159C81D953B3F001E64E3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 186159C71D953B3F001E64E3 /* Assets.xcassets */; }; 19 | 186159CB1D953B3F001E64E3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 186159C91D953B3F001E64E3 /* LaunchScreen.storyboard */; }; 20 | 186159D51D954693001E64E3 /* PDFPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 186159D41D954693001E64E3 /* PDFPageViewController.swift */; }; 21 | 18B5AF4C1E10EDC300571480 /* pdf-logo@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 18B5AF4B1E10EDC300571480 /* pdf-logo@3x.png */; }; 22 | 18E5690D1DB8F03F00D58314 /* PDFListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18E5690C1DB8F03F00D58314 /* PDFListViewController.swift */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 18360B8E1DBA24C500CE2105 /* PDFViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFViewController.swift; sourceTree = ""; }; 27 | 18360B951DBA2ABE00CE2105 /* HelpPlanetEarth.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = HelpPlanetEarth.pdf; sourceTree = ""; }; 28 | 18360B961DBA2ABE00CE2105 /* National Geographic Kids.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "National Geographic Kids.pdf"; sourceTree = ""; }; 29 | 18360B971DBA2ABE00CE2105 /* OurSolarSystem2.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = OurSolarSystem2.pdf; sourceTree = ""; }; 30 | 18360B981DBA2ABE00CE2105 /* TheNaturalChoice.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = TheNaturalChoice.pdf; sourceTree = ""; }; 31 | 18360B991DBA2ABE00CE2105 /* ThreatsReport.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = ThreatsReport.pdf; sourceTree = ""; }; 32 | 186159BD1D953B3F001E64E3 /* PDF Reader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PDF Reader.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 186159C01D953B3F001E64E3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 34 | 186159C51D953B3F001E64E3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 35 | 186159C71D953B3F001E64E3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 36 | 186159CA1D953B3F001E64E3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 37 | 186159CC1D953B3F001E64E3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 186159D41D954693001E64E3 /* PDFPageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFPageViewController.swift; sourceTree = ""; }; 39 | 18B5AF4B1E10EDC300571480 /* pdf-logo@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pdf-logo@3x.png"; sourceTree = ""; }; 40 | 18E5690C1DB8F03F00D58314 /* PDFListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFListViewController.swift; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 186159BA1D953B3F001E64E3 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | ); 49 | runOnlyForDeploymentPostprocessing = 0; 50 | }; 51 | /* End PBXFrameworksBuildPhase section */ 52 | 53 | /* Begin PBXGroup section */ 54 | 18360B941DBA2ABE00CE2105 /* PDF */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 18360B951DBA2ABE00CE2105 /* HelpPlanetEarth.pdf */, 58 | 18360B961DBA2ABE00CE2105 /* National Geographic Kids.pdf */, 59 | 18360B971DBA2ABE00CE2105 /* OurSolarSystem2.pdf */, 60 | 18360B981DBA2ABE00CE2105 /* TheNaturalChoice.pdf */, 61 | 18360B991DBA2ABE00CE2105 /* ThreatsReport.pdf */, 62 | ); 63 | path = PDF; 64 | sourceTree = ""; 65 | }; 66 | 186159B41D953B3F001E64E3 = { 67 | isa = PBXGroup; 68 | children = ( 69 | 186159BF1D953B3F001E64E3 /* PDF Reader */, 70 | 186159BE1D953B3F001E64E3 /* Products */, 71 | ); 72 | sourceTree = ""; 73 | }; 74 | 186159BE1D953B3F001E64E3 /* Products */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 186159BD1D953B3F001E64E3 /* PDF Reader.app */, 78 | ); 79 | name = Products; 80 | sourceTree = ""; 81 | }; 82 | 186159BF1D953B3F001E64E3 /* PDF Reader */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 18360B941DBA2ABE00CE2105 /* PDF */, 86 | 18B5AF4B1E10EDC300571480 /* pdf-logo@3x.png */, 87 | 186159C01D953B3F001E64E3 /* AppDelegate.swift */, 88 | 186159C41D953B3F001E64E3 /* Main.storyboard */, 89 | 186159C71D953B3F001E64E3 /* Assets.xcassets */, 90 | 186159C91D953B3F001E64E3 /* LaunchScreen.storyboard */, 91 | 186159CC1D953B3F001E64E3 /* Info.plist */, 92 | 18E5690C1DB8F03F00D58314 /* PDFListViewController.swift */, 93 | 18360B8E1DBA24C500CE2105 /* PDFViewController.swift */, 94 | 186159D41D954693001E64E3 /* PDFPageViewController.swift */, 95 | ); 96 | path = "PDF Reader"; 97 | sourceTree = ""; 98 | }; 99 | /* End PBXGroup section */ 100 | 101 | /* Begin PBXNativeTarget section */ 102 | 186159BC1D953B3F001E64E3 /* PDF Reader */ = { 103 | isa = PBXNativeTarget; 104 | buildConfigurationList = 186159CF1D953B3F001E64E3 /* Build configuration list for PBXNativeTarget "PDF Reader" */; 105 | buildPhases = ( 106 | 186159B91D953B3F001E64E3 /* Sources */, 107 | 186159BA1D953B3F001E64E3 /* Frameworks */, 108 | 186159BB1D953B3F001E64E3 /* Resources */, 109 | ); 110 | buildRules = ( 111 | ); 112 | dependencies = ( 113 | ); 114 | name = "PDF Reader"; 115 | productName = "PDF Reader"; 116 | productReference = 186159BD1D953B3F001E64E3 /* PDF Reader.app */; 117 | productType = "com.apple.product-type.application"; 118 | }; 119 | /* End PBXNativeTarget section */ 120 | 121 | /* Begin PBXProject section */ 122 | 186159B51D953B3F001E64E3 /* Project object */ = { 123 | isa = PBXProject; 124 | attributes = { 125 | LastSwiftUpdateCheck = 0800; 126 | LastUpgradeCheck = 0800; 127 | ORGANIZATIONNAME = ILearniOS; 128 | TargetAttributes = { 129 | 186159BC1D953B3F001E64E3 = { 130 | CreatedOnToolsVersion = 8.0; 131 | DevelopmentTeam = 2B38LY5NSL; 132 | ProvisioningStyle = Automatic; 133 | }; 134 | }; 135 | }; 136 | buildConfigurationList = 186159B81D953B3F001E64E3 /* Build configuration list for PBXProject "PDF Reader" */; 137 | compatibilityVersion = "Xcode 3.2"; 138 | developmentRegion = English; 139 | hasScannedForEncodings = 0; 140 | knownRegions = ( 141 | en, 142 | Base, 143 | ); 144 | mainGroup = 186159B41D953B3F001E64E3; 145 | productRefGroup = 186159BE1D953B3F001E64E3 /* Products */; 146 | projectDirPath = ""; 147 | projectRoot = ""; 148 | targets = ( 149 | 186159BC1D953B3F001E64E3 /* PDF Reader */, 150 | ); 151 | }; 152 | /* End PBXProject section */ 153 | 154 | /* Begin PBXResourcesBuildPhase section */ 155 | 186159BB1D953B3F001E64E3 /* Resources */ = { 156 | isa = PBXResourcesBuildPhase; 157 | buildActionMask = 2147483647; 158 | files = ( 159 | 18360B9B1DBA2ABE00CE2105 /* National Geographic Kids.pdf in Resources */, 160 | 18360B9A1DBA2ABE00CE2105 /* HelpPlanetEarth.pdf in Resources */, 161 | 186159CB1D953B3F001E64E3 /* LaunchScreen.storyboard in Resources */, 162 | 18360B9E1DBA2ABE00CE2105 /* ThreatsReport.pdf in Resources */, 163 | 18B5AF4C1E10EDC300571480 /* pdf-logo@3x.png in Resources */, 164 | 186159C81D953B3F001E64E3 /* Assets.xcassets in Resources */, 165 | 186159C61D953B3F001E64E3 /* Main.storyboard in Resources */, 166 | 18360B9C1DBA2ABE00CE2105 /* OurSolarSystem2.pdf in Resources */, 167 | 18360B9D1DBA2ABE00CE2105 /* TheNaturalChoice.pdf in Resources */, 168 | ); 169 | runOnlyForDeploymentPostprocessing = 0; 170 | }; 171 | /* End PBXResourcesBuildPhase section */ 172 | 173 | /* Begin PBXSourcesBuildPhase section */ 174 | 186159B91D953B3F001E64E3 /* Sources */ = { 175 | isa = PBXSourcesBuildPhase; 176 | buildActionMask = 2147483647; 177 | files = ( 178 | 186159D51D954693001E64E3 /* PDFPageViewController.swift in Sources */, 179 | 18E5690D1DB8F03F00D58314 /* PDFListViewController.swift in Sources */, 180 | 186159C11D953B3F001E64E3 /* AppDelegate.swift in Sources */, 181 | 18360B8F1DBA24C500CE2105 /* PDFViewController.swift in Sources */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | /* End PBXSourcesBuildPhase section */ 186 | 187 | /* Begin PBXVariantGroup section */ 188 | 186159C41D953B3F001E64E3 /* Main.storyboard */ = { 189 | isa = PBXVariantGroup; 190 | children = ( 191 | 186159C51D953B3F001E64E3 /* Base */, 192 | ); 193 | name = Main.storyboard; 194 | sourceTree = ""; 195 | }; 196 | 186159C91D953B3F001E64E3 /* LaunchScreen.storyboard */ = { 197 | isa = PBXVariantGroup; 198 | children = ( 199 | 186159CA1D953B3F001E64E3 /* Base */, 200 | ); 201 | name = LaunchScreen.storyboard; 202 | sourceTree = ""; 203 | }; 204 | /* End PBXVariantGroup section */ 205 | 206 | /* Begin XCBuildConfiguration section */ 207 | 186159CD1D953B3F001E64E3 /* Debug */ = { 208 | isa = XCBuildConfiguration; 209 | buildSettings = { 210 | ALWAYS_SEARCH_USER_PATHS = NO; 211 | CLANG_ANALYZER_NONNULL = YES; 212 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 213 | CLANG_CXX_LIBRARY = "libc++"; 214 | CLANG_ENABLE_MODULES = YES; 215 | CLANG_ENABLE_OBJC_ARC = YES; 216 | CLANG_WARN_BOOL_CONVERSION = YES; 217 | CLANG_WARN_CONSTANT_CONVERSION = YES; 218 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 219 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 220 | CLANG_WARN_EMPTY_BODY = YES; 221 | CLANG_WARN_ENUM_CONVERSION = YES; 222 | CLANG_WARN_INFINITE_RECURSION = YES; 223 | CLANG_WARN_INT_CONVERSION = YES; 224 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 225 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 226 | CLANG_WARN_UNREACHABLE_CODE = YES; 227 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 228 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 229 | COPY_PHASE_STRIP = NO; 230 | DEBUG_INFORMATION_FORMAT = dwarf; 231 | ENABLE_STRICT_OBJC_MSGSEND = YES; 232 | ENABLE_TESTABILITY = YES; 233 | GCC_C_LANGUAGE_STANDARD = gnu99; 234 | GCC_DYNAMIC_NO_PIC = NO; 235 | GCC_NO_COMMON_BLOCKS = YES; 236 | GCC_OPTIMIZATION_LEVEL = 0; 237 | GCC_PREPROCESSOR_DEFINITIONS = ( 238 | "DEBUG=1", 239 | "$(inherited)", 240 | ); 241 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 242 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 243 | GCC_WARN_UNDECLARED_SELECTOR = YES; 244 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 245 | GCC_WARN_UNUSED_FUNCTION = YES; 246 | GCC_WARN_UNUSED_VARIABLE = YES; 247 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 248 | MTL_ENABLE_DEBUG_INFO = YES; 249 | ONLY_ACTIVE_ARCH = YES; 250 | SDKROOT = iphoneos; 251 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 252 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 253 | TARGETED_DEVICE_FAMILY = "1,2"; 254 | }; 255 | name = Debug; 256 | }; 257 | 186159CE1D953B3F001E64E3 /* Release */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | ALWAYS_SEARCH_USER_PATHS = NO; 261 | CLANG_ANALYZER_NONNULL = YES; 262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_WARN_BOOL_CONVERSION = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 269 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INFINITE_RECURSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 275 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 276 | CLANG_WARN_UNREACHABLE_CODE = YES; 277 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 278 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 279 | COPY_PHASE_STRIP = NO; 280 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 281 | ENABLE_NS_ASSERTIONS = NO; 282 | ENABLE_STRICT_OBJC_MSGSEND = YES; 283 | GCC_C_LANGUAGE_STANDARD = gnu99; 284 | GCC_NO_COMMON_BLOCKS = YES; 285 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 286 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 287 | GCC_WARN_UNDECLARED_SELECTOR = YES; 288 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 289 | GCC_WARN_UNUSED_FUNCTION = YES; 290 | GCC_WARN_UNUSED_VARIABLE = YES; 291 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 292 | MTL_ENABLE_DEBUG_INFO = NO; 293 | SDKROOT = iphoneos; 294 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 295 | TARGETED_DEVICE_FAMILY = "1,2"; 296 | VALIDATE_PRODUCT = YES; 297 | }; 298 | name = Release; 299 | }; 300 | 186159D01D953B3F001E64E3 /* Debug */ = { 301 | isa = XCBuildConfiguration; 302 | buildSettings = { 303 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 304 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 305 | DEVELOPMENT_TEAM = 2B38LY5NSL; 306 | INFOPLIST_FILE = "PDF Reader/Info.plist"; 307 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 308 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 309 | PRODUCT_BUNDLE_IDENTIFIER = com.appex.www; 310 | PRODUCT_NAME = "$(TARGET_NAME)"; 311 | SWIFT_VERSION = 3.0; 312 | TARGETED_DEVICE_FAMILY = 1; 313 | }; 314 | name = Debug; 315 | }; 316 | 186159D11D953B3F001E64E3 /* Release */ = { 317 | isa = XCBuildConfiguration; 318 | buildSettings = { 319 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 320 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 321 | DEVELOPMENT_TEAM = 2B38LY5NSL; 322 | INFOPLIST_FILE = "PDF Reader/Info.plist"; 323 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 324 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 325 | PRODUCT_BUNDLE_IDENTIFIER = com.appex.www; 326 | PRODUCT_NAME = "$(TARGET_NAME)"; 327 | SWIFT_VERSION = 3.0; 328 | TARGETED_DEVICE_FAMILY = 1; 329 | }; 330 | name = Release; 331 | }; 332 | /* End XCBuildConfiguration section */ 333 | 334 | /* Begin XCConfigurationList section */ 335 | 186159B81D953B3F001E64E3 /* Build configuration list for PBXProject "PDF Reader" */ = { 336 | isa = XCConfigurationList; 337 | buildConfigurations = ( 338 | 186159CD1D953B3F001E64E3 /* Debug */, 339 | 186159CE1D953B3F001E64E3 /* Release */, 340 | ); 341 | defaultConfigurationIsVisible = 0; 342 | defaultConfigurationName = Release; 343 | }; 344 | 186159CF1D953B3F001E64E3 /* Build configuration list for PBXNativeTarget "PDF Reader" */ = { 345 | isa = XCConfigurationList; 346 | buildConfigurations = ( 347 | 186159D01D953B3F001E64E3 /* Debug */, 348 | 186159D11D953B3F001E64E3 /* Release */, 349 | ); 350 | defaultConfigurationIsVisible = 0; 351 | defaultConfigurationName = Release; 352 | }; 353 | /* End XCConfigurationList section */ 354 | }; 355 | rootObject = 186159B51D953B3F001E64E3 /* Project object */; 356 | } 357 | -------------------------------------------------------------------------------- /PDF Reader.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PDF Reader.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PDF Reader.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /PDF Reader.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/PDF Reader.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /PDF Reader.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PDF Reader.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 186159BC1D953B3F001E64E3 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /PDF Reader/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // PDF Reader 4 | // 5 | // Created by Chintan Dave on 23/09/16. 6 | // Copyright © 2016 ILearniOS. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate 13 | { 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool 17 | { 18 | return true 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /PDF Reader/Assets.xcassets/AppIcon.appiconset/20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/Assets.xcassets/AppIcon.appiconset/20@2x.png -------------------------------------------------------------------------------- /PDF Reader/Assets.xcassets/AppIcon.appiconset/20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/Assets.xcassets/AppIcon.appiconset/20@3x.png -------------------------------------------------------------------------------- /PDF Reader/Assets.xcassets/AppIcon.appiconset/29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/Assets.xcassets/AppIcon.appiconset/29@2x.png -------------------------------------------------------------------------------- /PDF Reader/Assets.xcassets/AppIcon.appiconset/29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/Assets.xcassets/AppIcon.appiconset/29@3x.png -------------------------------------------------------------------------------- /PDF Reader/Assets.xcassets/AppIcon.appiconset/40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/Assets.xcassets/AppIcon.appiconset/40@2x.png -------------------------------------------------------------------------------- /PDF Reader/Assets.xcassets/AppIcon.appiconset/40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/Assets.xcassets/AppIcon.appiconset/40@3x.png -------------------------------------------------------------------------------- /PDF Reader/Assets.xcassets/AppIcon.appiconset/60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/Assets.xcassets/AppIcon.appiconset/60@2x.png -------------------------------------------------------------------------------- /PDF Reader/Assets.xcassets/AppIcon.appiconset/60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/Assets.xcassets/AppIcon.appiconset/60@3x.png -------------------------------------------------------------------------------- /PDF Reader/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "29@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "29@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "60@3x.png", 49 | "scale" : "3x" 50 | } 51 | ], 52 | "info" : { 53 | "version" : 1, 54 | "author" : "xcode" 55 | }, 56 | "properties" : { 57 | "pre-rendered" : true 58 | } 59 | } -------------------------------------------------------------------------------- /PDF Reader/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /PDF Reader/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /PDF Reader/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 145 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 170 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 195 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 220 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 245 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 274 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 299 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 324 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | -------------------------------------------------------------------------------- /PDF Reader/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UIStatusBarStyle 32 | UIStatusBarStyleLightContent 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /PDF Reader/PDF/HelpPlanetEarth.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/PDF/HelpPlanetEarth.pdf -------------------------------------------------------------------------------- /PDF Reader/PDF/National Geographic Kids.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/PDF/National Geographic Kids.pdf -------------------------------------------------------------------------------- /PDF Reader/PDF/OurSolarSystem2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/PDF/OurSolarSystem2.pdf -------------------------------------------------------------------------------- /PDF Reader/PDF/TheNaturalChoice.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/PDF/TheNaturalChoice.pdf -------------------------------------------------------------------------------- /PDF Reader/PDF/ThreatsReport.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/PDF/ThreatsReport.pdf -------------------------------------------------------------------------------- /PDF Reader/PDFListViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PDFListViewController.swift 3 | // PDF Reader 4 | // 5 | // Created by Chintan Dave on 20/10/16. 6 | // Copyright © 2016 ILearniOS. All rights reserved. 7 | // 8 | 9 | /* 10 | Resource to render PDFs 11 | https://developer.apple.com/library/content/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html 12 | https://www.cocoanetics.com/2010/06/rendering-pdf-is-easier-than-you-thought/ 13 | https://www.symantec.com/content/dam/symantec/docs/reports/istr-21-2016-en.pdf 14 | https://www.nasa.gov/pdf/363296main_Space_Thrills_Poster_Back.pdf 15 | https://solarsystem.nasa.gov/docs/000-SolarSystemLithosCombined_Rev1_FC.pdf 16 | https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/228842/8082.pdf 17 | http://www.arvindguptatoys.com/arvindgupta/101ways.pdf 18 | http://www.mcafee.com/us/resources/reports/rp-quarterly-threats-mar-2016.pdf 19 | http://www.nationalgeographic.com/mediakit/pdf/ng-kids/NGK_Media_Kit_2016.pdf 20 | http://www.oreilly.com/programming/free/files/2016-european-software-development-salary-survey.pdf 21 | */ 22 | 23 | import UIKit 24 | 25 | class PDFListViewController: UITableViewController 26 | { 27 | var localPDFURLs:[URL] = [] 28 | var remotePDFURLs:[URL] = [] 29 | 30 | override func viewDidLoad() 31 | { 32 | super.viewDidLoad() 33 | 34 | localPDFURLs.append(Bundle.main.url(forResource: "HelpPlanetEarth", withExtension: "pdf")!) 35 | localPDFURLs.append(Bundle.main.url(forResource: "National Geographic Kids", withExtension: "pdf")!) 36 | localPDFURLs.append(Bundle.main.url(forResource: "TheNaturalChoice", withExtension: "pdf")!) 37 | localPDFURLs.append(Bundle.main.url(forResource: "OurSolarSystem2", withExtension: "pdf")!) 38 | localPDFURLs.append(Bundle.main.url(forResource: "ThreatsReport", withExtension: "pdf")!) 39 | 40 | remotePDFURLs.append(URL(string: "https://www.dropbox.com/s/9a109u034fo5khh/InternetSecurityThreatReport.pdf?dl=1")!) 41 | remotePDFURLs.append(URL(string: "https://www.dropbox.com/s/v033oek7w7c3vmd/OurSolarSystem.pdf?dl=1")!) 42 | remotePDFURLs.append(URL(string: "https://www.dropbox.com/s/r337a14qt97m38y/SalarySurvey2016.pdf?dl=1")!) 43 | } 44 | 45 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) 46 | { 47 | let PDFVC:PDFViewController = self.storyboard?.instantiateViewController(withIdentifier: "PDFViewController") as! PDFViewController 48 | 49 | if indexPath.section == 0 50 | { 51 | PDFVC.localPDFURL = localPDFURLs[indexPath.row] 52 | } 53 | else 54 | { 55 | PDFVC.remotePDFURL = remotePDFURLs[indexPath.row] 56 | } 57 | 58 | self.navigationController?.pushViewController(PDFVC, animated: true) 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /PDF Reader/PDFPageViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PDFPageViewController.swift 3 | // PDF Reader 4 | // 5 | // Created by Chintan Dave on 23/09/16. 6 | // Copyright © 2016 ILearniOS. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class PDFPageView: UIView 12 | { 13 | var PDFDocument:CGPDFDocument? = nil 14 | var pageNumber:Int? = nil; 15 | 16 | override func draw(_ rect: CGRect) 17 | { 18 | if PDFDocument != nil 19 | { 20 | let ctx = UIGraphicsGetCurrentContext() 21 | 22 | UIColor.white.set() 23 | 24 | ctx?.fill(rect) 25 | 26 | _ = ctx?.ctm 27 | _ = ctx?.scaleBy(x: 1, y: -1) 28 | _ = ctx?.translateBy(x: 0, y: -rect.size.height) 29 | 30 | let page = PDFDocument?.page(at: pageNumber!) 31 | 32 | let pageRect = page?.getBoxRect(CGPDFBox.cropBox) 33 | 34 | let ratioW = rect.size.width / (pageRect?.size.width)! 35 | let ratioH = rect.size.height / (pageRect?.size.height)! 36 | 37 | let ratio = min(ratioW, ratioH) 38 | 39 | let newWidth = (pageRect?.size.width)! * ratio; 40 | let newHeight = (pageRect?.size.height)! * ratio; 41 | 42 | let offsetX = (rect.size.width - newWidth); 43 | let offsetY = (rect.size.height - newHeight); 44 | 45 | ctx?.scaleBy(x: newWidth / (pageRect?.size.width)!, y: newHeight / (pageRect?.size.height)!) 46 | ctx?.translateBy(x: -(pageRect?.origin.x)! + offsetX, y: -(pageRect?.origin.y)! + offsetY) 47 | 48 | ctx?.drawPDFPage(page!) 49 | } 50 | } 51 | } 52 | 53 | class PDFPageViewController: UIViewController, UIScrollViewDelegate 54 | { 55 | var PDFDocument:CGPDFDocument? = nil 56 | var pageNumber:Int? = nil; 57 | 58 | @IBOutlet weak var page: PDFPageView! 59 | 60 | override func viewDidLoad() 61 | { 62 | super.viewDidLoad() 63 | 64 | self.preparePDFPage() 65 | } 66 | 67 | func preparePDFPage() 68 | { 69 | page.PDFDocument = self.PDFDocument 70 | page.pageNumber = self.pageNumber 71 | 72 | page.setNeedsDisplay() 73 | } 74 | 75 | func viewForZooming(in scrollView: UIScrollView) -> UIView? 76 | { 77 | return page 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /PDF Reader/PDFViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PDFViewController.swift 3 | // PDF Reader 4 | // 5 | // Created by Chintan Dave on 21/10/16. 6 | // Copyright © 2016 ILearniOS. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class PDFViewController: UIViewController, 12 | UIPageViewControllerDataSource, 13 | UIPageViewControllerDelegate, 14 | URLSessionDelegate, 15 | URLSessionDownloadDelegate 16 | { 17 | var localPDFURL:URL? 18 | var remotePDFURL:URL? 19 | var PDFDocument:CGPDFDocument? 20 | 21 | var pageController: UIPageViewController! 22 | var controllers = [UIViewController]() 23 | 24 | @IBOutlet weak var progressView: UIProgressView! 25 | 26 | override func viewDidLoad() 27 | { 28 | super.viewDidLoad() 29 | 30 | if remotePDFURL != nil 31 | { 32 | self.loadRemotePDF() 33 | } 34 | else if localPDFURL != nil 35 | { 36 | self.loadLocalPDF() 37 | } 38 | } 39 | 40 | func loadLocalPDF() 41 | { 42 | progressView.isHidden = true; 43 | 44 | let PDFAsData = NSData(contentsOf: localPDFURL!) 45 | let dataProvider = CGDataProvider(data: PDFAsData!) 46 | 47 | self.PDFDocument = CGPDFDocument(dataProvider!) 48 | 49 | self.navigationItem.title = localPDFURL?.deletingPathExtension().lastPathComponent 50 | 51 | self.preparePageViewController() 52 | } 53 | 54 | func loadRemotePDF() 55 | { 56 | progressView.setProgress(0, animated: false) 57 | 58 | let sessionConfiguration = URLSessionConfiguration.default 59 | let session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue: nil) 60 | let downloadTask = session.downloadTask(with: remotePDFURL!) 61 | 62 | downloadTask.resume() 63 | } 64 | 65 | func preparePageViewController() 66 | { 67 | pageController = self.storyboard?.instantiateViewController(withIdentifier: "PageViewController") as! UIPageViewController 68 | 69 | pageController.dataSource = self 70 | pageController.delegate = self 71 | 72 | self.addChildViewController(pageController) 73 | 74 | pageController.view.frame = CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height) 75 | 76 | self.view.addSubview(pageController.view) 77 | 78 | let pageVC = self.storyboard?.instantiateViewController(withIdentifier: "PDFPageViewController") as! PDFPageViewController 79 | 80 | pageVC.PDFDocument = PDFDocument 81 | pageVC.pageNumber = 1 82 | 83 | pageController.setViewControllers([pageVC], direction: .forward, animated: true, completion: nil) 84 | } 85 | 86 | func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? 87 | { 88 | let pageVC = viewController as! PDFPageViewController 89 | 90 | if pageVC.pageNumber! > 1 91 | { 92 | let previousPageVC = self.storyboard?.instantiateViewController(withIdentifier: "PDFPageViewController") as! PDFPageViewController 93 | 94 | previousPageVC.PDFDocument = PDFDocument 95 | previousPageVC.pageNumber = pageVC.pageNumber! - 1 96 | 97 | return previousPageVC 98 | } 99 | 100 | return nil 101 | } 102 | 103 | func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? 104 | { 105 | let pageVC = viewController as! PDFPageViewController 106 | 107 | let previousPageVC = self.storyboard?.instantiateViewController(withIdentifier: "PDFPageViewController") as! PDFPageViewController 108 | 109 | previousPageVC.PDFDocument = PDFDocument 110 | previousPageVC.pageNumber = pageVC.pageNumber! + 1 111 | 112 | return previousPageVC 113 | } 114 | 115 | func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) 116 | { 117 | self.localPDFURL = location 118 | 119 | self.loadLocalPDF() 120 | } 121 | 122 | func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) 123 | { 124 | let progress = Float(totalBytesWritten) / Float(totalBytesExpectedToWrite) 125 | 126 | DispatchQueue.main.async 127 | { 128 | self.progressView.setProgress(progress, animated: true) 129 | } 130 | } 131 | 132 | func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) 133 | { 134 | dump(error) 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /PDF Reader/pdf-logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeAtLine/PDF-Reader/fb7d18fd01e53f345c02442e9a06da0e251e0f9a/PDF Reader/pdf-logo@3x.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PDF-Reader 2 | 3 | 4 | 5 | 6 | --------------------------------------------------------------------------------