├── PDFViewAndDownload.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Dustin.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Dustin.xcuserdatad │ └── xcschemes │ ├── PDFViewAndDownload.xcscheme │ └── xcschememanagement.plist ├── PDFViewAndDownload.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── Dustin.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── PDFViewAndDownload ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CGContext DrawPDFPage │ ├── 001.pdf │ ├── 002.pdf │ ├── 003.pdf │ ├── BackViewController.h │ ├── BackViewController.m │ ├── CGContextDrawPDFListViewController.h │ ├── CGContextDrawPDFListViewController.m │ ├── CGContextDrawPDFPageController.h │ ├── CGContextDrawPDFPageController.m │ ├── CGContextDrawPDFPageModel.h │ ├── CGContextDrawPDFPageModel.m │ ├── CGContextDrawPDFReaderController.h │ ├── CGContextDrawPDFReaderController.m │ ├── CGContextDrawPDFView.h │ └── CGContextDrawPDFView.m ├── DownloadViewController.h ├── DownloadViewController.m ├── Info.plist ├── Reader │ ├── Graphics │ │ ├── AppIcon-076.png │ │ ├── AppIcon-120.png │ │ ├── AppIcon-152.png │ │ ├── AppIcon-167.png │ │ ├── AppIcon-180.png │ │ ├── Reader-Button-H.png │ │ ├── Reader-Button-H@2x.png │ │ ├── Reader-Button-H@3x.png │ │ ├── Reader-Button-N.png │ │ ├── Reader-Button-N@2x.png │ │ ├── Reader-Button-N@3x.png │ │ ├── Reader-Email.png │ │ ├── Reader-Email@2x.png │ │ ├── Reader-Email@3x.png │ │ ├── Reader-Export.png │ │ ├── Reader-Export@2x.png │ │ ├── Reader-Export@3x.png │ │ ├── Reader-Mark-N.png │ │ ├── Reader-Mark-N@2x.png │ │ ├── Reader-Mark-N@3x.png │ │ ├── Reader-Mark-Y.png │ │ ├── Reader-Mark-Y@2x.png │ │ ├── Reader-Mark-Y@3x.png │ │ ├── Reader-Print.png │ │ ├── Reader-Print@2x.png │ │ ├── Reader-Print@3x.png │ │ ├── Reader-Thumbs.png │ │ ├── Reader-Thumbs@2x.png │ │ └── Reader-Thumbs@3x.png │ └── Sources │ │ ├── CGPDFDocument.h │ │ ├── CGPDFDocument.m │ │ ├── ReaderConstants.h │ │ ├── ReaderConstants.m │ │ ├── ReaderContentPage.h │ │ ├── ReaderContentPage.m │ │ ├── ReaderContentTile.h │ │ ├── ReaderContentTile.m │ │ ├── ReaderContentView.h │ │ ├── ReaderContentView.m │ │ ├── ReaderDocument.h │ │ ├── ReaderDocument.m │ │ ├── ReaderDocumentOutline.h │ │ ├── ReaderDocumentOutline.m │ │ ├── ReaderMainPagebar.h │ │ ├── ReaderMainPagebar.m │ │ ├── ReaderMainToolbar.h │ │ ├── ReaderMainToolbar.m │ │ ├── ReaderThumbCache.h │ │ ├── ReaderThumbCache.m │ │ ├── ReaderThumbFetch.h │ │ ├── ReaderThumbFetch.m │ │ ├── ReaderThumbQueue.h │ │ ├── ReaderThumbQueue.m │ │ ├── ReaderThumbRender.h │ │ ├── ReaderThumbRender.m │ │ ├── ReaderThumbRequest.h │ │ ├── ReaderThumbRequest.m │ │ ├── ReaderThumbView.h │ │ ├── ReaderThumbView.m │ │ ├── ReaderThumbsView.h │ │ ├── ReaderThumbsView.m │ │ ├── ReaderViewController.h │ │ ├── ReaderViewController.m │ │ ├── ThumbsMainToolbar.h │ │ ├── ThumbsMainToolbar.m │ │ ├── ThumbsViewController.h │ │ ├── ThumbsViewController.m │ │ ├── UIXToolbarView.h │ │ └── UIXToolbarView.m ├── ScanViewController.h ├── ScanViewController.m ├── UIWebview加载PDF │ ├── PDFWebViewViewController.h │ └── PDFWebViewViewController.m ├── ViewController.h ├── ViewController.m ├── git-cheatsheet.pdf ├── main.m └── pdf展示.gif ├── PDFViewAndDownloadTests ├── Info.plist └── PDFViewAndDownloadTests.m ├── PDFViewAndDownloadUITests ├── Info.plist └── PDFViewAndDownloadUITests.m ├── Podfile ├── Podfile.lock ├── Pods ├── AFNetworking │ ├── AFNetworking │ │ ├── AFHTTPRequestOperation.h │ │ ├── AFHTTPRequestOperation.m │ │ ├── AFHTTPRequestOperationManager.h │ │ ├── AFHTTPRequestOperationManager.m │ │ ├── AFHTTPSessionManager.h │ │ ├── AFHTTPSessionManager.m │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworkReachabilityManager.m │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFSecurityPolicy.m │ │ ├── AFURLConnectionOperation.h │ │ ├── AFURLConnectionOperation.m │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLRequestSerialization.m │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLResponseSerialization.m │ │ ├── AFURLSessionManager.h │ │ └── AFURLSessionManager.m │ ├── LICENSE │ ├── README.md │ └── UIKit+AFNetworking │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkActivityIndicatorManager.m │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIActivityIndicatorView+AFNetworking.m │ │ ├── UIAlertView+AFNetworking.h │ │ ├── UIAlertView+AFNetworking.m │ │ ├── UIButton+AFNetworking.h │ │ ├── UIButton+AFNetworking.m │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIImageView+AFNetworking.m │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.m │ │ ├── UIRefreshControl+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.m │ │ ├── UIWebView+AFNetworking.h │ │ └── UIWebView+AFNetworking.m ├── Headers │ ├── Private │ │ ├── AFNetworking │ │ │ ├── AFHTTPRequestOperation.h │ │ │ ├── AFHTTPRequestOperationManager.h │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFURLConnectionOperation.h │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLSessionManager.h │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIAlertView+AFNetworking.h │ │ │ ├── UIButton+AFNetworking.h │ │ │ ├── UIImage+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.h │ │ │ ├── UIKit+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ └── UIWebView+AFNetworking.h │ │ ├── MBProgressHUD │ │ │ └── MBProgressHUD.h │ │ └── Masonry │ │ │ ├── MASCompositeConstraint.h │ │ │ ├── MASConstraint+Private.h │ │ │ ├── MASConstraint.h │ │ │ ├── MASConstraintMaker.h │ │ │ ├── MASLayoutConstraint.h │ │ │ ├── MASUtilities.h │ │ │ ├── MASViewAttribute.h │ │ │ ├── MASViewConstraint.h │ │ │ ├── Masonry.h │ │ │ ├── NSArray+MASAdditions.h │ │ │ ├── NSArray+MASShorthandAdditions.h │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ │ ├── View+MASAdditions.h │ │ │ ├── View+MASShorthandAdditions.h │ │ │ └── ViewController+MASAdditions.h │ └── Public │ │ ├── AFNetworking │ │ ├── AFHTTPRequestOperation.h │ │ ├── AFHTTPRequestOperationManager.h │ │ ├── AFHTTPSessionManager.h │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFURLConnectionOperation.h │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLSessionManager.h │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIAlertView+AFNetworking.h │ │ ├── UIButton+AFNetworking.h │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.h │ │ └── UIWebView+AFNetworking.h │ │ ├── MBProgressHUD │ │ └── MBProgressHUD.h │ │ └── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraintMaker.h │ │ ├── MASLayoutConstraint.h │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewConstraint.h │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── View+MASAdditions.h │ │ ├── View+MASShorthandAdditions.h │ │ └── ViewController+MASAdditions.h ├── MBProgressHUD │ ├── LICENSE │ ├── MBProgressHUD.h │ ├── MBProgressHUD.m │ └── README.mdown ├── Manifest.lock ├── Masonry │ ├── LICENSE │ ├── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASCompositeConstraint.m │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraint.m │ │ ├── MASConstraintMaker.h │ │ ├── MASConstraintMaker.m │ │ ├── MASLayoutConstraint.h │ │ ├── MASLayoutConstraint.m │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewAttribute.m │ │ ├── MASViewConstraint.h │ │ ├── MASViewConstraint.m │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASAdditions.m │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.m │ │ ├── View+MASAdditions.h │ │ ├── View+MASAdditions.m │ │ ├── View+MASShorthandAdditions.h │ │ ├── ViewController+MASAdditions.h │ │ └── ViewController+MASAdditions.m │ └── README.md ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── Dustin.xcuserdatad │ │ └── xcschemes │ │ ├── AFNetworking.xcscheme │ │ ├── MBProgressHUD.xcscheme │ │ ├── Masonry.xcscheme │ │ ├── Pods-PDFViewAndDownload.xcscheme │ │ └── xcschememanagement.plist └── Target Support Files │ ├── AFNetworking │ ├── AFNetworking-dummy.m │ ├── AFNetworking-prefix.pch │ └── AFNetworking.xcconfig │ ├── MBProgressHUD │ ├── MBProgressHUD-dummy.m │ ├── MBProgressHUD-prefix.pch │ └── MBProgressHUD.xcconfig │ ├── Masonry │ ├── Masonry-dummy.m │ ├── Masonry-prefix.pch │ └── Masonry.xcconfig │ └── Pods-PDFViewAndDownload │ ├── Pods-PDFViewAndDownload-acknowledgements.markdown │ ├── Pods-PDFViewAndDownload-acknowledgements.plist │ ├── Pods-PDFViewAndDownload-dummy.m │ ├── Pods-PDFViewAndDownload-frameworks.sh │ ├── Pods-PDFViewAndDownload-resources.sh │ ├── Pods-PDFViewAndDownload.debug.xcconfig │ └── Pods-PDFViewAndDownload.release.xcconfig └── README.md /PDFViewAndDownload.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PDFViewAndDownload.xcodeproj/project.xcworkspace/xcuserdata/Dustin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload.xcodeproj/project.xcworkspace/xcuserdata/Dustin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PDFViewAndDownload.xcodeproj/xcuserdata/Dustin.xcuserdatad/xcschemes/PDFViewAndDownload.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /PDFViewAndDownload.xcodeproj/xcuserdata/Dustin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PDFViewAndDownload.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | DA071ADB1E95D8AE00295AEC 16 | 17 | primary 18 | 19 | 20 | DA071AF41E95D8AE00295AEC 21 | 22 | primary 23 | 24 | 25 | DA071AFF1E95D8AE00295AEC 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /PDFViewAndDownload.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PDFViewAndDownload.xcworkspace/xcuserdata/Dustin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload.xcworkspace/xcuserdata/Dustin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PDFViewAndDownload.xcworkspace/xcuserdata/Dustin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /PDFViewAndDownload/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /PDFViewAndDownload/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | 20 | 21 | return YES; 22 | } 23 | 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application { 26 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 27 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 28 | } 29 | 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application { 32 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 33 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 34 | } 35 | 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application { 38 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 39 | } 40 | 41 | 42 | - (void)applicationDidBecomeActive:(UIApplication *)application { 43 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 44 | } 45 | 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application { 48 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /PDFViewAndDownload/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 | -------------------------------------------------------------------------------- /PDFViewAndDownload/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 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/001.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/CGContext DrawPDFPage/001.pdf -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/002.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/CGContext DrawPDFPage/002.pdf -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/003.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/CGContext DrawPDFPage/003.pdf -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/BackViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BackViewController.h 3 | // DoubleSidedPageViewController 4 | // 5 | // Created by Mateus Abras on 7/22/13. 6 | // Copyright (c) 2013 Mateus Abras. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BackViewController : UIViewController 12 | 13 | - (void)updateWithViewController:(UIViewController *)viewController; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/BackViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BackViewController.m 3 | // DoubleSidedPageViewController 4 | // 5 | // Created by Mateus Abras on 7/22/13. 6 | // Copyright (c) 2013 Mateus Abras. All rights reserved. 7 | // 8 | 9 | #import "BackViewController.h" 10 | #import 11 | 12 | @interface BackViewController () 13 | 14 | @property (nonatomic, strong) UIImageView *imageView; 15 | @property (nonatomic, strong) UIImage *backgroundImage; 16 | 17 | - (UIImage *)captureView:(UIView *)view; 18 | 19 | @end 20 | 21 | @implementation BackViewController 22 | 23 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 24 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 25 | if (self) { 26 | // Custom initialization 27 | } 28 | return self; 29 | } 30 | 31 | - (void)viewDidLoad { 32 | [super viewDidLoad]; 33 | // Do any additional setup after loading the view. 34 | self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; 35 | [self.view addSubview:self.imageView]; 36 | 37 | [self.view setBackgroundColor:[UIColor whiteColor]]; 38 | [_imageView setImage:_backgroundImage]; 39 | [_imageView setAlpha:0.9]; 40 | } 41 | 42 | - (void)updateWithViewController:(UIViewController *)viewController { 43 | self.backgroundImage = [self captureView:viewController.view]; 44 | } 45 | 46 | - (UIImage *)captureView:(UIView *)view { 47 | CGRect rect = view.bounds; 48 | UIGraphicsBeginImageContextWithOptions(rect.size, YES, 0.0f); 49 | CGContextRef context = UIGraphicsGetCurrentContext(); 50 | 51 | CGAffineTransform transform = CGAffineTransformMake(-1.0, 0.0, 0.0, 1.0, rect.size.width, 0.0); 52 | CGContextConcatCTM(context,transform); 53 | [view.layer renderInContext:context]; 54 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 55 | UIGraphicsEndImageContext(); 56 | return image; 57 | } 58 | 59 | - (void)didReceiveMemoryWarning { 60 | [super didReceiveMemoryWarning]; 61 | // Dispose of any resources that can be recreated. 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/CGContextDrawPDFListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGContextDrawPDFListViewController.h 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CGContextDrawPDFListViewController : UIViewController 12 | { 13 | float view_width, view_height; 14 | NSArray *titleArray, *fileArray; 15 | UITableView *pdfTableView; 16 | } 17 | @end 18 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/CGContextDrawPDFListViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGContextDrawPDFListViewController.m 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import "CGContextDrawPDFListViewController.h" 10 | #import "CGContextDrawPDFReaderController.h" 11 | #import "Masonry.h" 12 | 13 | @interface CGContextDrawPDFListViewController () 14 | 15 | @end 16 | 17 | @implementation CGContextDrawPDFListViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | self.view.backgroundColor = [UIColor whiteColor]; 22 | self.title = @"CGContext DrawPDFPage"; 23 | 24 | [self creatUI]; 25 | 26 | } 27 | 28 | - (void)creatUI{ 29 | 30 | UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 31 | [backBtn setTitle:@"返回" forState:UIControlStateNormal]; 32 | [backBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal]; 33 | [backBtn addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside]; 34 | [self.view addSubview:backBtn]; 35 | 36 | [backBtn mas_makeConstraints:^(MASConstraintMaker *make) { 37 | make.width.equalTo(@60); 38 | make.height.equalTo(@40); 39 | make.bottom.offset(-20); 40 | make.right.offset(-20); 41 | }]; 42 | 43 | view_width = self.view.frame.size.width; 44 | view_height = self.view.frame.size.height; 45 | NSLog(@"self.view.frame = %@",NSStringFromCGRect(self.view.frame)); 46 | titleArray = @[@"iOS 开发笔记——PDF的显示和浏览",@"Objective-C和CoreFoundation对象相互转换的内存管理总结",@"HTML5从入门到精通"]; 47 | fileArray = @[@"001.pdf", @"002.pdf", @"003.pdf"]; 48 | CGRect frame = CGRectMake(10, 64, view_width-20, view_height-150); 49 | pdfTableView = [[UITableView alloc] initWithFrame:frame style:UITableViewStylePlain]; 50 | pdfTableView.dataSource = self; 51 | pdfTableView.delegate = self; 52 | pdfTableView.tableHeaderView = [[UIView alloc] init]; 53 | pdfTableView.tableFooterView = [[UIView alloc] init]; 54 | [self.view addSubview:pdfTableView]; 55 | } 56 | 57 | - (void)back:(UIButton *)sender{ 58 | [self dismissViewControllerAnimated:YES completion:nil]; 59 | } 60 | 61 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 62 | return titleArray.count; 63 | } 64 | 65 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 66 | return 50; 67 | } 68 | 69 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 70 | static NSString *cellIdentifier = @"pdfTableView_cell"; 71 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 72 | if (cell == nil) { 73 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier]; 74 | } 75 | NSString *titleText = [titleArray objectAtIndex:indexPath.row]; 76 | cell.textLabel.text = titleText; 77 | return cell; 78 | } 79 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 80 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 81 | NSLog(@"didSelectRowAtIndexPath >>>> "); 82 | 83 | CGContextDrawPDFReaderController *targetViewCtrl = [[CGContextDrawPDFReaderController alloc] init]; 84 | targetViewCtrl.hidesBottomBarWhenPushed = YES;//从第一个页面跳到第二个页面时隐藏tabBar的设置方法 85 | targetViewCtrl.titleText = [titleArray objectAtIndex:indexPath.row]; 86 | targetViewCtrl.fileName = [fileArray objectAtIndex:indexPath.row]; 87 | [self.navigationController pushViewController:targetViewCtrl animated:YES]; 88 | } 89 | 90 | 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/CGContextDrawPDFPageController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGContextDrawPDFPageController.h 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CGContextDrawPDFPageController : UIViewController 12 | // CGPDFDocumentRef pdfDocument; 13 | @property (assign, nonatomic) CGPDFDocumentRef pdfDocument; 14 | @property (assign, nonatomic) long pageNO; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/CGContextDrawPDFPageController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGContextDrawPDFPageController.m 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import "CGContextDrawPDFPageController.h" 10 | #import "CGContextDrawPDFView.h" 11 | 12 | @interface CGContextDrawPDFPageController () 13 | 14 | @end 15 | 16 | @implementation CGContextDrawPDFPageController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | [self creatUI]; 22 | } 23 | 24 | - (void)creatUI{ 25 | CGRect frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height); 26 | CGContextDrawPDFView *pdfView = [[CGContextDrawPDFView alloc] initWithFrame:frame atPage:self.pageNO withPDFDoc:self.pdfDocument]; 27 | pdfView.backgroundColor=[UIColor whiteColor]; 28 | [self.view addSubview:pdfView]; 29 | } 30 | 31 | 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/CGContextDrawPDFPageModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGContextDrawPDFPageModel.h 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class CGContextDrawPDFPageController; 13 | 14 | @interface CGContextDrawPDFPageModel : NSObject 15 | { 16 | CGPDFDocumentRef pdfDocument; 17 | } 18 | 19 | 20 | -(id) initWithPDFDocument:(CGPDFDocumentRef) pdfDocument; 21 | 22 | - (CGContextDrawPDFPageController *)viewControllerAtIndex:(NSUInteger)index; 23 | - (NSUInteger)indexOfViewController:(CGContextDrawPDFPageController *)viewController; 24 | @end 25 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/CGContextDrawPDFPageModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGContextDrawPDFPageModel.m 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import "CGContextDrawPDFPageModel.h" 10 | #import "CGContextDrawPDFPageController.h" 11 | #import "BackViewController.h" 12 | 13 | @interface CGContextDrawPDFPageModel () 14 | @property (nonatomic, strong) UIViewController *currentViewController; 15 | @end 16 | 17 | @implementation CGContextDrawPDFPageModel 18 | 19 | -(id) initWithPDFDocument:(CGPDFDocumentRef) pdfDoc { 20 | self = [super init]; 21 | if (self) { 22 | pdfDocument = pdfDoc; 23 | } 24 | return self; 25 | } 26 | 27 | - (CGContextDrawPDFPageController *)viewControllerAtIndex:(NSUInteger)pageNO { 28 | // Return the data view controller for the given index. 29 | long pageSum = CGPDFDocumentGetNumberOfPages(pdfDocument); 30 | if (pageSum== 0 || pageNO >= pageSum+1) { 31 | return nil; 32 | } 33 | // Create a new view controller and pass suitable data. 34 | CGContextDrawPDFPageController *pageController = [[CGContextDrawPDFPageController alloc] init]; 35 | pageController.pdfDocument = pdfDocument; 36 | pageController.pageNO = pageNO; 37 | return pageController; 38 | } 39 | 40 | - (NSUInteger)indexOfViewController:(CGContextDrawPDFPageController *)viewController { 41 | return viewController.pageNO; 42 | } 43 | 44 | #pragma mark如果要每页的背面显示与正面相同的风格,而不是默认的白,需要设置pageController的doubleSide属性为YES,同时在下面的两个代理方法中设置BackViewController 45 | - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController { 46 | 47 | if([viewController isKindOfClass:[CGContextDrawPDFPageController class]]) { 48 | self.currentViewController = viewController; 49 | 50 | BackViewController *backViewController = [[BackViewController alloc] init]; 51 | [backViewController updateWithViewController:viewController]; 52 | return backViewController; 53 | } 54 | 55 | //self.currentViewController保存的是后一个CGContextDrawPDFPageController,如果直接用viewController实际指的是backViewController,而其没有indexOfViewController:等方法程序会崩掉。 56 | NSUInteger index = [self indexOfViewController: (CGContextDrawPDFPageController *)self.currentViewController]; 57 | if ((index == 1) || (index == NSNotFound)) { 58 | return nil; 59 | } 60 | index--; 61 | return [self viewControllerAtIndex:index]; 62 | } 63 | 64 | - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController { 65 | 66 | if([viewController isKindOfClass:[CGContextDrawPDFPageController class]]) { 67 | self.currentViewController = viewController; 68 | 69 | BackViewController *backViewController = [[BackViewController alloc] init]; 70 | [backViewController updateWithViewController:viewController]; 71 | return backViewController; 72 | } 73 | 74 | //self.currentViewController保存的是前一个CGContextDrawPDFPageController,如果直接用viewController实际指的是backViewController,而其没有indexOfViewController:等方法程序会崩掉。 75 | NSUInteger index = [self indexOfViewController: (CGContextDrawPDFPageController *)self.currentViewController]; 76 | if (index == NSNotFound) { 77 | return nil; 78 | } 79 | index++; 80 | //获取pdf文档的页数 81 | long pageSum = CGPDFDocumentGetNumberOfPages(pdfDocument); 82 | if (index >= pageSum+1) { 83 | return nil; 84 | } 85 | return [self viewControllerAtIndex:index]; 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/CGContextDrawPDFReaderController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGContextDrawPDFReaderController.h 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CGContextDrawPDFPageModel.h" 11 | 12 | @interface CGContextDrawPDFReaderController : UIViewController 13 | { 14 | UIPageViewController *pageViewCtrl; 15 | CGContextDrawPDFPageModel *pdfPageModel; 16 | } 17 | @property(nonatomic,copy)NSString *titleText, *fileName; 18 | @end 19 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/CGContextDrawPDFReaderController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGContextDrawPDFReaderController.m 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import "CGContextDrawPDFReaderController.h" 10 | #import "CGContextDrawPDFPageController.h" 11 | 12 | @interface CGContextDrawPDFReaderController () 13 | 14 | @end 15 | 16 | @implementation CGContextDrawPDFReaderController 17 | @synthesize titleText, fileName; 18 | - (void) viewDidLoad { 19 | [super viewDidLoad]; 20 | self.view.backgroundColor = [UIColor whiteColor]; 21 | self.title = self.titleText; 22 | //CFURLRef pdfURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("test.pdf"), NULL, NULL); 23 | CFURLRef pdfURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), (__bridge CFStringRef)self.fileName, NULL, NULL); 24 | //创建CGPDFDocument对象 25 | CGPDFDocumentRef pdfDocument = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL); 26 | CFRelease(pdfURL); 27 | pdfPageModel = [[CGContextDrawPDFPageModel alloc] initWithPDFDocument:pdfDocument]; 28 | 29 | // UIPageViewControllerSpineLocationMin 单页显示 30 | NSDictionary *options = [NSDictionary dictionaryWithObject: 31 | [NSNumber numberWithInteger: UIPageViewControllerSpineLocationMin] 32 | forKey: UIPageViewControllerOptionSpineLocationKey]; 33 | //初始化UIPageViewController,UIPageViewControllerTransitionStylePageCurl翻页效果,UIPageViewControllerNavigationOrientationHorizontal水平方向翻页 34 | pageViewCtrl = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl 35 | navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal 36 | options:options]; 37 | //承载pdf每页内容的控制器 38 | CGContextDrawPDFPageController *initialViewController = [pdfPageModel viewControllerAtIndex:1]; 39 | NSArray *viewControllers = [NSArray arrayWithObject:initialViewController]; 40 | //设置UIPageViewController的数据源 41 | [pageViewCtrl setDataSource:pdfPageModel]; 42 | //设置正反面都有文字 43 | pageViewCtrl.doubleSided = YES; 44 | //设置pageViewCtrl的子控制器 45 | [pageViewCtrl setViewControllers:viewControllers 46 | direction:UIPageViewControllerNavigationDirectionReverse 47 | animated:NO 48 | completion:^(BOOL f){}]; 49 | [self addChildViewController:pageViewCtrl]; 50 | [self.view addSubview:pageViewCtrl.view]; 51 | //当我们向我们的视图控制器容器(就是父视图控制器,它调用addChildViewController方法加入子视图控制器,它就成为了视图控制器的容器)中添加(或者删除)子视图控制器后,必须调用该方法,告诉iOS,已经完成添加(或删除)子控制器的操作。 52 | [pageViewCtrl didMoveToParentViewController:self]; 53 | } 54 | 55 | - (void) viewDidUnload { 56 | 57 | [super viewDidUnload]; 58 | } 59 | - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 60 | return YES; 61 | } 62 | 63 | - (void)didReceiveMemoryWarning { 64 | [super didReceiveMemoryWarning]; 65 | // Dispose of any resources that can be recreated. 66 | } 67 | 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/CGContextDrawPDFView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGContextDrawPDFView.h 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CGContextDrawPDFView : UIView { 12 | CGPDFDocumentRef pdfDocument; 13 | int pageNO; 14 | } 15 | 16 | -(id)initWithFrame:(CGRect)frame atPage:(int)index withPDFDoc:(CGPDFDocumentRef) pdfDoc; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /PDFViewAndDownload/CGContext DrawPDFPage/CGContextDrawPDFView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGContextDrawPDFView.m 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import "CGContextDrawPDFView.h" 10 | 11 | @implementation CGContextDrawPDFView 12 | 13 | -(id)initWithFrame:(CGRect)frame atPage:(int)index withPDFDoc:(CGPDFDocumentRef) pdfDoc{ 14 | self = [super initWithFrame:frame]; 15 | 16 | pageNO = index; 17 | pdfDocument = pdfDoc; 18 | return self; 19 | } 20 | 21 | -(void)drawInContext:(CGContextRef)context atPageNo:(int)page_no{ 22 | //Quartz坐标系和UIView坐标系不一样所致,调整坐标系,使pdf正立 23 | CGContextTranslateCTM(context, 0.0, self.bounds.size.height); 24 | CGContextScaleCTM(context, 1.0, -1.0); 25 | 26 | if (pageNO == 0) { 27 | pageNO = 1; 28 | } 29 | 30 | //获取指定页的pdf文档 31 | CGPDFPageRef page = CGPDFDocumentGetPage(pdfDocument, pageNO); 32 | //创建一个仿射变换,该变换基于将PDF页的BOX映射到指定的矩形中。 33 | CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(page, kCGPDFCropBox, self.bounds, 0, true); 34 | CGContextConcatCTM(context, pdfTransform); 35 | //将pdf绘制到上下文中 36 | CGContextDrawPDFPage(context, page); 37 | 38 | } 39 | 40 | - (void)drawRect:(CGRect)rect { 41 | [self drawInContext:UIGraphicsGetCurrentContext() atPageNo:pageNO]; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /PDFViewAndDownload/DownloadViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DownloadViewController.h 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DownloadViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PDFViewAndDownload/DownloadViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DownloadViewController.m 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import "DownloadViewController.h" 10 | #import "Masonry.h" 11 | 12 | @interface DownloadViewController () 13 | 14 | @end 15 | 16 | @implementation DownloadViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | self.view.backgroundColor = [UIColor whiteColor]; 21 | 22 | [self creatUI]; 23 | } 24 | 25 | - (void)creatUI{ 26 | 27 | UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 28 | [backBtn setTitle:@"返回" forState:UIControlStateNormal]; 29 | [backBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal]; 30 | [backBtn addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside]; 31 | [self.view addSubview:backBtn]; 32 | 33 | UITableView *myTV = [[UITableView alloc] initWithFrame:CGRectMake(0, 60, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 60) style:UITableViewStylePlain]; 34 | myTV.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; 35 | myTV.delegate = self; 36 | myTV.dataSource = self; 37 | [self.view addSubview:myTV]; 38 | 39 | [backBtn mas_makeConstraints:^(MASConstraintMaker *make) { 40 | make.width.equalTo(@60); 41 | make.height.equalTo(@40); 42 | make.top.offset(20); 43 | make.left.offset(10); 44 | }]; 45 | } 46 | 47 | - (void)back:(UIButton *)sender{ 48 | [self dismissViewControllerAnimated:YES completion:nil]; 49 | } 50 | 51 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 52 | return 2; 53 | } 54 | 55 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 56 | return 44; 57 | } 58 | 59 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 60 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"scanCell"]; 61 | if (!cell) { 62 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"scanCell"]; 63 | } 64 | cell.textLabel.textColor = [UIColor colorWithRed:64/255.0 green:136.0/255.0 blue:164/255.0 alpha:1.0]; 65 | switch (indexPath.row) { 66 | case 0: 67 | cell.textLabel.text = @"NSData 下载"; 68 | break; 69 | case 1: 70 | cell.textLabel.text = @"AFN 下载"; 71 | break; 72 | 73 | default: 74 | break; 75 | } 76 | 77 | 78 | 79 | return cell; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /PDFViewAndDownload/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 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/AppIcon-076.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/AppIcon-076.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/AppIcon-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/AppIcon-120.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/AppIcon-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/AppIcon-152.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/AppIcon-167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/AppIcon-167.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/AppIcon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/AppIcon-180.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Button-H.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Button-H.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Button-H@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Button-H@2x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Button-H@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Button-H@3x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Button-N.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Button-N.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Button-N@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Button-N@2x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Button-N@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Button-N@3x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Email.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Email@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Email@2x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Email@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Email@3x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Export.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Export@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Export@2x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Export@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Export@3x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Mark-N.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Mark-N.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Mark-N@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Mark-N@2x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Mark-N@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Mark-N@3x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Mark-Y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Mark-Y.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Mark-Y@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Mark-Y@2x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Mark-Y@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Mark-Y@3x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Print.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Print@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Print@2x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Print@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Print@3x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Thumbs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Thumbs.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Thumbs@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Thumbs@2x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Graphics/Reader-Thumbs@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/Reader/Graphics/Reader-Thumbs@3x.png -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/CGPDFDocument.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGPDFDocument.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-07-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | #import 28 | 29 | // 30 | // Custom CGPDFDocument[...] functions 31 | // 32 | 33 | CGPDFDocumentRef CGPDFDocumentCreateUsingUrl(CFURLRef theURL, NSString *password); 34 | 35 | CGPDFDocumentRef CGPDFDocumentCreateUsingData(CGDataProviderRef dataProvider, NSString *password); 36 | 37 | BOOL CGPDFDocumentUrlNeedsPassword(CFURLRef theURL, NSString *password); 38 | 39 | BOOL CGPDFDocumentDataNeedsPassword(CGDataProviderRef dataProvider, NSString *password); 40 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderConstants.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-07-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #if !__has_feature(objc_arc) 27 | #error ARC (-fobjc-arc) is required to build this code. 28 | #endif 29 | 30 | #import 31 | 32 | #define READER_FLAT_UI TRUE 33 | #define READER_SHOW_SHADOWS TRUE 34 | #define READER_ENABLE_THUMBS TRUE 35 | #define READER_DISABLE_RETINA FALSE 36 | #define READER_ENABLE_PREVIEW TRUE 37 | #define READER_DISABLE_IDLE FALSE 38 | #define READER_STANDALONE FALSE 39 | #define READER_BOOKMARKS TRUE 40 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderConstants.m: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderConstants.m 3 | // Reader v2.8.7 4 | // 5 | // Created by Julius Oklamcak on 2011-07-01. 6 | // Copyright © 2011-2016 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import "ReaderConstants.h" 27 | 28 | static NSString *const kReaderCopyrightNotice = @"Reader v2.x.y • Copyright © 2011-2016 Julius Oklamcak. All rights reserved."; 29 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderContentPage.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderContentPage.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-07-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | @interface ReaderContentPage : UIView 29 | 30 | - (instancetype)initWithURL:(NSURL *)fileURL page:(NSInteger)page password:(NSString *)phrase; 31 | 32 | - (id)processSingleTap:(UITapGestureRecognizer *)recognizer; 33 | 34 | @end 35 | 36 | #pragma mark - 37 | 38 | // 39 | // ReaderDocumentLink class interface 40 | // 41 | 42 | @interface ReaderDocumentLink : NSObject 43 | 44 | @property (nonatomic, assign, readonly) CGRect rect; 45 | 46 | @property (nonatomic, assign, readonly) CGPDFDictionaryRef dictionary; 47 | 48 | + (instancetype)newWithRect:(CGRect)linkRect dictionary:(CGPDFDictionaryRef)linkDictionary; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderContentTile.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderContentTile.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-07-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | #import 28 | 29 | @interface ReaderContentTile : CATiledLayer 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderContentTile.m: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderContentTile.m 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-07-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import "ReaderContentTile.h" 27 | 28 | @implementation ReaderContentTile 29 | 30 | #pragma mark - Constants 31 | 32 | #define LEVELS_OF_DETAIL 16 33 | 34 | #pragma mark - ReaderContentTile class methods 35 | 36 | + (CFTimeInterval)fadeDuration 37 | { 38 | return 0.001; // iOS bug (flickering tiles) workaround 39 | } 40 | 41 | #pragma mark - ReaderContentTile instance methods 42 | 43 | - (instancetype)init 44 | { 45 | if ((self = [super init])) // Initialize superclass 46 | { 47 | self.levelsOfDetail = LEVELS_OF_DETAIL; // Zoom levels 48 | 49 | self.levelsOfDetailBias = (LEVELS_OF_DETAIL - 1); // Bias 50 | 51 | UIScreen *mainScreen = [UIScreen mainScreen]; // Main screen 52 | 53 | CGFloat screenScale = [mainScreen scale]; // Main screen scale 54 | 55 | CGRect screenBounds = [mainScreen bounds]; // Main screen bounds 56 | 57 | CGFloat w_pixels = (screenBounds.size.width * screenScale); 58 | 59 | CGFloat h_pixels = (screenBounds.size.height * screenScale); 60 | 61 | CGFloat max = ((w_pixels < h_pixels) ? h_pixels : w_pixels); 62 | 63 | CGFloat sizeOfTiles = ((max < 512.0f) ? 512.0f : 1024.0f); 64 | 65 | self.tileSize = CGSizeMake(sizeOfTiles, sizeOfTiles); 66 | } 67 | 68 | return self; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderContentView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderContentView.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-07-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | #import "ReaderThumbView.h" 29 | 30 | @class ReaderContentView; 31 | @class ReaderContentPage; 32 | @class ReaderContentThumb; 33 | 34 | @protocol ReaderContentViewDelegate 35 | 36 | @required // Delegate protocols 37 | 38 | - (void)contentView:(ReaderContentView *)contentView touchesBegan:(NSSet *)touches; 39 | 40 | @end 41 | 42 | @interface ReaderContentView : UIScrollView 43 | 44 | @property (nonatomic, weak, readwrite) id message; 45 | 46 | - (instancetype)initWithFrame:(CGRect)frame fileURL:(NSURL *)fileURL page:(NSUInteger)page password:(NSString *)phrase; 47 | 48 | - (void)showPageThumb:(NSURL *)fileURL page:(NSInteger)page password:(NSString *)phrase guid:(NSString *)guid; 49 | 50 | - (id)processSingleTap:(UITapGestureRecognizer *)recognizer; 51 | 52 | - (void)zoomIncrement:(UITapGestureRecognizer *)recognizer; 53 | - (void)zoomDecrement:(UITapGestureRecognizer *)recognizer; 54 | - (void)zoomResetAnimated:(BOOL)animated; 55 | 56 | @end 57 | 58 | #pragma mark - 59 | 60 | // 61 | // ReaderContentThumb class interface 62 | // 63 | 64 | @interface ReaderContentThumb : ReaderThumbView 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderDocument.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderDocument.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-07-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | @interface ReaderDocument : NSObject 29 | 30 | @property (nonatomic, strong, readonly) NSString *guid; 31 | @property (nonatomic, strong, readonly) NSDate *fileDate; 32 | @property (nonatomic, strong, readwrite) NSDate *lastOpen; 33 | @property (nonatomic, strong, readonly) NSNumber *fileSize; 34 | @property (nonatomic, strong, readonly) NSNumber *pageCount; 35 | @property (nonatomic, strong, readwrite) NSNumber *pageNumber; 36 | @property (nonatomic, strong, readonly) NSMutableIndexSet *bookmarks; 37 | @property (nonatomic, strong, readonly) NSString *password; 38 | @property (nonatomic, strong, readonly) NSString *fileName; 39 | @property (nonatomic, strong, readonly) NSURL *fileURL; 40 | 41 | @property (nonatomic, readonly) BOOL canEmail; 42 | @property (nonatomic, readonly) BOOL canExport; 43 | @property (nonatomic, readonly) BOOL canPrint; 44 | 45 | + (ReaderDocument *)withDocumentFilePath:(NSString *)filePath password:(NSString *)phrase; 46 | 47 | + (ReaderDocument *)unarchiveFromFileName:(NSString *)filePath password:(NSString *)phrase; 48 | 49 | - (instancetype)initWithFilePath:(NSString *)filePath password:(NSString *)phrase; 50 | 51 | - (BOOL)archiveDocumentProperties; 52 | 53 | - (void)updateDocumentProperties; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderDocumentOutline.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderDocumentOutline.m 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2012-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | @interface ReaderDocumentOutline : NSObject 29 | 30 | + (NSArray *)outlineFromFileURL:(NSURL *)fileURL password:(NSString *)phrase; 31 | 32 | + (void)logDocumentOutlineArray:(NSArray *)array; 33 | 34 | @end 35 | 36 | @interface DocumentOutlineEntry : NSObject 37 | 38 | + (instancetype)newWithTitle:(NSString *)title target:(id)target level:(NSInteger)level; 39 | 40 | @property (nonatomic, assign, readonly) NSInteger level; 41 | @property (nonatomic, strong, readwrite) NSMutableArray *children; 42 | @property (nonatomic, strong, readonly) NSString *title; 43 | @property (nonatomic, strong, readonly) id target; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderMainPagebar.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderMainPagebar.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | #import "ReaderThumbView.h" 29 | 30 | @class ReaderMainPagebar; 31 | @class ReaderTrackControl; 32 | @class ReaderPagebarThumb; 33 | @class ReaderDocument; 34 | 35 | @protocol ReaderMainPagebarDelegate 36 | 37 | @required // Delegate protocols 38 | 39 | - (void)pagebar:(ReaderMainPagebar *)pagebar gotoPage:(NSInteger)page; 40 | 41 | @end 42 | 43 | @interface ReaderMainPagebar : UIView 44 | 45 | @property (nonatomic, weak, readwrite) id delegate; 46 | 47 | - (instancetype)initWithFrame:(CGRect)frame document:(ReaderDocument *)object; 48 | 49 | - (void)updatePagebar; 50 | 51 | - (void)hidePagebar; 52 | - (void)showPagebar; 53 | 54 | @end 55 | 56 | #pragma mark - 57 | 58 | // 59 | // ReaderTrackControl class interface 60 | // 61 | 62 | @interface ReaderTrackControl : UIControl 63 | 64 | @property (nonatomic, assign, readonly) CGFloat value; 65 | 66 | @end 67 | 68 | #pragma mark - 69 | 70 | // 71 | // ReaderPagebarThumb class interface 72 | // 73 | 74 | @interface ReaderPagebarThumb : ReaderThumbView 75 | 76 | - (instancetype)initWithFrame:(CGRect)frame small:(BOOL)small; 77 | 78 | @end 79 | 80 | #pragma mark - 81 | 82 | // 83 | // ReaderPagebarShadow class interface 84 | // 85 | 86 | @interface ReaderPagebarShadow : UIView 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderMainToolbar.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderMainToolbar.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-07-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | #import "UIXToolbarView.h" 29 | 30 | @class ReaderMainToolbar; 31 | @class ReaderDocument; 32 | 33 | @protocol ReaderMainToolbarDelegate 34 | 35 | @required // Delegate protocols 36 | 37 | - (void)tappedInToolbar:(ReaderMainToolbar *)toolbar doneButton:(UIButton *)button; 38 | - (void)tappedInToolbar:(ReaderMainToolbar *)toolbar thumbsButton:(UIButton *)button; 39 | - (void)tappedInToolbar:(ReaderMainToolbar *)toolbar exportButton:(UIButton *)button; 40 | - (void)tappedInToolbar:(ReaderMainToolbar *)toolbar printButton:(UIButton *)button; 41 | - (void)tappedInToolbar:(ReaderMainToolbar *)toolbar emailButton:(UIButton *)button; 42 | - (void)tappedInToolbar:(ReaderMainToolbar *)toolbar markButton:(UIButton *)button; 43 | 44 | @end 45 | 46 | @interface ReaderMainToolbar : UIXToolbarView 47 | 48 | @property (nonatomic, weak, readwrite) id delegate; 49 | 50 | - (instancetype)initWithFrame:(CGRect)frame document:(ReaderDocument *)document; 51 | 52 | - (void)setBookmarkState:(BOOL)state; 53 | 54 | - (void)hideToolbar; 55 | - (void)showToolbar; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderThumbCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderThumbCache.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | #import "ReaderThumbRequest.h" 29 | 30 | @interface ReaderThumbCache : NSObject 31 | 32 | + (ReaderThumbCache *)sharedInstance; 33 | 34 | + (void)touchThumbCacheWithGUID:(NSString *)guid; 35 | 36 | + (void)createThumbCacheWithGUID:(NSString *)guid; 37 | 38 | + (void)removeThumbCacheWithGUID:(NSString *)guid; 39 | 40 | + (void)purgeThumbCachesOlderThan:(NSTimeInterval)age; 41 | 42 | + (NSString *)thumbCachePathForGUID:(NSString *)guid; 43 | 44 | - (id)thumbRequest:(ReaderThumbRequest *)request priority:(BOOL)priority; 45 | 46 | - (void)setObject:(UIImage *)image forKey:(NSString *)key; 47 | 48 | - (void)removeObjectForKey:(NSString *)key; 49 | 50 | - (void)removeNullForKey:(NSString *)key; 51 | 52 | - (void)removeAllObjects; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderThumbFetch.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderThumbFetch.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | #import "ReaderThumbQueue.h" 29 | 30 | @class ReaderThumbRequest; 31 | 32 | @interface ReaderThumbFetch : ReaderThumbOperation 33 | 34 | - (instancetype)initWithRequest:(ReaderThumbRequest *)options; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderThumbQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderThumbQueue.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | @interface ReaderThumbQueue : NSObject 29 | 30 | + (ReaderThumbQueue *)sharedInstance; 31 | 32 | - (void)addLoadOperation:(NSOperation *)operation; 33 | 34 | - (void)addWorkOperation:(NSOperation *)operation; 35 | 36 | - (void)cancelOperationsWithGUID:(NSString *)guid; 37 | 38 | - (void)cancelAllOperations; 39 | 40 | @end 41 | 42 | #pragma mark - 43 | 44 | // 45 | // ReaderThumbOperation class interface 46 | // 47 | 48 | @interface ReaderThumbOperation : NSOperation 49 | 50 | @property (nonatomic, strong, readonly) NSString *guid; 51 | 52 | - (instancetype)initWithGUID:(NSString *)guid; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderThumbQueue.m: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderThumbQueue.m 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import "ReaderThumbQueue.h" 27 | 28 | @implementation ReaderThumbQueue 29 | { 30 | NSOperationQueue *loadQueue; 31 | 32 | NSOperationQueue *workQueue; 33 | } 34 | 35 | #pragma mark - ReaderThumbQueue class methods 36 | 37 | + (ReaderThumbQueue *)sharedInstance 38 | { 39 | static dispatch_once_t predicate = 0; 40 | 41 | static ReaderThumbQueue *object = nil; // Object 42 | 43 | dispatch_once(&predicate, ^{ object = [self new]; }); 44 | 45 | return object; // ReaderThumbQueue singleton 46 | } 47 | 48 | #pragma mark - ReaderThumbQueue instance methods 49 | 50 | - (instancetype)init 51 | { 52 | if ((self = [super init])) // Initialize 53 | { 54 | loadQueue = [NSOperationQueue new]; 55 | 56 | [loadQueue setName:@"ReaderThumbLoadQueue"]; 57 | 58 | [loadQueue setMaxConcurrentOperationCount:1]; 59 | 60 | workQueue = [NSOperationQueue new]; 61 | 62 | [workQueue setName:@"ReaderThumbWorkQueue"]; 63 | 64 | [workQueue setMaxConcurrentOperationCount:1]; 65 | } 66 | 67 | return self; 68 | } 69 | 70 | - (void)addLoadOperation:(NSOperation *)operation 71 | { 72 | if ([operation isKindOfClass:[ReaderThumbOperation class]]) 73 | { 74 | [loadQueue addOperation:operation]; // Add to load queue 75 | } 76 | } 77 | 78 | - (void)addWorkOperation:(NSOperation *)operation 79 | { 80 | if ([operation isKindOfClass:[ReaderThumbOperation class]]) 81 | { 82 | [workQueue addOperation:operation]; // Add to work queue 83 | } 84 | } 85 | 86 | - (void)cancelOperationsWithGUID:(NSString *)guid 87 | { 88 | [loadQueue setSuspended:YES]; [workQueue setSuspended:YES]; 89 | 90 | for (ReaderThumbOperation *operation in loadQueue.operations) 91 | { 92 | if ([operation isKindOfClass:[ReaderThumbOperation class]]) 93 | { 94 | if ([operation.guid isEqualToString:guid]) [operation cancel]; 95 | } 96 | } 97 | 98 | for (ReaderThumbOperation *operation in workQueue.operations) 99 | { 100 | if ([operation isKindOfClass:[ReaderThumbOperation class]]) 101 | { 102 | if ([operation.guid isEqualToString:guid]) [operation cancel]; 103 | } 104 | } 105 | 106 | [workQueue setSuspended:NO]; [loadQueue setSuspended:NO]; 107 | } 108 | 109 | - (void)cancelAllOperations 110 | { 111 | [loadQueue cancelAllOperations]; [workQueue cancelAllOperations]; 112 | } 113 | 114 | @end 115 | 116 | #pragma mark - 117 | 118 | // 119 | // ReaderThumbOperation class implementation 120 | // 121 | 122 | @implementation ReaderThumbOperation 123 | { 124 | NSString *_guid; 125 | } 126 | 127 | @synthesize guid = _guid; 128 | 129 | #pragma mark - ReaderThumbOperation instance methods 130 | 131 | - (instancetype)initWithGUID:(NSString *)guid 132 | { 133 | if ((self = [super init])) 134 | { 135 | _guid = guid; 136 | } 137 | 138 | return self; 139 | } 140 | 141 | @end 142 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderThumbRender.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderThumbRender.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | #import "ReaderThumbQueue.h" 29 | 30 | @class ReaderThumbRequest; 31 | 32 | @interface ReaderThumbRender : ReaderThumbOperation 33 | 34 | - (instancetype)initWithRequest:(ReaderThumbRequest *)options; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderThumbRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderThumbRequest.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | @class ReaderThumbView; 29 | 30 | @interface ReaderThumbRequest : NSObject 31 | 32 | @property (nonatomic, strong, readonly) NSURL *fileURL; 33 | @property (nonatomic, strong, readonly) NSString *guid; 34 | @property (nonatomic, strong, readonly) NSString *password; 35 | @property (nonatomic, strong, readonly) NSString *cacheKey; 36 | @property (nonatomic, strong, readonly) NSString *thumbName; 37 | @property (nonatomic, strong, readwrite) ReaderThumbView *thumbView; 38 | @property (nonatomic, assign, readonly) NSUInteger targetTag; 39 | @property (nonatomic, assign, readonly) NSInteger thumbPage; 40 | @property (nonatomic, assign, readonly) CGSize thumbSize; 41 | @property (nonatomic, assign, readonly) CGFloat scale; 42 | 43 | + (instancetype)newForView:(ReaderThumbView *)view fileURL:(NSURL *)url password:(NSString *)phrase guid:(NSString *)guid page:(NSInteger)page size:(CGSize)size; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderThumbRequest.m: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderThumbRequest.m 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import "ReaderThumbRequest.h" 27 | #import "ReaderThumbView.h" 28 | 29 | @implementation ReaderThumbRequest 30 | { 31 | NSURL *_fileURL; 32 | 33 | NSString *_guid; 34 | 35 | NSString *_password; 36 | 37 | NSString *_cacheKey; 38 | 39 | NSString *_thumbName; 40 | 41 | ReaderThumbView *_thumbView; 42 | 43 | NSUInteger _targetTag; 44 | 45 | NSInteger _thumbPage; 46 | 47 | CGSize _thumbSize; 48 | 49 | CGFloat _scale; 50 | } 51 | 52 | #pragma mark - Properties 53 | 54 | @synthesize guid = _guid; 55 | @synthesize fileURL = _fileURL; 56 | @synthesize password = _password; 57 | @synthesize thumbView = _thumbView; 58 | @synthesize thumbPage = _thumbPage; 59 | @synthesize thumbSize = _thumbSize; 60 | @synthesize thumbName = _thumbName; 61 | @synthesize targetTag = _targetTag; 62 | @synthesize cacheKey = _cacheKey; 63 | @synthesize scale = _scale; 64 | 65 | #pragma mark - ReaderThumbRequest class methods 66 | 67 | + (instancetype)newForView:(ReaderThumbView *)view fileURL:(NSURL *)url password:(NSString *)phrase guid:(NSString *)guid page:(NSInteger)page size:(CGSize)size 68 | { 69 | return [[ReaderThumbRequest alloc] initForView:view fileURL:url password:phrase guid:guid page:page size:size]; 70 | } 71 | 72 | #pragma mark - ReaderThumbRequest instance methods 73 | 74 | - (instancetype)initForView:(ReaderThumbView *)view fileURL:(NSURL *)url password:(NSString *)phrase guid:(NSString *)guid page:(NSInteger)page size:(CGSize)size 75 | { 76 | if ((self = [super init])) // Initialize object 77 | { 78 | NSInteger w = size.width; NSInteger h = size.height; 79 | 80 | _thumbView = view; _thumbPage = page; _thumbSize = size; 81 | 82 | _fileURL = [url copy]; _password = [phrase copy]; _guid = [guid copy]; 83 | 84 | _thumbName = [[NSString alloc] initWithFormat:@"%07i-%04ix%04i", (int)page, (int)w, (int)h]; 85 | 86 | _cacheKey = [[NSString alloc] initWithFormat:@"%@+%@", _thumbName, _guid]; 87 | 88 | _targetTag = [_cacheKey hash]; _thumbView.targetTag = _targetTag; 89 | 90 | _scale = [[UIScreen mainScreen] scale]; // Thumb screen scale 91 | } 92 | 93 | return self; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderThumbView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderThumbView.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | @interface ReaderThumbView : UIView 29 | { 30 | @protected // Instance variables 31 | 32 | UIImageView *imageView; 33 | } 34 | 35 | @property (atomic, strong, readwrite) NSOperation *operation; 36 | 37 | @property (nonatomic, assign, readwrite) NSUInteger targetTag; 38 | 39 | - (void)showImage:(UIImage *)image; 40 | 41 | - (void)showTouched:(BOOL)touched; 42 | 43 | - (void)reuse; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderThumbView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderThumbView.m 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import "ReaderThumbView.h" 27 | 28 | @implementation ReaderThumbView 29 | { 30 | NSOperation *_operation; 31 | 32 | NSUInteger _targetTag; 33 | } 34 | 35 | #pragma mark - Properties 36 | 37 | @synthesize operation = _operation; 38 | @synthesize targetTag = _targetTag; 39 | 40 | #pragma mark - ReaderThumbView instance methods 41 | 42 | - (instancetype)initWithFrame:(CGRect)frame 43 | { 44 | if ((self = [super initWithFrame:frame])) 45 | { 46 | self.autoresizesSubviews = NO; 47 | self.userInteractionEnabled = NO; 48 | self.contentMode = UIViewContentModeRedraw; 49 | self.autoresizingMask = UIViewAutoresizingNone; 50 | self.backgroundColor = [UIColor clearColor]; 51 | 52 | imageView = [[UIImageView alloc] initWithFrame:self.bounds]; 53 | 54 | imageView.autoresizesSubviews = NO; 55 | imageView.userInteractionEnabled = NO; 56 | imageView.autoresizingMask = UIViewAutoresizingNone; 57 | imageView.contentMode = UIViewContentModeScaleAspectFit; 58 | 59 | [self addSubview:imageView]; 60 | } 61 | 62 | return self; 63 | } 64 | 65 | - (void)showImage:(UIImage *)image 66 | { 67 | imageView.image = image; // Show image 68 | } 69 | 70 | - (void)showTouched:(BOOL)touched 71 | { 72 | // Implemented by ReaderThumbView subclass 73 | } 74 | 75 | - (void)removeFromSuperview 76 | { 77 | _targetTag = 0; // Clear target tag 78 | 79 | [self.operation cancel]; // Cancel operation 80 | 81 | [super removeFromSuperview]; // Remove view 82 | } 83 | 84 | - (void)reuse 85 | { 86 | _targetTag = 0; // Clear target tag 87 | 88 | [self.operation cancel]; // Cancel operation 89 | 90 | imageView.image = nil; // Release image 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderThumbsView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderThumbsView.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | #import "ReaderThumbView.h" 29 | 30 | @class ReaderThumbsView; 31 | 32 | @protocol ReaderThumbsViewDelegate 33 | 34 | @required // Delegate protocols 35 | 36 | - (NSUInteger)numberOfThumbsInThumbsView:(ReaderThumbsView *)thumbsView; 37 | 38 | - (id)thumbsView:(ReaderThumbsView *)thumbsView thumbCellWithFrame:(CGRect)frame; 39 | 40 | - (void)thumbsView:(ReaderThumbsView *)thumbsView updateThumbCell:(id)thumbCell forIndex:(NSInteger)index; 41 | 42 | - (void)thumbsView:(ReaderThumbsView *)thumbsView didSelectThumbWithIndex:(NSInteger)index; 43 | 44 | @optional // Delegate protocols 45 | 46 | - (void)thumbsView:(ReaderThumbsView *)thumbsView refreshThumbCell:(id)thumbCell forIndex:(NSInteger)index; 47 | 48 | - (void)thumbsView:(ReaderThumbsView *)thumbsView didPressThumbWithIndex:(NSInteger)index; 49 | 50 | @end 51 | 52 | @interface ReaderThumbsView : UIScrollView 53 | 54 | @property (nonatomic, weak, readwrite) id delegate; 55 | 56 | - (void)setThumbSize:(CGSize)thumbSize; 57 | 58 | - (void)reloadThumbsCenterOnIndex:(NSInteger)index; 59 | 60 | - (void)reloadThumbsContentOffset:(CGPoint)newContentOffset; 61 | 62 | - (void)refreshThumbWithIndex:(NSInteger)index; 63 | 64 | - (void)refreshVisibleThumbs; 65 | 66 | - (CGPoint)insetContentOffset; 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ReaderViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReaderViewController.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-07-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | #import "ReaderDocument.h" 29 | 30 | @class ReaderViewController; 31 | 32 | @protocol ReaderViewControllerDelegate 33 | 34 | @optional // Delegate protocols 35 | 36 | - (void)dismissReaderViewController:(ReaderViewController *)viewController; 37 | 38 | @end 39 | 40 | @interface ReaderViewController : UIViewController 41 | 42 | @property (nonatomic, weak, readwrite) id delegate; 43 | 44 | - (instancetype)initWithReaderDocument:(ReaderDocument *)object; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ThumbsMainToolbar.h: -------------------------------------------------------------------------------- 1 | // 2 | // ThumbsMainToolbar.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | #import "UIXToolbarView.h" 29 | 30 | @class ThumbsMainToolbar; 31 | 32 | @protocol ThumbsMainToolbarDelegate 33 | 34 | @required // Delegate protocols 35 | 36 | - (void)tappedInToolbar:(ThumbsMainToolbar *)toolbar doneButton:(UIButton *)button; 37 | - (void)tappedInToolbar:(ThumbsMainToolbar *)toolbar showControl:(UISegmentedControl *)control; 38 | 39 | @end 40 | 41 | @interface ThumbsMainToolbar : UIXToolbarView 42 | 43 | @property (nonatomic, weak, readwrite) id delegate; 44 | 45 | - (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/ThumbsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ThumbsViewController.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | #import "ThumbsMainToolbar.h" 29 | #import "ReaderThumbsView.h" 30 | 31 | @class ReaderDocument; 32 | @class ThumbsViewController; 33 | 34 | @protocol ThumbsViewControllerDelegate 35 | 36 | @required // Delegate protocols 37 | 38 | - (void)thumbsViewController:(ThumbsViewController *)viewController gotoPage:(NSInteger)page; 39 | 40 | - (void)dismissThumbsViewController:(ThumbsViewController *)viewController; 41 | 42 | @end 43 | 44 | @interface ThumbsViewController : UIViewController 45 | 46 | @property (nonatomic, weak, readwrite) id delegate; 47 | 48 | - (instancetype)initWithReaderDocument:(ReaderDocument *)object; 49 | 50 | @end 51 | 52 | #pragma mark - 53 | 54 | // 55 | // ThumbsPageThumb class interface 56 | // 57 | 58 | @interface ThumbsPageThumb : ReaderThumbView 59 | 60 | - (CGSize)maximumContentSize; 61 | 62 | - (void)showText:(NSString *)text; 63 | 64 | - (void)showBookmark:(BOOL)show; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/UIXToolbarView.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIXToolbarView.h 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | @interface UIXToolbarView : UIView 29 | 30 | @end 31 | 32 | #pragma mark - 33 | 34 | // 35 | // UIXToolbarShadow class interface 36 | // 37 | 38 | @interface UIXToolbarShadow : UIView 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /PDFViewAndDownload/Reader/Sources/UIXToolbarView.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIXToolbarView.m 3 | // Reader v2.8.6 4 | // 5 | // Created by Julius Oklamcak on 2011-09-01. 6 | // Copyright © 2011-2015 Julius Oklamcak. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights to 11 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 12 | // of the Software, and to permit persons to whom the Software is furnished to 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | // 25 | 26 | #import "ReaderConstants.h" 27 | #import "UIXToolbarView.h" 28 | 29 | #import 30 | 31 | @implementation UIXToolbarView 32 | 33 | #pragma mark - Constants 34 | 35 | #define SHADOW_HEIGHT 4.0f 36 | 37 | #pragma mark - UIXToolbarView class methods 38 | 39 | + (Class)layerClass 40 | { 41 | #if (READER_FLAT_UI == FALSE) // Option 42 | return [CAGradientLayer class]; 43 | #else 44 | return [CALayer class]; 45 | #endif // end of READER_FLAT_UI Option 46 | } 47 | 48 | #pragma mark - UIXToolbarView instance methods 49 | 50 | - (instancetype)initWithFrame:(CGRect)frame 51 | { 52 | if ((self = [super initWithFrame:frame])) 53 | { 54 | self.autoresizesSubviews = YES; 55 | self.userInteractionEnabled = YES; 56 | self.contentMode = UIViewContentModeRedraw; 57 | self.autoresizingMask = UIViewAutoresizingFlexibleWidth; 58 | 59 | if ([self.layer isKindOfClass:[CAGradientLayer class]]) 60 | { 61 | self.backgroundColor = [UIColor clearColor]; 62 | 63 | CAGradientLayer *layer = (CAGradientLayer *)self.layer; 64 | UIColor *liteColor = [UIColor colorWithWhite:0.92f alpha:0.8f]; 65 | UIColor *darkColor = [UIColor colorWithWhite:0.32f alpha:0.8f]; 66 | layer.colors = [NSArray arrayWithObjects:(id)liteColor.CGColor, (id)darkColor.CGColor, nil]; 67 | 68 | CGRect shadowRect = self.bounds; shadowRect.origin.y += shadowRect.size.height; shadowRect.size.height = SHADOW_HEIGHT; 69 | 70 | UIXToolbarShadow *shadowView = [[UIXToolbarShadow alloc] initWithFrame:shadowRect]; 71 | 72 | [self addSubview:shadowView]; // Add shadow to toolbar 73 | } 74 | else // Follow The Fuglyosity of Flat Fad 75 | { 76 | self.backgroundColor = [UIColor colorWithWhite:0.94f alpha:0.94f]; 77 | 78 | CGRect lineRect = self.bounds; lineRect.origin.y += lineRect.size.height; lineRect.size.height = 1.0f; 79 | 80 | UIView *lineView = [[UIView alloc] initWithFrame:lineRect]; 81 | lineView.autoresizesSubviews = NO; 82 | lineView.userInteractionEnabled = NO; 83 | lineView.contentMode = UIViewContentModeRedraw; 84 | lineView.autoresizingMask = UIViewAutoresizingFlexibleWidth; 85 | lineView.backgroundColor = [UIColor colorWithWhite:0.64f alpha:0.94f]; 86 | [self addSubview:lineView]; 87 | } 88 | } 89 | 90 | return self; 91 | } 92 | 93 | @end 94 | 95 | #pragma mark - 96 | 97 | // 98 | // UIXToolbarShadow class implementation 99 | // 100 | 101 | @implementation UIXToolbarShadow 102 | 103 | #pragma mark - UIXToolbarShadow class methods 104 | 105 | + (Class)layerClass 106 | { 107 | return [CAGradientLayer class]; 108 | } 109 | 110 | #pragma mark - UIXToolbarShadow instance methods 111 | 112 | - (instancetype)initWithFrame:(CGRect)frame 113 | { 114 | if ((self = [super initWithFrame:frame])) 115 | { 116 | self.autoresizesSubviews = NO; 117 | self.userInteractionEnabled = NO; 118 | self.contentMode = UIViewContentModeRedraw; 119 | self.autoresizingMask = UIViewAutoresizingFlexibleWidth; 120 | self.backgroundColor = [UIColor clearColor]; 121 | 122 | CAGradientLayer *layer = (CAGradientLayer *)self.layer; 123 | UIColor *blackColor = [UIColor colorWithWhite:0.24f alpha:1.0f]; 124 | UIColor *clearColor = [UIColor colorWithWhite:0.24f alpha:0.0f]; 125 | layer.colors = [NSArray arrayWithObjects:(id)blackColor.CGColor, (id)clearColor.CGColor, nil]; 126 | } 127 | 128 | return self; 129 | } 130 | 131 | @end 132 | -------------------------------------------------------------------------------- /PDFViewAndDownload/ScanViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScanViewController.h 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ScanViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PDFViewAndDownload/UIWebview加载PDF/PDFWebViewViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PDFWebViewViewController.h 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PDFWebViewViewController : UIViewController 12 | @property (nonatomic,copy) NSString *urlStr; 13 | @end 14 | -------------------------------------------------------------------------------- /PDFViewAndDownload/UIWebview加载PDF/PDFWebViewViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PDFWebViewViewController.m 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import "PDFWebViewViewController.h" 10 | #import "MBProgressHUD.h" 11 | #import "Masonry.h" 12 | 13 | @interface PDFWebViewViewController () 14 | 15 | @property (nonatomic,strong)UIWebView *myWebView; 16 | 17 | @end 18 | 19 | @implementation PDFWebViewViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | self.view.backgroundColor = [UIColor whiteColor]; 24 | 25 | [self creatUI]; 26 | } 27 | 28 | - (void)creatUI{ 29 | UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 30 | backBtn.frame = CGRectMake(10, 20, 60, 40); 31 | [backBtn setTitle:@"返回" forState:UIControlStateNormal]; 32 | [backBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal]; 33 | [backBtn addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside]; 34 | [self.view addSubview:backBtn]; 35 | 36 | [self.view addSubview:self.myWebView]; 37 | 38 | [self.myWebView mas_makeConstraints:^(MASConstraintMaker *make) { 39 | make.top.offset(60); 40 | make.left.right.bottom.offset(0); 41 | }]; 42 | 43 | NSURL *pathUrl = [NSURL URLWithString:self.urlStr]; 44 | NSURLRequest *request = [NSURLRequest requestWithURL:pathUrl]; 45 | 46 | [self.myWebView loadRequest:request]; 47 | //使文档的显示范围适合UIWebView的bounds 48 | [self.myWebView setScalesPageToFit:YES]; 49 | MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 50 | hud.label.text = @"正在加载中..."; 51 | 52 | } 53 | 54 | - (void)back:(UIButton *)sender{ 55 | [self dismissViewControllerAnimated:YES completion:nil]; 56 | } 57 | 58 | - (UIWebView *)myWebView{ 59 | if (!_myWebView) { 60 | _myWebView = [[UIWebView alloc] init]; 61 | _myWebView.backgroundColor = [UIColor whiteColor]; 62 | _myWebView.delegate = self; 63 | } 64 | return _myWebView; 65 | } 66 | 67 | - (void)webViewDidFinishLoad:(UIWebView *)webView{ 68 | [MBProgressHUD hideHUDForView:self.view animated:YES]; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /PDFViewAndDownload/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /PDFViewAndDownload/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "ScanViewController.h" 11 | #import "DownloadViewController.h" 12 | #import "Masonry.h" 13 | 14 | @interface ViewController () 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | [self creatUI]; 24 | } 25 | 26 | #pragma mark 创建UI 27 | - (void)creatUI{ 28 | UIButton *scanBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 29 | [scanBtn setBackgroundColor:[UIColor grayColor]]; 30 | [scanBtn setTitle:@"浏览" forState:UIControlStateNormal]; 31 | scanBtn.layer.cornerRadius = 2; 32 | [scanBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 33 | [scanBtn addTarget:self action:@selector(jumpToScanVC:) forControlEvents:UIControlEventTouchUpInside]; 34 | [self.view addSubview:scanBtn]; 35 | 36 | UIButton *downloadBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 37 | downloadBtn.hidden = YES; 38 | [downloadBtn setBackgroundColor:[UIColor purpleColor]]; 39 | [downloadBtn setTitle:@"下载" forState:UIControlStateNormal]; 40 | downloadBtn.layer.cornerRadius = 2; 41 | [downloadBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 42 | [downloadBtn addTarget:self action:@selector(jumpToDownloadVC:) forControlEvents:UIControlEventTouchUpInside]; 43 | [self.view addSubview:downloadBtn]; 44 | 45 | [scanBtn mas_makeConstraints:^(MASConstraintMaker *make) { 46 | make.centerX.equalTo(@0); 47 | make.width.equalTo(@200); 48 | make.height.equalTo(@40); 49 | make.top.offset(200); 50 | }]; 51 | 52 | [downloadBtn mas_makeConstraints:^(MASConstraintMaker *make) { 53 | make.centerX.equalTo(@0); 54 | make.width.equalTo(@200); 55 | make.height.equalTo(@40); 56 | make.top.equalTo(scanBtn.mas_bottom).offset(20); 57 | }]; 58 | 59 | } 60 | 61 | #pragma mark 跳到浏览器控制器 62 | - (void)jumpToScanVC:(UIButton *)sender{ 63 | ScanViewController *scanVC = [[ScanViewController alloc] init]; 64 | [self presentViewController:scanVC animated:YES completion:nil]; 65 | } 66 | 67 | #pragma amek 跳到下载控制器 68 | - (void)jumpToDownloadVC:(UIButton *)sender{ 69 | DownloadViewController *downloadVC = [[DownloadViewController alloc] init]; 70 | [self presentViewController:downloadVC animated:YES completion:nil]; 71 | 72 | } 73 | 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /PDFViewAndDownload/git-cheatsheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/git-cheatsheet.pdf -------------------------------------------------------------------------------- /PDFViewAndDownload/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PDFViewAndDownload 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /PDFViewAndDownload/pdf展示.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenglinyunshi/PDFViewAndDownload/c4ea949526023d2be3c6a4ed9cc3f5f2c9a18297/PDFViewAndDownload/pdf展示.gif -------------------------------------------------------------------------------- /PDFViewAndDownloadTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /PDFViewAndDownloadTests/PDFViewAndDownloadTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PDFViewAndDownloadTests.m 3 | // PDFViewAndDownloadTests 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PDFViewAndDownloadTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation PDFViewAndDownloadTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /PDFViewAndDownloadUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /PDFViewAndDownloadUITests/PDFViewAndDownloadUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PDFViewAndDownloadUITests.m 3 | // PDFViewAndDownloadUITests 4 | // 5 | // Created by Dustin on 17/4/6. 6 | // Copyright © 2017年 PicVision. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PDFViewAndDownloadUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation PDFViewAndDownloadUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | target 'PDFViewAndDownload' do 2 | 3 | pod 'Masonry', '~> 1.0.2' 4 | pod 'AFNetworking', '~> 2.6.0' 5 | pod 'MBProgressHUD', '~> 1.0.0' 6 | 7 | end 8 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.6.3): 3 | - AFNetworking/NSURLConnection (= 2.6.3) 4 | - AFNetworking/NSURLSession (= 2.6.3) 5 | - AFNetworking/Reachability (= 2.6.3) 6 | - AFNetworking/Security (= 2.6.3) 7 | - AFNetworking/Serialization (= 2.6.3) 8 | - AFNetworking/UIKit (= 2.6.3) 9 | - AFNetworking/NSURLConnection (2.6.3): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.6.3): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.6.3) 18 | - AFNetworking/Security (2.6.3) 19 | - AFNetworking/Serialization (2.6.3) 20 | - AFNetworking/UIKit (2.6.3): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | - Masonry (1.0.2) 24 | - MBProgressHUD (1.0.0) 25 | 26 | DEPENDENCIES: 27 | - AFNetworking (~> 2.6.0) 28 | - Masonry (~> 1.0.2) 29 | - MBProgressHUD (~> 1.0.0) 30 | 31 | SPEC CHECKSUMS: 32 | AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60 33 | Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e 34 | MBProgressHUD: 4890f671c94e8a0f3cf959aa731e9de2f036d71a 35 | 36 | PODFILE CHECKSUM: c36ca9a422c464b384cb3056af87fbeef6f7ddf1 37 | 38 | COCOAPODS: 1.1.1 39 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | // AFHTTPRequestOperation.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | #import "AFURLConnectionOperation.h" 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | /** 28 | `AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request. 29 | */ 30 | @interface AFHTTPRequestOperation : AFURLConnectionOperation 31 | 32 | ///------------------------------------------------ 33 | /// @name Getting HTTP URL Connection Information 34 | ///------------------------------------------------ 35 | 36 | /** 37 | The last HTTP response received by the operation's connection. 38 | */ 39 | @property (readonly, nonatomic, strong, nullable) NSHTTPURLResponse *response; 40 | 41 | /** 42 | Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an AFHTTPResponse serializer, which uses the raw data as its response object. The serializer validates the status code to be in the `2XX` range, denoting success. If the response serializer generates an error in `-responseObjectForResponse:data:error:`, the `failure` callback of the session task or request operation will be executed; otherwise, the `success` callback will be executed. 43 | 44 | @warning `responseSerializer` must not be `nil`. Setting a response serializer will clear out any cached value 45 | */ 46 | @property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; 47 | 48 | /** 49 | An object constructed by the `responseSerializer` from the response and response data. Returns `nil` unless the operation `isFinished`, has a `response`, and has `responseData` with non-zero content length. If an error occurs during serialization, `nil` will be returned, and the `error` property will be populated with the serialization error. 50 | */ 51 | @property (readonly, nonatomic, strong, nullable) id responseObject; 52 | 53 | ///----------------------------------------------------------- 54 | /// @name Setting Completion Block Success / Failure Callbacks 55 | ///----------------------------------------------------------- 56 | 57 | /** 58 | Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed. 59 | 60 | This method should be overridden in subclasses in order to specify the response object passed into the success block. 61 | 62 | @param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request. 63 | @param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request. 64 | */ 65 | - (void)setCompletionBlockWithSuccess:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success 66 | failure:(nullable void (^)(AFHTTPRequestOperation *operation, NSError *error))failure; 67 | 68 | @end 69 | 70 | NS_ASSUME_NONNULL_END 71 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | #import 25 | 26 | #ifndef _AFNETWORKING_ 27 | #define _AFNETWORKING_ 28 | 29 | #import "AFURLRequestSerialization.h" 30 | #import "AFURLResponseSerialization.h" 31 | #import "AFSecurityPolicy.h" 32 | #if !TARGET_OS_WATCH 33 | #import "AFNetworkReachabilityManager.h" 34 | #import "AFURLConnectionOperation.h" 35 | #import "AFHTTPRequestOperation.h" 36 | #import "AFHTTPRequestOperationManager.h" 37 | #endif 38 | 39 | #if ( ( defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || \ 40 | ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 ) || \ 41 | TARGET_OS_WATCH ) 42 | #import "AFURLSessionManager.h" 43 | #import "AFHTTPSessionManager.h" 44 | #endif 45 | 46 | #endif /* _AFNETWORKING_ */ 47 | -------------------------------------------------------------------------------- /Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | // AFNetworkActivityIndicatorManager.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | /** 33 | `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a network request operation has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. 34 | 35 | You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code: 36 | 37 | [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; 38 | 39 | By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself. 40 | 41 | See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: 42 | http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 43 | */ 44 | NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") 45 | @interface AFNetworkActivityIndicatorManager : NSObject 46 | 47 | /** 48 | A Boolean value indicating whether the manager is enabled. 49 | 50 | If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. 51 | */ 52 | @property (nonatomic, assign, getter = isEnabled) BOOL enabled; 53 | 54 | /** 55 | A Boolean value indicating whether the network activity indicator is currently displayed in the status bar. 56 | */ 57 | @property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible; 58 | 59 | /** 60 | Returns the shared network activity indicator manager object for the system. 61 | 62 | @return The systemwide network activity indicator manager. 63 | */ 64 | + (instancetype)sharedManager; 65 | 66 | /** 67 | Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. 68 | */ 69 | - (void)incrementActivityCount; 70 | 71 | /** 72 | Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. 73 | */ 74 | - (void)decrementActivityCount; 75 | 76 | @end 77 | 78 | NS_ASSUME_NONNULL_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | @class AFURLConnectionOperation; 31 | 32 | /** 33 | This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a request operation or session task. 34 | */ 35 | @interface UIActivityIndicatorView (AFNetworking) 36 | 37 | ///---------------------------------- 38 | /// @name Animating for Session Tasks 39 | ///---------------------------------- 40 | 41 | /** 42 | Binds the animating state to the state of the specified task. 43 | 44 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 45 | */ 46 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 47 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 48 | #endif 49 | 50 | ///--------------------------------------- 51 | /// @name Animating for Request Operations 52 | ///--------------------------------------- 53 | 54 | /** 55 | Binds the animating state to the execution state of the specified operation. 56 | 57 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 58 | */ 59 | - (void)setAnimatingWithStateOfOperation:(nullable AFURLConnectionOperation *)operation; 60 | 61 | @end 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AFNetworking.h 3 | // 4 | // 5 | // Created by Paulo Ferreira on 08/07/15. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #if TARGET_OS_IOS 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #import "AFNetworkActivityIndicatorManager.h" 30 | 31 | #import "UIActivityIndicatorView+AFNetworking.h" 32 | #import "UIAlertView+AFNetworking.h" 33 | #import "UIButton+AFNetworking.h" 34 | #import "UIImageView+AFNetworking.h" 35 | #import "UIProgressView+AFNetworking.h" 36 | #import "UIRefreshControl+AFNetworking.h" 37 | #import "UIWebView+AFNetworking.h" 38 | #endif /* _UIKIT_AFNETWORKING_ */ 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFURLConnectionOperation; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task or request operation. 36 | */ 37 | @interface UIProgressView (AFNetworking) 38 | 39 | ///------------------------------------ 40 | /// @name Setting Session Task Progress 41 | ///------------------------------------ 42 | 43 | /** 44 | Binds the progress to the upload progress of the specified session task. 45 | 46 | @param task The session task. 47 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 51 | animated:(BOOL)animated; 52 | #endif 53 | 54 | /** 55 | Binds the progress to the download progress of the specified session task. 56 | 57 | @param task The session task. 58 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 59 | */ 60 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 61 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 62 | animated:(BOOL)animated; 63 | #endif 64 | 65 | ///------------------------------------ 66 | /// @name Setting Session Task Progress 67 | ///------------------------------------ 68 | 69 | /** 70 | Binds the progress to the upload progress of the specified request operation. 71 | 72 | @param operation The request operation. 73 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 74 | */ 75 | - (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation 76 | animated:(BOOL)animated; 77 | 78 | /** 79 | Binds the progress to the download progress of the specified request operation. 80 | 81 | @param operation The request operation. 82 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 83 | */ 84 | - (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation 85 | animated:(BOOL)animated; 86 | 87 | @end 88 | 89 | NS_ASSUME_NONNULL_END 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2014 AFNetworking (http://afnetworking.com) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | #import 26 | 27 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 28 | 29 | #import 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | @class AFURLConnectionOperation; 34 | 35 | /** 36 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a request operation or session task. 37 | */ 38 | @interface UIRefreshControl (AFNetworking) 39 | 40 | ///----------------------------------- 41 | /// @name Refreshing for Session Tasks 42 | ///----------------------------------- 43 | 44 | /** 45 | Binds the refreshing state to the state of the specified task. 46 | 47 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 51 | #endif 52 | 53 | ///---------------------------------------- 54 | /// @name Refreshing for Request Operations 55 | ///---------------------------------------- 56 | 57 | /** 58 | Binds the refreshing state to the execution state of the specified operation. 59 | 60 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 61 | */ 62 | - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation; 63 | 64 | @end 65 | 66 | NS_ASSUME_NONNULL_END 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLConnectionOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MBProgressHUD/MBProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../MBProgressHUD/MBProgressHUD.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPRequestOperationManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLConnectionOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLConnectionOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MBProgressHUD/MBProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../MBProgressHUD/MBProgressHUD.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Pods/MBProgressHUD/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright © 2009-2016 Matej Bukovinski 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.6.3): 3 | - AFNetworking/NSURLConnection (= 2.6.3) 4 | - AFNetworking/NSURLSession (= 2.6.3) 5 | - AFNetworking/Reachability (= 2.6.3) 6 | - AFNetworking/Security (= 2.6.3) 7 | - AFNetworking/Serialization (= 2.6.3) 8 | - AFNetworking/UIKit (= 2.6.3) 9 | - AFNetworking/NSURLConnection (2.6.3): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.6.3): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.6.3) 18 | - AFNetworking/Security (2.6.3) 19 | - AFNetworking/Serialization (2.6.3) 20 | - AFNetworking/UIKit (2.6.3): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | - Masonry (1.0.2) 24 | - MBProgressHUD (1.0.0) 25 | 26 | DEPENDENCIES: 27 | - AFNetworking (~> 2.6.0) 28 | - Masonry (~> 1.0.2) 29 | - MBProgressHUD (~> 1.0.0) 30 | 31 | SPEC CHECKSUMS: 32 | AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60 33 | Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e 34 | MBProgressHUD: 4890f671c94e8a0f3cf959aa731e9de2f036d71a 35 | 36 | PODFILE CHECKSUM: c36ca9a422c464b384cb3056af87fbeef6f7ddf1 37 | 38 | COCOAPODS: 1.1.1 39 | -------------------------------------------------------------------------------- /Pods/Masonry/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | /** 13 | * A group of MASConstraint objects 14 | */ 15 | @interface MASCompositeConstraint : MASConstraint 16 | 17 | /** 18 | * Creates a composite with a predefined array of children 19 | * 20 | * @param children child MASConstraints 21 | * 22 | * @return a composite constraint 23 | */ 24 | - (id)initWithChildren:(NSArray *)children; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint+Private.h 3 | // Masonry 4 | // 5 | // Created by Nick Tymchenko on 29/04/14. 6 | // Copyright (c) 2014 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | 11 | @protocol MASConstraintDelegate; 12 | 13 | 14 | @interface MASConstraint () 15 | 16 | /** 17 | * Whether or not to check for an existing constraint instead of adding constraint 18 | */ 19 | @property (nonatomic, assign) BOOL updateExisting; 20 | 21 | /** 22 | * Usually MASConstraintMaker but could be a parent MASConstraint 23 | */ 24 | @property (nonatomic, weak) id delegate; 25 | 26 | /** 27 | * Based on a provided value type, is equal to calling: 28 | * NSNumber - setOffset: 29 | * NSValue with CGPoint - setPointOffset: 30 | * NSValue with CGSize - setSizeOffset: 31 | * NSValue with MASEdgeInsets - setInsets: 32 | */ 33 | - (void)setLayoutConstantWithValue:(NSValue *)value; 34 | 35 | @end 36 | 37 | 38 | @interface MASConstraint (Abstract) 39 | 40 | /** 41 | * Sets the constraint relation to given NSLayoutRelation 42 | * returns a block which accepts one of the following: 43 | * MASViewAttribute, UIView, NSValue, NSArray 44 | * see readme for more details. 45 | */ 46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; 47 | 48 | /** 49 | * Override to set a custom chaining behaviour 50 | */ 51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 52 | 53 | @end 54 | 55 | 56 | @protocol MASConstraintDelegate 57 | 58 | /** 59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example 60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks 61 | */ 62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; 63 | 64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * When you are debugging or printing the constraints attached to a view this subclass 13 | * makes it easier to identify which constraints have been created via Masonry 14 | */ 15 | @interface MASLayoutConstraint : NSLayoutConstraint 16 | 17 | /** 18 | * a key to associate with this constraint 19 | */ 20 | @property (nonatomic, strong) id mas_key; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASLayoutConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASLayoutConstraint.h" 10 | 11 | @implementation MASLayoutConstraint 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * An immutable tuple which stores the view and the related NSLayoutAttribute. 13 | * Describes part of either the left or right hand side of a constraint equation 14 | */ 15 | @interface MASViewAttribute : NSObject 16 | 17 | /** 18 | * The view which the reciever relates to. Can be nil if item is not a view. 19 | */ 20 | @property (nonatomic, weak, readonly) MAS_VIEW *view; 21 | 22 | /** 23 | * The item which the reciever relates to. 24 | */ 25 | @property (nonatomic, weak, readonly) id item; 26 | 27 | /** 28 | * The attribute which the reciever relates to 29 | */ 30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; 31 | 32 | /** 33 | * Convenience initializer. 34 | */ 35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; 36 | 37 | /** 38 | * The designated initializer. 39 | */ 40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; 41 | 42 | /** 43 | * Determine whether the layoutAttribute is a size attribute 44 | * 45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight 46 | */ 47 | - (BOOL)isSizeAttribute; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | 11 | @implementation MASViewAttribute 12 | 13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { 14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; 15 | return self; 16 | } 17 | 18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { 19 | self = [super init]; 20 | if (!self) return nil; 21 | 22 | _view = view; 23 | _item = item; 24 | _layoutAttribute = layoutAttribute; 25 | 26 | return self; 27 | } 28 | 29 | - (BOOL)isSizeAttribute { 30 | return self.layoutAttribute == NSLayoutAttributeWidth 31 | || self.layoutAttribute == NSLayoutAttributeHeight; 32 | } 33 | 34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute { 35 | if ([viewAttribute isKindOfClass:self.class]) { 36 | return self.view == viewAttribute.view 37 | && self.layoutAttribute == viewAttribute.layoutAttribute; 38 | } 39 | return [super isEqual:viewAttribute]; 40 | } 41 | 42 | - (NSUInteger)hash { 43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | #import "MASUtilities.h" 13 | 14 | /** 15 | * A single constraint. 16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view 17 | */ 18 | @interface MASViewConstraint : MASConstraint 19 | 20 | /** 21 | * First item/view and first attribute of the NSLayoutConstraint 22 | */ 23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; 24 | 25 | /** 26 | * Second item/view and second attribute of the NSLayoutConstraint 27 | */ 28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; 29 | 30 | /** 31 | * initialises the MASViewConstraint with the first part of the equation 32 | * 33 | * @param firstViewAttribute view.mas_left, view.mas_width etc. 34 | * 35 | * @return a new view constraint 36 | */ 37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; 38 | 39 | /** 40 | * Returns all MASViewConstraints installed with this view as a first item. 41 | * 42 | * @param view A view to retrieve constraints for. 43 | * 44 | * @return An array of MASViewConstraints. 45 | */ 46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Masonry.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Masonry. 12 | FOUNDATION_EXPORT double MasonryVersionNumber; 13 | 14 | //! Project version string for Masonry. 15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 16 | 17 | #import "MASUtilities.h" 18 | #import "View+MASAdditions.h" 19 | #import "View+MASShorthandAdditions.h" 20 | #import "ViewController+MASAdditions.h" 21 | #import "NSArray+MASAdditions.h" 22 | #import "NSArray+MASShorthandAdditions.h" 23 | #import "MASConstraint.h" 24 | #import "MASCompositeConstraint.h" 25 | #import "MASViewAttribute.h" 26 | #import "MASViewConstraint.h" 27 | #import "MASConstraintMaker.h" 28 | #import "MASLayoutConstraint.h" 29 | #import "NSLayoutConstraint+MASDebugAdditions.h" 30 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.h 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | typedef NS_ENUM(NSUInteger, MASAxisType) { 14 | MASAxisTypeHorizontal, 15 | MASAxisTypeVertical 16 | }; 17 | 18 | @interface NSArray (MASAdditions) 19 | 20 | /** 21 | * Creates a MASConstraintMaker with each view in the callee. 22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view 23 | * 24 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 25 | * 26 | * @return Array of created MASConstraints 27 | */ 28 | - (NSArray *)mas_makeConstraints:(void (^)(MASConstraintMaker *make))block; 29 | 30 | /** 31 | * Creates a MASConstraintMaker with each view in the callee. 32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 33 | * If an existing constraint exists then it will be updated instead. 34 | * 35 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 36 | * 37 | * @return Array of created/updated MASConstraints 38 | */ 39 | - (NSArray *)mas_updateConstraints:(void (^)(MASConstraintMaker *make))block; 40 | 41 | /** 42 | * Creates a MASConstraintMaker with each view in the callee. 43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 44 | * All constraints previously installed for the views will be removed. 45 | * 46 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 47 | * 48 | * @return Array of created/updated MASConstraints 49 | */ 50 | - (NSArray *)mas_remakeConstraints:(void (^)(MASConstraintMaker *make))block; 51 | 52 | /** 53 | * distribute with fixed spacing 54 | * 55 | * @param axisType which axis to distribute items along 56 | * @param fixedSpacing the spacing between each item 57 | * @param leadSpacing the spacing before the first item and the container 58 | * @param tailSpacing the spacing after the last item and the container 59 | */ 60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 61 | 62 | /** 63 | * distribute with fixed item size 64 | * 65 | * @param axisType which axis to distribute items along 66 | * @param fixedItemLength the fixed length of each item 67 | * @param leadSpacing the spacing before the first item and the container 68 | * @param tailSpacing the spacing after the last item and the container 69 | */ 70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand array additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface NSArray (MASShorthandAdditions) 18 | 19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 22 | 23 | @end 24 | 25 | @implementation NSArray (MASShorthandAdditions) 26 | 27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 28 | return [self mas_makeConstraints:block]; 29 | } 30 | 31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 32 | return [self mas_updateConstraints:block]; 33 | } 34 | 35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 36 | return [self mas_remakeConstraints:block]; 37 | } 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * makes debug and log output of NSLayoutConstraints more readable 13 | */ 14 | @interface NSLayoutConstraint (MASDebugAdditions) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | /** 14 | * Provides constraint maker block 15 | * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs 16 | */ 17 | @interface MAS_VIEW (MASAdditions) 18 | 19 | /** 20 | * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute 21 | */ 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_left; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_top; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_right; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_width; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_height; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; 31 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; 32 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; 33 | @property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); 34 | 35 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 36 | 37 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline; 38 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline; 39 | 40 | #endif 41 | 42 | #if TARGET_OS_IPHONE || TARGET_OS_TV 43 | 44 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; 49 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; 50 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; 51 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; 52 | 53 | #endif 54 | 55 | /** 56 | * a key to associate with this view 57 | */ 58 | @property (nonatomic, strong) id mas_key; 59 | 60 | /** 61 | * Finds the closest common superview between this view and another view 62 | * 63 | * @param view other view 64 | * 65 | * @return returns nil if common superview could not be found 66 | */ 67 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; 68 | 69 | /** 70 | * Creates a MASConstraintMaker with the callee view. 71 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing 72 | * 73 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 74 | * 75 | * @return Array of created MASConstraints 76 | */ 77 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block; 78 | 79 | /** 80 | * Creates a MASConstraintMaker with the callee view. 81 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 82 | * If an existing constraint exists then it will be updated instead. 83 | * 84 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 85 | * 86 | * @return Array of created/updated MASConstraints 87 | */ 88 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block; 89 | 90 | /** 91 | * Creates a MASConstraintMaker with the callee view. 92 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 93 | * All constraints previously installed for the view will be removed. 94 | * 95 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 96 | * 97 | * @return Array of created/updated MASConstraints 98 | */ 99 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block; 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "View+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand view additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface MAS_VIEW (MASShorthandAdditions) 18 | 19 | @property (nonatomic, strong, readonly) MASViewAttribute *left; 20 | @property (nonatomic, strong, readonly) MASViewAttribute *top; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *right; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *bottom; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *leading; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *trailing; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *width; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *height; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *centerX; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *centerY; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *baseline; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr); 31 | 32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 33 | 34 | @property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline; 35 | @property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline; 36 | 37 | #endif 38 | 39 | #if TARGET_OS_IPHONE || TARGET_OS_TV 40 | 41 | @property (nonatomic, strong, readonly) MASViewAttribute *leftMargin; 42 | @property (nonatomic, strong, readonly) MASViewAttribute *rightMargin; 43 | @property (nonatomic, strong, readonly) MASViewAttribute *topMargin; 44 | @property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins; 49 | 50 | #endif 51 | 52 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 53 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 54 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 55 | 56 | @end 57 | 58 | #define MAS_ATTR_FORWARD(attr) \ 59 | - (MASViewAttribute *)attr { \ 60 | return [self mas_##attr]; \ 61 | } 62 | 63 | @implementation MAS_VIEW (MASShorthandAdditions) 64 | 65 | MAS_ATTR_FORWARD(top); 66 | MAS_ATTR_FORWARD(left); 67 | MAS_ATTR_FORWARD(bottom); 68 | MAS_ATTR_FORWARD(right); 69 | MAS_ATTR_FORWARD(leading); 70 | MAS_ATTR_FORWARD(trailing); 71 | MAS_ATTR_FORWARD(width); 72 | MAS_ATTR_FORWARD(height); 73 | MAS_ATTR_FORWARD(centerX); 74 | MAS_ATTR_FORWARD(centerY); 75 | MAS_ATTR_FORWARD(baseline); 76 | 77 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 78 | 79 | MAS_ATTR_FORWARD(firstBaseline); 80 | MAS_ATTR_FORWARD(lastBaseline); 81 | 82 | #endif 83 | 84 | #if TARGET_OS_IPHONE || TARGET_OS_TV 85 | 86 | MAS_ATTR_FORWARD(leftMargin); 87 | MAS_ATTR_FORWARD(rightMargin); 88 | MAS_ATTR_FORWARD(topMargin); 89 | MAS_ATTR_FORWARD(bottomMargin); 90 | MAS_ATTR_FORWARD(leadingMargin); 91 | MAS_ATTR_FORWARD(trailingMargin); 92 | MAS_ATTR_FORWARD(centerXWithinMargins); 93 | MAS_ATTR_FORWARD(centerYWithinMargins); 94 | 95 | #endif 96 | 97 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute { 98 | return [self mas_attribute]; 99 | } 100 | 101 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 102 | return [self mas_makeConstraints:block]; 103 | } 104 | 105 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 106 | return [self mas_updateConstraints:block]; 107 | } 108 | 109 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 110 | return [self mas_remakeConstraints:block]; 111 | } 112 | 113 | @end 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | #ifdef MAS_VIEW_CONTROLLER 14 | 15 | @interface MAS_VIEW_CONTROLLER (MASAdditions) 16 | 17 | /** 18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute 19 | */ 20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; 26 | 27 | 28 | @end 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/ViewController+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.m 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "ViewController+MASAdditions.h" 10 | 11 | #ifdef MAS_VIEW_CONTROLLER 12 | 13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions) 14 | 15 | - (MASViewAttribute *)mas_topLayoutGuide { 16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 17 | } 18 | - (MASViewAttribute *)mas_topLayoutGuideTop { 19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 20 | } 21 | - (MASViewAttribute *)mas_topLayoutGuideBottom { 22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 23 | } 24 | 25 | - (MASViewAttribute *)mas_bottomLayoutGuide { 26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 27 | } 28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop { 29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 30 | } 31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom { 32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 33 | } 34 | 35 | 36 | 37 | @end 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/Dustin.xcuserdatad/xcschemes/AFNetworking.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/Dustin.xcuserdatad/xcschemes/MBProgressHUD.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/Dustin.xcuserdatad/xcschemes/Masonry.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/Dustin.xcuserdatad/xcschemes/Pods-PDFViewAndDownload.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/Dustin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AFNetworking.xcscheme 8 | 9 | isShown 10 | 11 | 12 | MBProgressHUD.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Masonry.xcscheme 18 | 19 | isShown 20 | 21 | 22 | Pods-PDFViewAndDownload.xcscheme 23 | 24 | isShown 25 | 26 | 27 | 28 | SuppressBuildableAutocreation 29 | 30 | 586F2DFA9BDCC6675C2546793A69E5CC 31 | 32 | primary 33 | 34 | 35 | 70AC4EBB9D81C8155B3CD8EB6E89B47F 36 | 37 | primary 38 | 39 | 40 | 9DC8D9E02903E93BD0B2FEC9D846EA20 41 | 42 | primary 43 | 44 | 45 | AFAFB55453D161D2BB5CFB30C68A54D5 46 | 47 | primary 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #ifndef TARGET_OS_IOS 6 | #define TARGET_OS_IOS TARGET_OS_IPHONE 7 | #endif 8 | 9 | #ifndef TARGET_OS_WATCH 10 | #define TARGET_OS_WATCH 0 11 | #endif 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AFNetworking 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/Masonry" 4 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MBProgressHUD : NSObject 3 | @end 4 | @implementation PodsDummy_MBProgressHUD 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MBProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/Masonry" 4 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "QuartzCore" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Masonry : NSObject 3 | @end 4 | @implementation PodsDummy_Masonry 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Masonry 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/Masonry" 4 | OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PDFViewAndDownload/Pods-PDFViewAndDownload-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## MBProgressHUD 28 | 29 | Copyright © 2009-2016 Matej Bukovinski 30 | 31 | Permission is hereby granted, free of charge, to any person obtaining a copy 32 | of this software and associated documentation files (the "Software"), to deal 33 | in the Software without restriction, including without limitation the rights 34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 35 | copies of the Software, and to permit persons to whom the Software is 36 | furnished to do so, subject to the following conditions: 37 | 38 | The above copyright notice and this permission notice shall be included in 39 | all copies or substantial portions of the Software. 40 | 41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 47 | THE SOFTWARE. 48 | 49 | ## Masonry 50 | 51 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 52 | 53 | Permission is hereby granted, free of charge, to any person obtaining a copy 54 | of this software and associated documentation files (the "Software"), to deal 55 | in the Software without restriction, including without limitation the rights 56 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 57 | copies of the Software, and to permit persons to whom the Software is 58 | furnished to do so, subject to the following conditions: 59 | 60 | The above copyright notice and this permission notice shall be included in 61 | all copies or substantial portions of the Software. 62 | 63 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 64 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 65 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 66 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 67 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 68 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 69 | THE SOFTWARE. 70 | Generated by CocoaPods - https://cocoapods.org 71 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PDFViewAndDownload/Pods-PDFViewAndDownload-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_PDFViewAndDownload : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_PDFViewAndDownload 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PDFViewAndDownload/Pods-PDFViewAndDownload-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PDFViewAndDownload/Pods-PDFViewAndDownload.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/Masonry" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD" "$PODS_CONFIGURATION_BUILD_DIR/Masonry" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/Masonry" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"MBProgressHUD" -l"Masonry" -framework "CoreGraphics" -framework "Foundation" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-PDFViewAndDownload/Pods-PDFViewAndDownload.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/Masonry" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD" "$PODS_CONFIGURATION_BUILD_DIR/Masonry" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/Masonry" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"MBProgressHUD" -l"Masonry" -framework "CoreGraphics" -framework "Foundation" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PDFViewAndDownload 2 | 具体展示如下: 3 | 4 | ![image](https://github.com/fenglinyunshi/PDFViewAndDownload/blob/master/PDFViewAndDownload/pdf展示.gif) 5 | --------------------------------------------------------------------------------