├── .gitignore ├── MBVideoPlayer.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── MBVideoPlayer.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── MBVideoPlayer ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── play_button.imageset │ │ ├── Contents.json │ │ └── icons8-play-button-50.png │ ├── vide_douyin.imageset │ │ ├── Contents.json │ │ ├── jp_videoplayer_douyin@2x.png │ │ └── jp_videoplayer_douyin@3x.png │ ├── video_douyin_selected.imageset │ │ ├── Contents.json │ │ ├── jp_videoplayer_douyin_selected@2x.png │ │ └── jp_videoplayer_douyin_selected@3x.png │ ├── video_setting.imageset │ │ ├── Contents.json │ │ ├── jp_videoplayer_setting@2x.png │ │ └── jp_videoplayer_setting@3x.png │ └── video_setting_selected.imageset │ │ ├── Contents.json │ │ ├── jp_videoplayer_setting_selected@2x.png │ │ └── jp_videoplayer_setting_selected@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Controller │ ├── MBSettingViewController.h │ ├── MBSettingViewController.m │ ├── ViewController.h │ └── ViewController.m ├── Info.plist ├── Model │ ├── MBURLTaskModel.h │ ├── MBURLTaskModel.m │ ├── MBVideoModel.h │ └── MBVideoModel.m ├── Other │ ├── MBAVAssetResourceLoader.h │ ├── MBAVAssetResourceLoader.m │ ├── MBFileManager.h │ ├── MBFileManager.m │ ├── MBNetworkManager.h │ └── MBNetworkManager.m ├── View │ ├── MBPlayerView.h │ ├── MBPlayerView.m │ ├── MBScrollView.h │ ├── MBScrollView.m │ ├── MBToastLabelView.h │ └── MBToastLabelView.m └── main.m ├── MBVideoPlayerTests ├── Info.plist └── MBVideoPlayerTests.m ├── MBVideoPlayerUITests ├── Info.plist └── MBVideoPlayerUITests.m ├── Podfile ├── Podfile.lock ├── Pods ├── CYLTabBarController │ ├── CYLTabBarController │ │ ├── CYLConstants.h │ │ ├── CYLPlusButton.h │ │ ├── CYLPlusButton.m │ │ ├── CYLTabBar.h │ │ ├── CYLTabBar.m │ │ ├── CYLTabBarController.h │ │ ├── CYLTabBarController.m │ │ ├── UIControl+CYLTabBarControllerExtention.h │ │ ├── UIControl+CYLTabBarControllerExtention.m │ │ ├── UITabBarItem+CYLTabBarControllerExtention.h │ │ ├── UITabBarItem+CYLTabBarControllerExtention.m │ │ ├── UIView+CYLTabBarControllerExtention.h │ │ ├── UIView+CYLTabBarControllerExtention.m │ │ ├── UIViewController+CYLTabBarControllerExtention.h │ │ └── UIViewController+CYLTabBarControllerExtention.m │ ├── LICENSE │ └── README.md ├── Headers │ ├── Private │ │ ├── CYLTabBarController │ │ │ ├── CYLConstants.h │ │ │ ├── CYLPlusButton.h │ │ │ ├── CYLTabBar.h │ │ │ ├── CYLTabBarController.h │ │ │ ├── UIControl+CYLTabBarControllerExtention.h │ │ │ ├── UITabBarItem+CYLTabBarControllerExtention.h │ │ │ ├── UIView+CYLTabBarControllerExtention.h │ │ │ └── UIViewController+CYLTabBarControllerExtention.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 │ │ └── SDWebImage │ │ │ ├── NSButton+WebCache.h │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── NSImage+WebCache.h │ │ │ ├── SDAnimatedImageRep.h │ │ │ ├── SDImageCache.h │ │ │ ├── SDImageCacheConfig.h │ │ │ ├── SDWebImageCoder.h │ │ │ ├── SDWebImageCoderHelper.h │ │ │ ├── SDWebImageCodersManager.h │ │ │ ├── SDWebImageCompat.h │ │ │ ├── SDWebImageDownloader.h │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ ├── SDWebImageFrame.h │ │ │ ├── SDWebImageGIFCoder.h │ │ │ ├── SDWebImageImageIOCoder.h │ │ │ ├── SDWebImageManager.h │ │ │ ├── SDWebImageOperation.h │ │ │ ├── SDWebImagePrefetcher.h │ │ │ ├── SDWebImageTransition.h │ │ │ ├── UIButton+WebCache.h │ │ │ ├── UIImage+ForceDecode.h │ │ │ ├── UIImage+GIF.h │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── UIImageView+HighlightedWebCache.h │ │ │ ├── UIImageView+WebCache.h │ │ │ ├── UIView+WebCache.h │ │ │ └── UIView+WebCacheOperation.h │ └── Public │ │ ├── CYLTabBarController │ │ ├── CYLConstants.h │ │ ├── CYLPlusButton.h │ │ ├── CYLTabBar.h │ │ ├── CYLTabBarController.h │ │ ├── UIControl+CYLTabBarControllerExtention.h │ │ ├── UITabBarItem+CYLTabBarControllerExtention.h │ │ ├── UIView+CYLTabBarControllerExtention.h │ │ └── UIViewController+CYLTabBarControllerExtention.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 │ │ └── SDWebImage │ │ ├── NSButton+WebCache.h │ │ ├── NSData+ImageContentType.h │ │ ├── NSImage+WebCache.h │ │ ├── SDAnimatedImageRep.h │ │ ├── SDImageCache.h │ │ ├── SDImageCacheConfig.h │ │ ├── SDWebImageCoder.h │ │ ├── SDWebImageCoderHelper.h │ │ ├── SDWebImageCodersManager.h │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageFrame.h │ │ ├── SDWebImageGIFCoder.h │ │ ├── SDWebImageImageIOCoder.h │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── SDWebImageTransition.h │ │ ├── UIButton+WebCache.h │ │ ├── UIImage+ForceDecode.h │ │ ├── UIImage+GIF.h │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+WebCache.h │ │ ├── UIView+WebCache.h │ │ └── UIView+WebCacheOperation.h ├── 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 ├── SDWebImage │ ├── LICENSE │ ├── README.md │ └── SDWebImage │ │ ├── NSButton+WebCache.h │ │ ├── NSButton+WebCache.m │ │ ├── NSData+ImageContentType.h │ │ ├── NSData+ImageContentType.m │ │ ├── NSImage+WebCache.h │ │ ├── NSImage+WebCache.m │ │ ├── SDAnimatedImageRep.h │ │ ├── SDAnimatedImageRep.m │ │ ├── SDImageCache.h │ │ ├── SDImageCache.m │ │ ├── SDImageCacheConfig.h │ │ ├── SDImageCacheConfig.m │ │ ├── SDWebImageCoder.h │ │ ├── SDWebImageCoder.m │ │ ├── SDWebImageCoderHelper.h │ │ ├── SDWebImageCoderHelper.m │ │ ├── SDWebImageCodersManager.h │ │ ├── SDWebImageCodersManager.m │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageCompat.m │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloader.m │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageDownloaderOperation.m │ │ ├── SDWebImageFrame.h │ │ ├── SDWebImageFrame.m │ │ ├── SDWebImageGIFCoder.h │ │ ├── SDWebImageGIFCoder.m │ │ ├── SDWebImageImageIOCoder.h │ │ ├── SDWebImageImageIOCoder.m │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageManager.m │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── SDWebImagePrefetcher.m │ │ ├── SDWebImageTransition.h │ │ ├── SDWebImageTransition.m │ │ ├── UIButton+WebCache.h │ │ ├── UIButton+WebCache.m │ │ ├── UIImage+ForceDecode.h │ │ ├── UIImage+ForceDecode.m │ │ ├── UIImage+GIF.h │ │ ├── UIImage+GIF.m │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImage+MultiFormat.m │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+HighlightedWebCache.m │ │ ├── UIImageView+WebCache.h │ │ ├── UIImageView+WebCache.m │ │ ├── UIView+WebCache.h │ │ ├── UIView+WebCache.m │ │ ├── UIView+WebCacheOperation.h │ │ └── UIView+WebCacheOperation.m └── Target Support Files │ ├── CYLTabBarController │ ├── CYLTabBarController-dummy.m │ ├── CYLTabBarController-prefix.pch │ └── CYLTabBarController.xcconfig │ ├── Masonry │ ├── Masonry-dummy.m │ ├── Masonry-prefix.pch │ └── Masonry.xcconfig │ ├── Pods-MBVideoPlayer │ ├── Pods-MBVideoPlayer-acknowledgements.markdown │ ├── Pods-MBVideoPlayer-acknowledgements.plist │ ├── Pods-MBVideoPlayer-dummy.m │ ├── Pods-MBVideoPlayer-frameworks.sh │ ├── Pods-MBVideoPlayer-resources.sh │ ├── Pods-MBVideoPlayer.debug.xcconfig │ └── Pods-MBVideoPlayer.release.xcconfig │ └── SDWebImage │ ├── SDWebImage-dummy.m │ ├── SDWebImage-prefix.pch │ └── SDWebImage.xcconfig ├── README.md └── ReadMeImage ├── avplayerprocess.png ├── avplayerresourceLoader.png ├── preview.gif ├── project.png └── unlimitscroll.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots/**/*.png 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /MBVideoPlayer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MBVideoPlayer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MBVideoPlayer.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MBVideoPlayer.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MBVideoPlayer/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/8. 6 | // Copyright © 2018年 chenda. 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 | -------------------------------------------------------------------------------- /MBVideoPlayer/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/8. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "CYLTabBarController.h" 11 | 12 | #import "ViewController.h" 13 | #import "MBSettingViewController.h" 14 | 15 | 16 | @interface AppDelegate () 17 | 18 | @property (nonatomic) CYLTabBarController *tabBarController; 19 | 20 | @end 21 | 22 | @implementation AppDelegate 23 | 24 | 25 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 26 | // Override point for customization after application launch. 27 | [self setupViewControllers]; //配置UITabBarViewController 28 | 29 | self.window = [[UIWindow alloc] init]; 30 | self.window.frame = [UIScreen mainScreen].bounds; 31 | [self.window setRootViewController:self.tabBarController]; 32 | [self.window makeKeyAndVisible]; 33 | 34 | [self customizeTabBar]; //自定义tabBar的样式 35 | 36 | return YES; 37 | } 38 | 39 | 40 | - (void)applicationWillResignActive:(UIApplication *)application { 41 | // 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. 42 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 43 | } 44 | 45 | 46 | - (void)applicationDidEnterBackground:(UIApplication *)application { 47 | // 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. 48 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 49 | } 50 | 51 | 52 | - (void)applicationWillEnterForeground:(UIApplication *)application { 53 | // 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. 54 | } 55 | 56 | 57 | - (void)applicationDidBecomeActive:(UIApplication *)application { 58 | // 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. 59 | } 60 | 61 | 62 | - (void)applicationWillTerminate:(UIApplication *)application { 63 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 64 | } 65 | 66 | - (void)setupViewControllers { 67 | ViewController *firstViewController = [[ViewController alloc] init]; 68 | MBSettingViewController *secondViewController = [[MBSettingViewController alloc] init]; 69 | 70 | self.tabBarController = [[CYLTabBarController alloc] init]; 71 | 72 | [self customizeTabBarForController:self.tabBarController]; 73 | 74 | [self.tabBarController setViewControllers:@[firstViewController, secondViewController]]; 75 | } 76 | 77 | - (void)customizeTabBarForController:(CYLTabBarController *)tabBarController { 78 | NSDictionary *dic1 = @{CYLTabBarItemTitle: @"首页", CYLTabBarItemImage: @"vide_douyin", CYLTabBarItemSelectedImage: @"video_douyin_selected"}; 79 | NSDictionary *dic2 = @{CYLTabBarItemTitle: @"设置", CYLTabBarItemImage: @"video_setting", CYLTabBarItemSelectedImage: @"video_setting_selected"}; 80 | 81 | NSArray *tabBarItemsAttributes = @[dic1, dic2]; 82 | tabBarController.tabBarItemsAttributes = tabBarItemsAttributes; 83 | } 84 | 85 | - (UIImage*)createImageWithColor:(UIColor*)color { 86 | CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); 87 | UIGraphicsBeginImageContext(rect.size); 88 | CGContextRef context = UIGraphicsGetCurrentContext(); 89 | CGContextSetFillColorWithColor(context, [color CGColor]); 90 | CGContextFillRect(context, rect); 91 | UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext(); 92 | UIGraphicsEndImageContext(); 93 | return theImage; 94 | } 95 | 96 | - (void)customizeTabBar { 97 | [[UITabBar appearance] setBackgroundImage:[self createImageWithColor:[UIColor clearColor]]]; 98 | 99 | NSMutableDictionary *normalAttrs = [NSMutableDictionary dictionary]; 100 | normalAttrs[NSForegroundColorAttributeName] = [UIColor grayColor]; 101 | 102 | NSMutableDictionary *selectedAttrs = [NSMutableDictionary dictionary]; 103 | selectedAttrs[NSForegroundColorAttributeName] = [UIColor blackColor]; 104 | 105 | UITabBarItem *tabBar = [UITabBarItem appearance]; 106 | [tabBar setTitleTextAttributes:normalAttrs forState:UIControlStateNormal]; 107 | [tabBar setTitleTextAttributes:selectedAttrs forState:UIControlStateSelected]; 108 | } 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/play_button.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icons8-play-button-50.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/play_button.imageset/icons8-play-button-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/MBVideoPlayer/Assets.xcassets/play_button.imageset/icons8-play-button-50.png -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/vide_douyin.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "jp_videoplayer_douyin@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "jp_videoplayer_douyin@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/vide_douyin.imageset/jp_videoplayer_douyin@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/MBVideoPlayer/Assets.xcassets/vide_douyin.imageset/jp_videoplayer_douyin@2x.png -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/vide_douyin.imageset/jp_videoplayer_douyin@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/MBVideoPlayer/Assets.xcassets/vide_douyin.imageset/jp_videoplayer_douyin@3x.png -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/video_douyin_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "jp_videoplayer_douyin_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "jp_videoplayer_douyin_selected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/video_douyin_selected.imageset/jp_videoplayer_douyin_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/MBVideoPlayer/Assets.xcassets/video_douyin_selected.imageset/jp_videoplayer_douyin_selected@2x.png -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/video_douyin_selected.imageset/jp_videoplayer_douyin_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/MBVideoPlayer/Assets.xcassets/video_douyin_selected.imageset/jp_videoplayer_douyin_selected@3x.png -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/video_setting.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "jp_videoplayer_setting@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "jp_videoplayer_setting@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/video_setting.imageset/jp_videoplayer_setting@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/MBVideoPlayer/Assets.xcassets/video_setting.imageset/jp_videoplayer_setting@2x.png -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/video_setting.imageset/jp_videoplayer_setting@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/MBVideoPlayer/Assets.xcassets/video_setting.imageset/jp_videoplayer_setting@3x.png -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/video_setting_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "jp_videoplayer_setting_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "jp_videoplayer_setting_selected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/video_setting_selected.imageset/jp_videoplayer_setting_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/MBVideoPlayer/Assets.xcassets/video_setting_selected.imageset/jp_videoplayer_setting_selected@2x.png -------------------------------------------------------------------------------- /MBVideoPlayer/Assets.xcassets/video_setting_selected.imageset/jp_videoplayer_setting_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/MBVideoPlayer/Assets.xcassets/video_setting_selected.imageset/jp_videoplayer_setting_selected@3x.png -------------------------------------------------------------------------------- /MBVideoPlayer/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 | -------------------------------------------------------------------------------- /MBVideoPlayer/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 | -------------------------------------------------------------------------------- /MBVideoPlayer/Controller/MBSettingViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBSettingViewController.h 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/14. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBSettingViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MBVideoPlayer/Controller/MBSettingViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBSettingViewController.m 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/14. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import "MBSettingViewController.h" 10 | 11 | #import "Masonry.h" 12 | 13 | #import "MBFileManager.h" 14 | #import "MBToastLabelView.h" 15 | #import "MBNetworkManager.h" 16 | 17 | @interface MBSettingViewController () 18 | 19 | @property (nonatomic) UIButton *clearCacheButton; 20 | @property (nonatomic) UILabel *cacheSizeLabel; 21 | 22 | @end 23 | 24 | @implementation MBSettingViewController 25 | #pragma mark - Lifecycle 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | // Do any additional setup after loading the view. 30 | [self setupUI]; 31 | } 32 | 33 | - (void)viewWillAppear:(BOOL)animated { 34 | [super viewWillAppear:animated]; 35 | 36 | [self updateCacheSize]; 37 | } 38 | 39 | - (void)didReceiveMemoryWarning { 40 | [super didReceiveMemoryWarning]; 41 | // Dispose of any resources that can be recreated. 42 | } 43 | 44 | #pragma mark - Custom Accessors 45 | 46 | #pragma mark - IBActions 47 | 48 | #pragma mark - Public 49 | 50 | #pragma mark - Private 51 | 52 | - (void)setupUI { 53 | self.view.backgroundColor = [UIColor whiteColor]; 54 | 55 | self.clearCacheButton = [[UIButton alloc] init]; 56 | self.clearCacheButton.backgroundColor = [UIColor redColor]; 57 | [self.clearCacheButton setTitle:@"清除缓存" forState:UIControlStateNormal]; 58 | [self.clearCacheButton addTarget:self action:@selector(clearCache) forControlEvents:UIControlEventTouchUpInside]; 59 | [self.view addSubview:self.clearCacheButton]; 60 | 61 | [self.clearCacheButton mas_makeConstraints:^(MASConstraintMaker *make) { 62 | make.left.mas_equalTo(10); 63 | make.right.mas_equalTo(-10); 64 | make.width.mas_equalTo(40); 65 | make.centerY.equalTo(self.view.mas_centerY); 66 | }]; 67 | 68 | self.cacheSizeLabel = [[UILabel alloc] init]; 69 | 70 | [self.view addSubview:self.cacheSizeLabel]; 71 | 72 | [self.cacheSizeLabel mas_makeConstraints:^(MASConstraintMaker *make) { 73 | make.bottom.equalTo(self.clearCacheButton.mas_top).offset(-20); 74 | make.centerX.equalTo(self.view.mas_centerX); 75 | }]; 76 | } 77 | 78 | - (void)clearCache { 79 | if ([MBFileManager clearCache]) { 80 | [self updateCacheSize]; 81 | [[MBNetworkManager shareInstance] clearDownloadingOffset]; //清除网络层保存的下载进度 82 | [self.view addSubview:[MBToastLabelView message:@"清除缓存成功" delaySecond:0.5]]; 83 | }else { 84 | [self.view addSubview:[MBToastLabelView message:@"清除缓存失败" delaySecond:0.5]]; 85 | } 86 | } 87 | 88 | - (void)updateCacheSize { 89 | long long cacheSize = [MBFileManager currentCacheSize]; 90 | self.cacheSizeLabel.text =[NSString stringWithFormat:@"当前缓存大小:%lldM", cacheSize]; 91 | } 92 | 93 | #pragma mark - Protocol conformance 94 | 95 | /* 96 | #pragma mark - Navigation 97 | 98 | // In a storyboard-based application, you will often want to do a little preparation before navigation 99 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 100 | // Get the new view controller using [segue destinationViewController]. 101 | // Pass the selected object to the new view controller. 102 | } 103 | */ 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /MBVideoPlayer/Controller/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/8. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /MBVideoPlayer/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | NSAppTransportSecurity 24 | 25 | NSAllowsArbitraryLoads 26 | 27 | 28 | UILaunchStoryboardName 29 | LaunchScreen 30 | UIMainStoryboardFile 31 | Main 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /MBVideoPlayer/Model/MBURLTaskModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBURLTaskModel.h 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/11. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 视频下载任务类 13 | */ 14 | @interface MBURLTaskModel : NSObject 15 | 16 | /** 17 | 下载URL 18 | */ 19 | @property (nonatomic, strong) NSURL *downloadURL; 20 | 21 | /** 22 | 视频总长度 23 | */ 24 | @property (nonatomic, assign) long long videoLength; 25 | 26 | /** 27 | 当次任务起始位置 28 | */ 29 | @property (nonatomic, assign) long long offset; 30 | 31 | /** 32 | 当次任务已经完成下载的长度 33 | */ 34 | @property (nonatomic, assign) long long downloadingOffset; 35 | 36 | 37 | - (instancetype)initWithURL:(NSURL *)url; 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /MBVideoPlayer/Model/MBURLTaskModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBURLTaskModel.m 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/11. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import "MBURLTaskModel.h" 10 | #import "MBFileManager.h" 11 | #import "MBNetworkManager.h" 12 | 13 | @implementation MBURLTaskModel 14 | 15 | - (instancetype)initWithURL:(NSURL *)url { 16 | self = [super init]; 17 | 18 | if (self) { 19 | self.downloadURL = url; 20 | NSString *savePath = [MBFileManager savePathWithURL:self.downloadURL]; 21 | NSData *filedata = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:savePath] options:NSDataReadingMappedIfSafe error:nil]; 22 | self.downloadingOffset = (long long)filedata.length ? (long long)filedata.length : 0; 23 | self.videoLength = [[MBNetworkManager new] totalBytesByFileURL:self.downloadURL.absoluteString]; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /MBVideoPlayer/Model/MBVideoModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBVideoModel.h 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/9. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 视频model类 13 | */ 14 | @interface MBVideoModel : NSObject 15 | 16 | @property (nonatomic, strong) NSURL *videoURL; 17 | @property (nonatomic, strong) NSString *videoName; 18 | @property (nonatomic, strong) NSString *videoDescription; 19 | @property (nonatomic, strong) NSURL *imageURL; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MBVideoPlayer/Model/MBVideoModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBVideoModel.m 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/9. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import "MBVideoModel.h" 10 | 11 | @implementation MBVideoModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MBVideoPlayer/Other/MBAVAssetResourceLoader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBAVAssetResourceLoaderDelegate.h 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/8. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | 13 | @protocol MBAVAssetResourceLoaderDelegate 14 | 15 | - (void)didCompleteWithError:(NSError *)error; 16 | 17 | @end 18 | 19 | /** 20 | AVAssetResource代理类,用于拦截AVURLAssert的资源请求 21 | */ 22 | @interface MBAVAssetResourceLoader : NSObject 23 | 24 | @property(nonatomic, weak) id delegate; 25 | /** 26 | 更换下载链接的URL scheme 27 | 28 | @param url 下载链接 29 | @return 新的URL 30 | */ 31 | - (NSURL *)getSchemeVideoURL:(NSURL *)url; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /MBVideoPlayer/Other/MBFileManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBFileManager.h 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/9. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBFileManager : NSObject 12 | 13 | /** 14 | 对url进行md5加密 15 | 16 | @param url 文件url 17 | @return 返回加密结果 18 | */ 19 | + (NSString *)MD5ForDownloadURL:(NSURL *)url; 20 | 21 | /** 22 | 判断文件是否存在 23 | 24 | @param path 文件路径 25 | @return yes or no 26 | */ 27 | + (BOOL)fileExistAtPath:(NSString *)path; 28 | 29 | /** 30 | 返回沙盒Documents目录下自定义文件夹地址 31 | 32 | @param folderName 文件夹名称 33 | @return 路径 34 | */ 35 | + (NSString *)pathUnderDocumentsWithName:(NSString *)folderName; 36 | 37 | /** 38 | 创建文件目录 39 | 40 | @param path 目录 41 | @return yes or no 42 | */ 43 | + (BOOL)createDirectoryWithPath:(NSString *)path; 44 | 45 | 46 | /** 47 | 返回文件路径 48 | 49 | @param url 文件下载URL 50 | @return 文件路径 51 | */ 52 | + (NSString *)savePathWithURL:(NSURL *)url; 53 | 54 | 55 | /** 56 | 根据文件路径创建文件 57 | 58 | @param path 文件路径 59 | @return 创建结果,yes or no 60 | */ 61 | + (BOOL)createFileInPath:(NSString *)path; 62 | 63 | /** 64 | 获取当前缓存大小 65 | 66 | @return 缓存大小,单位M 67 | */ 68 | + (long long)currentCacheSize; 69 | 70 | /** 71 | 删除缓存 72 | 73 | @return 删除缓存结果,成功或者失败 74 | */ 75 | + (BOOL)clearCache; 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /MBVideoPlayer/Other/MBFileManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBFileManager.m 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/9. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import "MBFileManager.h" 10 | 11 | #import 12 | 13 | @implementation MBFileManager 14 | 15 | /** 16 | 对URL进行MD5加密作为临时文件的名称 17 | 18 | @param url 文件下载链接 19 | @return 加密后的文件名 20 | */ 21 | + (NSString *)MD5ForDownloadURL:(NSURL *)url { 22 | NSData *data = [[url absoluteString] dataUsingEncoding:NSUTF8StringEncoding]; 23 | uint8_t digest[CC_MD5_DIGEST_LENGTH]; 24 | CC_MD5(data.bytes, (CC_LONG)data.length, digest); 25 | NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2]; 26 | for (int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) { 27 | [output appendFormat:@"%02x", digest[i]]; 28 | } 29 | return [output copy]; 30 | } 31 | 32 | + (BOOL)fileExistAtPath:(NSString *)path { 33 | BOOL isDir = NO; 34 | 35 | BOOL exist = [[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDir]; 36 | 37 | return exist && !isDir; 38 | } 39 | 40 | + (NSString *)pathUnderDocumentsWithName:(NSString *)folderName { 41 | NSString *documents = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)lastObject]; 42 | NSString *downloadFolder = [documents stringByAppendingPathComponent:folderName]; 43 | // [self handleDownloadFolder:downloadFolder]; 44 | return downloadFolder; 45 | } 46 | 47 | + (BOOL)createDirectoryWithPath:(NSString *)path { 48 | NSFileManager *fileManager = [NSFileManager defaultManager]; 49 | 50 | BOOL isDir = NO; 51 | 52 | BOOL isExist = [fileManager fileExistsAtPath:path isDirectory:&isDir]; 53 | 54 | if (!isExist || !isDir) {//如果路径不存在,或者不是一个目录则重新创建 55 | NSError *error; 56 | 57 | [fileManager createDirectoryAtPath:path 58 | withIntermediateDirectories:YES 59 | attributes:nil 60 | error:&error]; 61 | 62 | if (error) { 63 | NSLog(@"create Path fail"); 64 | return NO; 65 | }else { 66 | return YES; 67 | } 68 | }else { 69 | return YES; 70 | } 71 | } 72 | 73 | + (NSString *)savePathWithURL:(NSURL *)url { 74 | NSString *fileDocumentName = [self MD5ForDownloadURL:url];//md5 75 | NSString *documentPath = [self pathUnderDocumentsWithName:@"MBVideoPlayer"];//xxx/Documents/MBVideoPlayer 76 | NSString *path = [documentPath stringByAppendingPathComponent:fileDocumentName]; 77 | [self createDirectoryWithPath:path]; 78 | 79 | return [path stringByAppendingPathComponent:@"play.mp4"]; 80 | } 81 | 82 | + (BOOL)createFileInPath:(NSString *)path { 83 | if ([[NSFileManager defaultManager] fileExistsAtPath:path]) { 84 | return YES; 85 | } 86 | 87 | return [[NSFileManager defaultManager] createFileAtPath:path contents:nil attributes:nil]; 88 | } 89 | 90 | + (long long)currentCacheSize { 91 | NSFileManager *fileManager = [NSFileManager defaultManager]; 92 | NSString *documentPath = [self pathUnderDocumentsWithName:@"MBVideoPlayer"];//xxx/Documents/MBVideoPlayer 93 | 94 | if (![fileManager fileExistsAtPath:documentPath]) { 95 | return 0; 96 | } 97 | 98 | NSEnumerator *childFilesEnumerator = [[fileManager subpathsAtPath:documentPath] objectEnumerator]; 99 | NSString *fileName; 100 | 101 | long long folderSize = 0; 102 | 103 | while ((fileName = [childFilesEnumerator nextObject])) { 104 | NSString *fileAbsolutePath = [documentPath stringByAppendingPathComponent:fileName]; 105 | folderSize += [self fileSizeAtPath:fileAbsolutePath]; 106 | } 107 | 108 | return folderSize / (1024 * 1024); 109 | } 110 | 111 | + (long long)fileSizeAtPath:(NSString *)filePath { 112 | NSFileManager *fileManager = [NSFileManager defaultManager]; 113 | 114 | if ([fileManager fileExistsAtPath:filePath]) { 115 | NSDictionary *attributes = [fileManager attributesOfItemAtPath:filePath error:nil]; 116 | 117 | NSNumber *fileSize = [attributes objectForKey:NSFileSize]; 118 | if (fileSize != nil) { 119 | return [fileSize longLongValue]; 120 | } 121 | } 122 | 123 | return 0; 124 | } 125 | 126 | + (BOOL)clearCache { 127 | NSString *documentPath = [self pathUnderDocumentsWithName:@"MBVideoPlayer"];//xxx/Documents/MBVideoPlayer 128 | 129 | NSError *error = nil; 130 | [[NSFileManager defaultManager] removeItemAtPath:documentPath error:&error]; 131 | 132 | if (error) { 133 | return NO; 134 | }else { 135 | return YES; 136 | } 137 | } 138 | 139 | @end 140 | -------------------------------------------------------------------------------- /MBVideoPlayer/Other/MBNetworkManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBNetworkManager.h 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/8. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MBURLTaskModel; 12 | 13 | @protocol MBNetworkManagerDelegate 14 | 15 | - (void)didReceiveDataWithTaskModel:(MBURLTaskModel *)taskModel; 16 | - (void)didCompleteWithTaskModel:(MBURLTaskModel *)taskModel error:(NSError *)error; 17 | 18 | @end 19 | 20 | /** 21 | 网络下载管理类 22 | */ 23 | @interface MBNetworkManager : NSObject 24 | 25 | @property (nonatomic, weak) id delegate; 26 | @property (nonatomic, assign, readonly) long long downLoadingOffset; 27 | 28 | + (instancetype)shareInstance; 29 | 30 | /** 31 | 返回当前的taskModel 32 | 33 | @param url url链接 34 | @return taskmodel 35 | */ 36 | - (MBURLTaskModel *)urlTaskModelWithURL:(NSURL *)url; 37 | 38 | /** 39 | 开始任务 40 | 41 | @param task 任务 42 | */ 43 | - (void)startDownloadTask:(MBURLTaskModel *)task; 44 | 45 | /** 46 | 获取下载资源的长度 47 | 48 | @param fileURLString 资源下载链接 49 | @return 返回资源长度 50 | */ 51 | - (long long)totalBytesByFileURL:(NSString *)fileURLString; 52 | 53 | 54 | /** 55 | 当删除文件缓存的时候,要把当前下载进度清为0 56 | */ 57 | - (void)clearDownloadingOffset; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /MBVideoPlayer/View/MBPlayerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBPlayerView.h 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/10. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @protocol MBPlayerViewDelegate 13 | 14 | - (void)playerViewDidPrepareToShowVideo; 15 | 16 | @end 17 | 18 | @interface MBPlayerView : UIView 19 | 20 | @property (nonatomic, weak) id playDelegate; 21 | 22 | @property (nonatomic, strong) AVPlayer *player; 23 | @property (nonatomic, copy) NSString *urlString; 24 | @property (nonatomic, assign) BOOL isPlaying; 25 | 26 | - (instancetype)initWithFrame:(CGRect)frame; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /MBVideoPlayer/View/MBScrollView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBScrollView.h 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/9. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "MBPlayerView.h" 12 | 13 | @class MBPlayerManager; 14 | @class MBVideoModel; 15 | 16 | @protocol MBSrcollViewDataDelegate 17 | 18 | - (void)pullNewData; //拉取新的额消息 19 | 20 | @end 21 | 22 | @interface MBScrollView : UIScrollView 23 | 24 | @property (nonatomic, weak) id dataDelegate; 25 | @property (nonatomic, strong) MBPlayerView *playerView; 26 | 27 | - (instancetype)initWithFrame:(CGRect)frame; 28 | - (void)setupData:(NSArray *)data; 29 | 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /MBVideoPlayer/View/MBToastLabelView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBToastLabelView.h 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/14. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 提示类 13 | */ 14 | @interface MBToastLabelView : UIView 15 | 16 | + (instancetype)message:(NSString *)message delaySecond:(CGFloat)second; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MBVideoPlayer/View/MBToastLabelView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBToastLabelView.m 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/14. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import "MBToastLabelView.h" 10 | 11 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 12 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 13 | 14 | @implementation MBToastLabelView 15 | 16 | /* 17 | // Only override drawRect: if you perform custom drawing. 18 | // An empty implementation adversely affects performance during animation. 19 | - (void)drawRect:(CGRect)rect { 20 | // Drawing code 21 | } 22 | */ 23 | 24 | + (instancetype)message:(NSString *)message delaySecond:(CGFloat)second { 25 | MBToastLabelView *noticeLabel = nil; 26 | 27 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 10, 10)]; 28 | label.backgroundColor = [UIColor clearColor]; 29 | label.text = message; 30 | 31 | label.textColor = [UIColor whiteColor]; 32 | label.font = [UIFont systemFontOfSize:14]; 33 | label.numberOfLines = 0; 34 | label.textAlignment = NSTextAlignmentCenter; 35 | 36 | CGFloat width = [label.text boundingRectWithSize:CGSizeMake(SCREEN_WIDTH / 4 * 3 - 20, 33) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:label.font} context:nil].size.width; 37 | 38 | CGFloat height = [label.text boundingRectWithSize:CGSizeMake(width, FLT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:label.font} context:nil].size.height; 39 | 40 | [label setFrame:CGRectMake(10, 10, width, height)]; 41 | 42 | noticeLabel = [[MBToastLabelView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/2-width/2, SCREEN_HEIGHT/2-height/2+10, width + 20, height + 20)]; 43 | [noticeLabel addSubview:label]; 44 | noticeLabel.backgroundColor = [UIColor blackColor]; 45 | noticeLabel.alpha = 0.7; 46 | noticeLabel.layer.cornerRadius = 8; 47 | noticeLabel.clipsToBounds = YES; 48 | 49 | [noticeLabel removeFromItsSuperView:noticeLabel second:second]; 50 | 51 | return noticeLabel; 52 | } 53 | 54 | -(void)removeFromItsSuperView:(MBToastLabelView *)labelView second:(CGFloat)second{ 55 | 56 | __weak typeof(labelView) weakSelf = labelView; 57 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(second * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 58 | [weakSelf removeFromSuperview]; 59 | }); 60 | 61 | } 62 | 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /MBVideoPlayer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MBVideoPlayer 4 | // 5 | // Created by chenda on 2018/5/8. 6 | // Copyright © 2018年 chenda. 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 | -------------------------------------------------------------------------------- /MBVideoPlayerTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | -------------------------------------------------------------------------------- /MBVideoPlayerTests/MBVideoPlayerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBVideoPlayerTests.m 3 | // MBVideoPlayerTests 4 | // 5 | // Created by chenda on 2018/5/8. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBVideoPlayerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation MBVideoPlayerTests 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 | -------------------------------------------------------------------------------- /MBVideoPlayerUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | -------------------------------------------------------------------------------- /MBVideoPlayerUITests/MBVideoPlayerUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBVideoPlayerUITests.m 3 | // MBVideoPlayerUITests 4 | // 5 | // Created by chenda on 2018/5/8. 6 | // Copyright © 2018年 chenda. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBVideoPlayerUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation MBVideoPlayerUITests 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 | platform:ios, '8.0' 2 | target 'MBVideoPlayer' do 3 | 4 | pod 'Masonry' 5 | pod 'SDWebImage' 6 | pod 'CYLTabBarController' 7 | 8 | end 9 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CYLTabBarController (1.17.6) 3 | - Masonry (1.1.0) 4 | - SDWebImage (4.3.3): 5 | - SDWebImage/Core (= 4.3.3) 6 | - SDWebImage/Core (4.3.3) 7 | 8 | DEPENDENCIES: 9 | - CYLTabBarController 10 | - Masonry 11 | - SDWebImage 12 | 13 | SPEC REPOS: 14 | https://github.com/CocoaPods/Specs.git: 15 | - CYLTabBarController 16 | - Masonry 17 | - SDWebImage 18 | 19 | SPEC CHECKSUMS: 20 | CYLTabBarController: c374643dea6dadece8bdff9c70f7387f8ffd7d08 21 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 22 | SDWebImage: de4d90b5bff3571eae7bd16202b1f43135409fa5 23 | 24 | PODFILE CHECKSUM: fd3223e13b2c505648e9fac06857cc1a3780ce23 25 | 26 | COCOAPODS: 1.5.0 27 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.h 3 | // CYLTabBarController 4 | // 5 | // v1.16.0 Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2015 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #ifndef CYLConstants_h 10 | #define CYLConstants_h 11 | 12 | #define CYL_DEPRECATED(explain) __attribute__((deprecated(explain))) 13 | #define CYL_IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) 14 | 15 | #define CYL_IS_IOS_11 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.f) 16 | #define CYL_IS_IPHONE_X (CYL_IS_IOS_11 && CYL_IS_IPHONE && (MIN([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) == 375 && MAX([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) == 812)) 17 | #endif /* CYLConstants_h */ 18 | 19 | 20 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLPlusButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLPlusButton.h 3 | // CYLTabBarController 4 | // 5 | // v1.16.0 Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2015 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CYLConstants.h" 12 | @class CYLPlusButton; 13 | 14 | @protocol CYLPlusButtonSubclassing 15 | 16 | @required 17 | + (id)plusButton; 18 | @optional 19 | 20 | /*! 21 | * 用来自定义加号按钮的位置,如果不实现默认居中。 22 | * @attention 以下两种情况下,必须实现该协议方法,否则 CYLTabBarController 会抛出 exception 来进行提示: 23 | 1. 添加了 PlusButton 且 TabBarItem 的个数是奇数。 24 | 2. 实现了 `+plusChildViewController`。 25 | * @return 用来自定义加号按钮在 TabBar 中的位置。 26 | * 27 | */ 28 | + (NSUInteger)indexOfPlusButtonInTabBar; 29 | 30 | /*! 31 | * 该方法是为了调整 PlusButton 中心点Y轴方向的位置,建议在按钮超出了 tabbar 的边界时实现该方法。 32 | * @attention 如果不实现该方法,内部会自动进行比对,预设一个较为合适的位置,如果实现了该方法,预设的逻辑将失效。 33 | * @return 返回值是自定义按钮中心点Y轴方向的坐标除以 tabbar 的高度, 34 | 内部实现时,会使用该返回值来设置 PlusButton 的 centerY 坐标,公式如下: 35 | `PlusButtonCenterY = multiplierOfTabBarHeight * tabBarHeight + constantOfPlusButtonCenterYOffset;` 36 | 也就是说:如果 constantOfPlusButtonCenterYOffset 为0,同时 multiplierOfTabBarHeight 的值是0.5,表示 PlusButton 居中,小于0.5表示 PlusButton 偏上,大于0.5则表示偏下。 37 | * 38 | */ 39 | + (CGFloat)multiplierOfTabBarHeight:(CGFloat)tabBarHeight; 40 | 41 | /*! 42 | * 见 `+multiplierOfTabBarHeight:` 注释: 43 | * `PlusButtonCenterY = multiplierOfTabBarHeight * tabBarHeight + constantOfPlusButtonCenterYOffset;` 44 | * 也就是说: constantOfPlusButtonCenterYOffset 大于0会向下偏移,小于0会向上偏移。 45 | * @attention 实现了该方法,但没有实现 `+multiplierOfTabBarHeight:` 方法,在这种情况下,会在预设逻辑的基础上进行偏移。 46 | */ 47 | + (CGFloat)constantOfPlusButtonCenterYOffsetForTabBarHeight:(CGFloat)tabBarHeight; 48 | 49 | /*! 50 | * 实现该方法后,能让 PlusButton 的点击效果与跟点击其他 TabBar 按钮效果一样,跳转到该方法指定的 UIViewController 。 51 | * @attention 必须同时实现 `+indexOfPlusButtonInTabBar` 来指定 PlusButton 的位置。 52 | * @return 指定 PlusButton 点击后跳转的 UIViewController。 53 | * 54 | */ 55 | + (UIViewController *)plusChildViewController; 56 | 57 | /*! 58 | * 59 | Asks the delegate whether the specified view controller should be made active. 60 | Return YES if the view controller’s tab should be selected or NO if the current tab should remain active. 61 | Returns YES true if the view controller’s tab should be selected or 62 | NO false if the current tab should remain active. 63 | */ 64 | + (BOOL)shouldSelectPlusChildViewController; 65 | 66 | #pragma mark - Deprecated API 67 | 68 | + (CGFloat)multiplerInCenterY CYL_DEPRECATED("Deprecated in 1.6.0. Use `+multiplierOfTabBarHeight:` instead."); 69 | 70 | + (NSString *)tabBarContext; 71 | 72 | @end 73 | 74 | @class CYLTabBar; 75 | 76 | FOUNDATION_EXTERN UIButton *CYLExternPlusButton; 77 | FOUNDATION_EXTERN UIViewController *CYLPlusChildViewController; 78 | 79 | @interface CYLPlusButton : UIButton 80 | 81 | + (void)registerPlusButton; 82 | 83 | - (void)plusChildViewControllerButtonClicked:(UIButton *)sender; 84 | 85 | @end 86 | 87 | #pragma mark - Deprecated API 88 | 89 | @interface CYLPlusButton (CYLDeprecated) 90 | 91 | + (void)registerSubclass CYL_DEPRECATED("Deprecated in 1.6.0. Use `+[CYLPlusButton registerPlusButton]` instead."); 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLPlusButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // CYLPlusButton.m 3 | // CYLTabBarController 4 | // 5 | // v1.16.0 Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2015 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import "CYLPlusButton.h" 10 | #import "CYLTabBarController.h" 11 | #import "UIViewController+CYLTabBarControllerExtention.h" 12 | 13 | CGFloat CYLPlusButtonWidth = 0.0f; 14 | UIButton *CYLExternPlusButton = nil; 15 | UIViewController *CYLPlusChildViewController = nil; 16 | 17 | @implementation CYLPlusButton 18 | 19 | #pragma mark - 20 | #pragma mark - public Methods 21 | 22 | + (void)registerPlusButton { 23 | if (![self conformsToProtocol:@protocol(CYLPlusButtonSubclassing)]) { 24 | return; 25 | } 26 | Class class = self; 27 | UIButton *plusButton = [class plusButton]; 28 | CYLExternPlusButton = plusButton; 29 | CYLPlusButtonWidth = plusButton.frame.size.width; 30 | if ([[self class] respondsToSelector:@selector(plusChildViewController)]) { 31 | CYLPlusChildViewController = [class plusChildViewController]; 32 | if ([[self class] respondsToSelector:@selector(tabBarContext)]) { 33 | NSString *tabBarContext = [class tabBarContext]; 34 | if (tabBarContext && tabBarContext.length) { 35 | [CYLPlusChildViewController cyl_setContext:tabBarContext]; 36 | } 37 | } else { 38 | [CYLPlusChildViewController cyl_setContext:NSStringFromClass([CYLTabBarController class])]; 39 | } 40 | [[self class] addSelectViewControllerTarget:plusButton]; 41 | if ([[self class] respondsToSelector:@selector(indexOfPlusButtonInTabBar)]) { 42 | CYLPlusButtonIndex = [[self class] indexOfPlusButtonInTabBar]; 43 | } else { 44 | [NSException raise:NSStringFromClass([CYLTabBarController class]) format:@"If you want to add PlusChildViewController, you must realizse `+indexOfPlusButtonInTabBar` in your custom plusButton class.【Chinese】如果你想使用PlusChildViewController样式,你必须同时在你自定义的plusButton中实现 `+indexOfPlusButtonInTabBar`,来指定plusButton的位置"]; 45 | } 46 | } 47 | } 48 | 49 | #pragma clang diagnostic push 50 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" 51 | + (void)registerSubclass { 52 | [self registerPlusButton]; 53 | } 54 | #pragma clang diagnostic pop 55 | 56 | - (void)plusChildViewControllerButtonClicked:(UIButton *)sender { 57 | BOOL notNeedConfigureSelectionStatus = [[self class] respondsToSelector:@selector(shouldSelectPlusChildViewController)] && ![[self class] shouldSelectPlusChildViewController]; 58 | if (notNeedConfigureSelectionStatus) { 59 | return; 60 | } 61 | if (sender.selected) { 62 | return; 63 | } 64 | sender.selected = YES; 65 | CYLTabBarController *tabBarController = [sender cyl_tabBarController]; 66 | NSInteger index = [tabBarController.viewControllers indexOfObject:CYLPlusChildViewController]; 67 | @try { 68 | [tabBarController setSelectedIndex:index]; 69 | } @catch (NSException *exception) { 70 | NSLog(@"🔴类名与方法名:%@(在第%@行),描述:%@", @(__PRETTY_FUNCTION__), @(__LINE__), exception); 71 | } 72 | } 73 | 74 | #pragma mark - 75 | #pragma mark - Private Methods 76 | 77 | + (void)addSelectViewControllerTarget:(UIButton *)plusButton { 78 | id target = self; 79 | NSArray *selectorNamesArray = [plusButton actionsForTarget:target forControlEvent:UIControlEventTouchUpInside]; 80 | if (selectorNamesArray.count == 0) { 81 | target = plusButton; 82 | selectorNamesArray = [plusButton actionsForTarget:target forControlEvent:UIControlEventTouchUpInside]; 83 | } 84 | [selectorNamesArray enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 85 | SEL selector = NSSelectorFromString(obj); 86 | [plusButton removeTarget:target action:selector forControlEvents:UIControlEventTouchUpInside]; 87 | }]; 88 | [plusButton addTarget:plusButton action:@selector(plusChildViewControllerButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; 89 | } 90 | 91 | /** 92 | * 按钮选中状态下点击先显示normal状态的颜色,松开时再回到selected状态下颜色。 93 | * 重写此方法即不会出现上述情况,与 UITabBarButton 相似 94 | */ 95 | - (void)setHighlighted:(BOOL)highlighted {} 96 | 97 | @end 98 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLTabBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBar.h 3 | // CYLTabBarController 4 | // 5 | // v1.16.0 Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2015 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CYLTabBar : UITabBar 12 | 13 | /*! 14 | * 让 `TabImageView` 垂直居中时,所需要的默认偏移量。 15 | * @attention 该值将在设置 top 和 bottom 时被同时使用,具体的操作等价于如下行为: 16 | * `viewController.tabBarItem.imageInsets = UIEdgeInsetsMake(tabImageViewDefaultOffset, 0, -tabImageViewDefaultOffset, 0);` 17 | */ 18 | @property (nonatomic, assign, readonly) CGFloat tabImageViewDefaultOffset; 19 | 20 | @property (nonatomic, copy) NSString *context; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIControl+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.m 3 | // CYLTabBarController 4 | // 5 | // v1.16.0 Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2015 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIControl (CYLTabBarControllerExtention) 12 | 13 | - (UIView *)cyl_tabBadgeView; 14 | - (UIImageView *)cyl_tabImageView; 15 | - (UILabel *)cyl_tabLabel; 16 | 17 | /*! 18 | * 调用该方法前已经添加了系统的角标,调用该方法后,系统的角标并未被移除,只是被隐藏,调用 `-cyl_removeTabBadgePoint` 后会重新展示。 19 | */ 20 | - (void)cyl_showTabBadgePoint; 21 | - (void)cyl_removeTabBadgePoint; 22 | - (BOOL)cyl_isShowTabBadgePoint; 23 | 24 | @property (nonatomic, strong, setter=cyl_setTabBadgePointView:, getter=cyl_tabBadgePointView) UIView *cyl_tabBadgePointView; 25 | @property (nonatomic, assign, setter=cyl_setTabBadgePointViewOffset:, getter=cyl_tabBadgePointViewOffset) UIOffset cyl_tabBadgePointViewOffset; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIControl+CYLTabBarControllerExtention.m: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.m 3 | // CYLTabBarController 4 | // 5 | // v1.16.0 Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2015 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import "UIControl+CYLTabBarControllerExtention.h" 10 | #import 11 | #import "UIView+CYLTabBarControllerExtention.h" 12 | #import "CYLConstants.h" 13 | 14 | @implementation UIControl (CYLTabBarControllerExtention) 15 | 16 | - (void)cyl_showTabBadgePoint { 17 | [self cyl_setShowTabBadgePointIfNeeded:YES]; 18 | } 19 | 20 | - (void)cyl_removeTabBadgePoint { 21 | [self cyl_setShowTabBadgePointIfNeeded:NO]; 22 | } 23 | 24 | - (BOOL)cyl_isShowTabBadgePoint { 25 | return !self.cyl_tabBadgePointView.hidden; 26 | } 27 | 28 | - (void)cyl_setShowTabBadgePointIfNeeded:(BOOL)showTabBadgePoint { 29 | @try { 30 | [self cyl_setShowTabBadgePoint:showTabBadgePoint]; 31 | } @catch (NSException *exception) { 32 | NSLog(@"CYLPlusChildViewController do not support set TabBarItem red point"); 33 | } 34 | } 35 | 36 | - (void)cyl_setShowTabBadgePoint:(BOOL)showTabBadgePoint { 37 | if (showTabBadgePoint && self.cyl_tabBadgePointView.superview == nil) { 38 | [self addSubview:self.cyl_tabBadgePointView]; 39 | [self bringSubviewToFront:self.cyl_tabBadgePointView]; 40 | self.cyl_tabBadgePointView.layer.zPosition = MAXFLOAT; 41 | // X constraint 42 | [self addConstraint: 43 | [NSLayoutConstraint constraintWithItem:self.cyl_tabBadgePointView 44 | attribute:NSLayoutAttributeCenterX 45 | relatedBy:0 46 | toItem:self.cyl_tabImageView 47 | attribute:NSLayoutAttributeRight 48 | multiplier:1 49 | constant:self.cyl_tabBadgePointViewOffset.horizontal]]; 50 | //Y constraint 51 | [self addConstraint: 52 | [NSLayoutConstraint constraintWithItem:self.cyl_tabBadgePointView 53 | attribute:NSLayoutAttributeCenterY 54 | relatedBy:0 55 | toItem:self.cyl_tabImageView 56 | attribute:NSLayoutAttributeTop 57 | multiplier:1 58 | constant:self.cyl_tabBadgePointViewOffset.vertical]]; 59 | } 60 | self.cyl_tabBadgePointView.hidden = showTabBadgePoint == NO; 61 | self.cyl_tabBadgeView.hidden = showTabBadgePoint == YES; 62 | } 63 | 64 | - (void)cyl_setTabBadgePointView:(UIView *)tabBadgePointView { 65 | UIView *tempView = objc_getAssociatedObject(self, @selector(cyl_tabBadgePointView)); 66 | if (tempView) { 67 | [tempView removeFromSuperview]; 68 | } 69 | if (tabBadgePointView.superview) { 70 | [tabBadgePointView removeFromSuperview]; 71 | } 72 | 73 | tabBadgePointView.hidden = YES; 74 | objc_setAssociatedObject(self, @selector(cyl_tabBadgePointView), tabBadgePointView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 75 | } 76 | 77 | - (UIView *)cyl_tabBadgePointView { 78 | UIView *tabBadgePointView = objc_getAssociatedObject(self, @selector(cyl_tabBadgePointView)); 79 | 80 | if (tabBadgePointView == nil) { 81 | tabBadgePointView = self.cyl_defaultTabBadgePointView; 82 | objc_setAssociatedObject(self, @selector(cyl_tabBadgePointView), tabBadgePointView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 83 | } 84 | return tabBadgePointView; 85 | } 86 | 87 | - (void)cyl_setTabBadgePointViewOffset:(UIOffset)tabBadgePointViewOffset { 88 | objc_setAssociatedObject(self, @selector(cyl_tabBadgePointViewOffset), [NSValue valueWithUIOffset:tabBadgePointViewOffset], OBJC_ASSOCIATION_RETAIN_NONATOMIC); 89 | } 90 | 91 | //offset如果都是正数,则往右下偏移 92 | - (UIOffset)cyl_tabBadgePointViewOffset { 93 | id tabBadgePointViewOffsetObject = objc_getAssociatedObject(self, @selector(cyl_tabBadgePointViewOffset)); 94 | UIOffset tabBadgePointViewOffset = [tabBadgePointViewOffsetObject UIOffsetValue]; 95 | return tabBadgePointViewOffset; 96 | } 97 | 98 | - (UIView *)cyl_tabBadgeView { 99 | for (UIView *subview in self.subviews) { 100 | if ([subview cyl_isTabBadgeView]) { 101 | return (UIView *)subview; 102 | } 103 | } 104 | return nil; 105 | } 106 | 107 | - (UIImageView *)cyl_tabImageView { 108 | for (UIImageView *subview in self.subviews) { 109 | if ([subview cyl_isTabImageView]) { 110 | return (UIImageView *)subview; 111 | } 112 | } 113 | return nil; 114 | } 115 | 116 | - (UILabel *)cyl_tabLabel { 117 | for (UILabel *subview in self.subviews) { 118 | if ([subview cyl_isTabLabel]) { 119 | return (UILabel *)subview; 120 | } 121 | } 122 | return nil; 123 | } 124 | 125 | #pragma mark - private method 126 | 127 | - (UIView *)cyl_defaultTabBadgePointView { 128 | UIView *defaultRedTabBadgePointView = [UIView cyl_tabBadgePointViewWithClolor:[UIColor redColor] radius:4.5]; 129 | return defaultRedTabBadgePointView; 130 | } 131 | 132 | @end 133 | 134 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UITabBarItem+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.m 3 | // CYLTabBarController 4 | // 5 | // v1.16.0 Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2015 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UITabBarItem (CYLTabBarControllerExtention) 12 | 13 | @property (nonatomic, readonly) UIControl *cyl_tabButton; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UITabBarItem+CYLTabBarControllerExtention.m: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.m 3 | // CYLTabBarController 4 | // 5 | // v1.16.0 Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2015 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import "UITabBarItem+CYLTabBarControllerExtention.h" 10 | #import 11 | #import "UIControl+CYLTabBarControllerExtention.h" 12 | 13 | @implementation UITabBarItem (CYLTabBarControllerExtention) 14 | 15 | + (void)load { 16 | [self cyl_swizzleSetBadgeValue]; 17 | } 18 | 19 | + (void)cyl_swizzleSetBadgeValue { 20 | static dispatch_once_t onceToken; 21 | dispatch_once(&onceToken, ^{ 22 | cyl_ClassMethodSwizzle([self class], @selector(setBadgeValue:), @selector(cyl_setBadgeValue:)); 23 | }); 24 | } 25 | 26 | - (void)cyl_setBadgeValue:(NSString *)badgeValue { 27 | [self.cyl_tabButton cyl_removeTabBadgePoint]; 28 | [self cyl_setBadgeValue:badgeValue]; 29 | } 30 | 31 | - (UIControl *)cyl_tabButton { 32 | UIControl *control = [self valueForKey:@"view"]; 33 | return control; 34 | } 35 | 36 | #pragma mark - private method 37 | 38 | BOOL cyl_ClassMethodSwizzle(Class aClass, SEL originalSelector, SEL swizzleSelector) { 39 | Method originalMethod = class_getInstanceMethod(aClass, originalSelector); 40 | Method swizzleMethod = class_getInstanceMethod(aClass, swizzleSelector); 41 | BOOL didAddMethod = 42 | class_addMethod(aClass, 43 | originalSelector, 44 | method_getImplementation(swizzleMethod), 45 | method_getTypeEncoding(swizzleMethod)); 46 | if (didAddMethod) { 47 | class_replaceMethod(aClass, 48 | swizzleSelector, 49 | method_getImplementation(originalMethod), 50 | method_getTypeEncoding(originalMethod)); 51 | } else { 52 | method_exchangeImplementations(originalMethod, swizzleMethod); 53 | } 54 | return YES; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIView+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.m 3 | // CYLTabBarController 4 | // 5 | // v1.16.0 Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2015 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface UIView (CYLTabBarControllerExtention) 13 | 14 | - (BOOL)cyl_isPlusButton; 15 | - (BOOL)cyl_isTabButton; 16 | - (BOOL)cyl_isTabImageView; 17 | - (BOOL)cyl_isTabLabel; 18 | - (BOOL)cyl_isTabBadgeView; 19 | - (BOOL)cyl_isTabBackgroundView; 20 | - (UIView *)cyl_tabBadgeBackgroundView; 21 | - (UIView *)cyl_tabBadgeBackgroundSeparator; 22 | 23 | + (UIView *)cyl_tabBadgePointViewWithClolor:(UIColor *)color radius:(CGFloat)radius; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 CYLTabBarController(https://github.com/ChenYilong/CYLTabBarController), L.L.C. All rights reserved. 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/Headers/Private/CYLTabBarController/CYLConstants.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/CYLConstants.h -------------------------------------------------------------------------------- /Pods/Headers/Private/CYLTabBarController/CYLPlusButton.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/CYLPlusButton.h -------------------------------------------------------------------------------- /Pods/Headers/Private/CYLTabBarController/CYLTabBar.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/CYLTabBar.h -------------------------------------------------------------------------------- /Pods/Headers/Private/CYLTabBarController/CYLTabBarController.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/CYLTabBarController.h -------------------------------------------------------------------------------- /Pods/Headers/Private/CYLTabBarController/UIControl+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/UIControl+CYLTabBarControllerExtention.h -------------------------------------------------------------------------------- /Pods/Headers/Private/CYLTabBarController/UITabBarItem+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/UITabBarItem+CYLTabBarControllerExtention.h -------------------------------------------------------------------------------- /Pods/Headers/Private/CYLTabBarController/UIView+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/UIView+CYLTabBarControllerExtention.h -------------------------------------------------------------------------------- /Pods/Headers/Private/CYLTabBarController/UIViewController+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/UIViewController+CYLTabBarControllerExtention.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/Private/SDWebImage/NSButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSImage+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDAnimatedImageRep.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCacheConfig.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageCoderHelper.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCoderHelper.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageCodersManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCodersManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageFrame.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageFrame.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageGIFCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageImageIOCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageImageIOCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageTransition.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageTransition.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+ForceDecode.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/CYLTabBarController/CYLConstants.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/CYLConstants.h -------------------------------------------------------------------------------- /Pods/Headers/Public/CYLTabBarController/CYLPlusButton.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/CYLPlusButton.h -------------------------------------------------------------------------------- /Pods/Headers/Public/CYLTabBarController/CYLTabBar.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/CYLTabBar.h -------------------------------------------------------------------------------- /Pods/Headers/Public/CYLTabBarController/CYLTabBarController.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/CYLTabBarController.h -------------------------------------------------------------------------------- /Pods/Headers/Public/CYLTabBarController/UIControl+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/UIControl+CYLTabBarControllerExtention.h -------------------------------------------------------------------------------- /Pods/Headers/Public/CYLTabBarController/UITabBarItem+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/UITabBarItem+CYLTabBarControllerExtention.h -------------------------------------------------------------------------------- /Pods/Headers/Public/CYLTabBarController/UIView+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/UIView+CYLTabBarControllerExtention.h -------------------------------------------------------------------------------- /Pods/Headers/Public/CYLTabBarController/UIViewController+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | ../../../CYLTabBarController/CYLTabBarController/UIViewController+CYLTabBarControllerExtention.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/Headers/Public/SDWebImage/NSButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSImage+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDAnimatedImageRep.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCacheConfig.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageCoderHelper.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCoderHelper.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageCodersManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCodersManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageFrame.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageFrame.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageGIFCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageImageIOCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageImageIOCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageTransition.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageTransition.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+ForceDecode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CYLTabBarController (1.17.6) 3 | - Masonry (1.1.0) 4 | - SDWebImage (4.3.3): 5 | - SDWebImage/Core (= 4.3.3) 6 | - SDWebImage/Core (4.3.3) 7 | 8 | DEPENDENCIES: 9 | - CYLTabBarController 10 | - Masonry 11 | - SDWebImage 12 | 13 | SPEC REPOS: 14 | https://github.com/CocoaPods/Specs.git: 15 | - CYLTabBarController 16 | - Masonry 17 | - SDWebImage 18 | 19 | SPEC CHECKSUMS: 20 | CYLTabBarController: c374643dea6dadece8bdff9c70f7387f8ffd7d08 21 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 22 | SDWebImage: de4d90b5bff3571eae7bd16202b1f43135409fa5 23 | 24 | PODFILE CHECKSUM: fd3223e13b2c505648e9fac06857cc1a3780ce23 25 | 26 | COCOAPODS: 1.5.0 27 | -------------------------------------------------------------------------------- /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 | // MASViewAttribute.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 | // MASViewAttribute.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 | // MASViewConstraint.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 (NS_NOESCAPE ^)(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 (NS_NOESCAPE ^)(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 (NS_NOESCAPE ^)(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 (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 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 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 56 | 57 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuide API_AVAILABLE(ios(11.0),tvos(11.0)); 58 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); 59 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); 60 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); 61 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); 62 | 63 | #endif 64 | 65 | /** 66 | * a key to associate with this view 67 | */ 68 | @property (nonatomic, strong) id mas_key; 69 | 70 | /** 71 | * Finds the closest common superview between this view and another view 72 | * 73 | * @param view other view 74 | * 75 | * @return returns nil if common superview could not be found 76 | */ 77 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; 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 | * 83 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 84 | * 85 | * @return Array of created MASConstraints 86 | */ 87 | - (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 88 | 89 | /** 90 | * Creates a MASConstraintMaker with the callee view. 91 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 92 | * If an existing constraint exists then it will be updated instead. 93 | * 94 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 95 | * 96 | * @return Array of created/updated MASConstraints 97 | */ 98 | - (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 99 | 100 | /** 101 | * Creates a MASConstraintMaker with the callee view. 102 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 103 | * All constraints previously installed for the view will be removed. 104 | * 105 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 106 | * 107 | * @return Array of created/updated MASConstraints 108 | */ 109 | - (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /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 (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 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 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 53 | 54 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); 55 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); 56 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); 57 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); 58 | 59 | #endif 60 | 61 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 62 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 63 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 64 | 65 | @end 66 | 67 | #define MAS_ATTR_FORWARD(attr) \ 68 | - (MASViewAttribute *)attr { \ 69 | return [self mas_##attr]; \ 70 | } 71 | 72 | @implementation MAS_VIEW (MASShorthandAdditions) 73 | 74 | MAS_ATTR_FORWARD(top); 75 | MAS_ATTR_FORWARD(left); 76 | MAS_ATTR_FORWARD(bottom); 77 | MAS_ATTR_FORWARD(right); 78 | MAS_ATTR_FORWARD(leading); 79 | MAS_ATTR_FORWARD(trailing); 80 | MAS_ATTR_FORWARD(width); 81 | MAS_ATTR_FORWARD(height); 82 | MAS_ATTR_FORWARD(centerX); 83 | MAS_ATTR_FORWARD(centerY); 84 | MAS_ATTR_FORWARD(baseline); 85 | 86 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 87 | 88 | MAS_ATTR_FORWARD(firstBaseline); 89 | MAS_ATTR_FORWARD(lastBaseline); 90 | 91 | #endif 92 | 93 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 94 | 95 | MAS_ATTR_FORWARD(leftMargin); 96 | MAS_ATTR_FORWARD(rightMargin); 97 | MAS_ATTR_FORWARD(topMargin); 98 | MAS_ATTR_FORWARD(bottomMargin); 99 | MAS_ATTR_FORWARD(leadingMargin); 100 | MAS_ATTR_FORWARD(trailingMargin); 101 | MAS_ATTR_FORWARD(centerXWithinMargins); 102 | MAS_ATTR_FORWARD(centerYWithinMargins); 103 | 104 | #endif 105 | 106 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 107 | 108 | MAS_ATTR_FORWARD(safeAreaLayoutGuideTop); 109 | MAS_ATTR_FORWARD(safeAreaLayoutGuideBottom); 110 | MAS_ATTR_FORWARD(safeAreaLayoutGuideLeft); 111 | MAS_ATTR_FORWARD(safeAreaLayoutGuideRight); 112 | 113 | #endif 114 | 115 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute { 116 | return [self mas_attribute]; 117 | } 118 | 119 | - (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 120 | return [self mas_makeConstraints:block]; 121 | } 122 | 123 | - (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 124 | return [self mas_updateConstraints:block]; 125 | } 126 | 127 | - (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 128 | return [self mas_remakeConstraints:block]; 129 | } 130 | 131 | @end 132 | 133 | #endif 134 | -------------------------------------------------------------------------------- /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/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com 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 furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | 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 | 21 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | typedef NS_ENUM(NSInteger, SDImageFormat) { 14 | SDImageFormatUndefined = -1, 15 | SDImageFormatJPEG = 0, 16 | SDImageFormatPNG, 17 | SDImageFormatGIF, 18 | SDImageFormatTIFF, 19 | SDImageFormatWebP, 20 | SDImageFormatHEIC 21 | }; 22 | 23 | @interface NSData (ImageContentType) 24 | 25 | /** 26 | * Return image format 27 | * 28 | * @param data the input image data 29 | * 30 | * @return the image format as `SDImageFormat` (enum) 31 | */ 32 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data; 33 | 34 | /** 35 | Convert SDImageFormat to UTType 36 | 37 | @param format Format as SDImageFormat 38 | @return The UTType as CFStringRef 39 | */ 40 | + (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "NSData+ImageContentType.h" 11 | #if SD_MAC 12 | #import 13 | #else 14 | #import 15 | #endif 16 | 17 | // Currently Image/IO does not support WebP 18 | #define kSDUTTypeWebP ((__bridge CFStringRef)@"public.webp") 19 | // AVFileTypeHEIC is defined in AVFoundation via iOS 11, we use this without import AVFoundation 20 | #define kSDUTTypeHEIC ((__bridge CFStringRef)@"public.heic") 21 | 22 | @implementation NSData (ImageContentType) 23 | 24 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data { 25 | if (!data) { 26 | return SDImageFormatUndefined; 27 | } 28 | 29 | // File signatures table: http://www.garykessler.net/library/file_sigs.html 30 | uint8_t c; 31 | [data getBytes:&c length:1]; 32 | switch (c) { 33 | case 0xFF: 34 | return SDImageFormatJPEG; 35 | case 0x89: 36 | return SDImageFormatPNG; 37 | case 0x47: 38 | return SDImageFormatGIF; 39 | case 0x49: 40 | case 0x4D: 41 | return SDImageFormatTIFF; 42 | case 0x52: { 43 | if (data.length >= 12) { 44 | //RIFF....WEBP 45 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 46 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 47 | return SDImageFormatWebP; 48 | } 49 | } 50 | break; 51 | } 52 | case 0x00: { 53 | if (data.length >= 12) { 54 | //....ftypheic ....ftypheix ....ftyphevc ....ftyphevx 55 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(4, 8)] encoding:NSASCIIStringEncoding]; 56 | if ([testString isEqualToString:@"ftypheic"] 57 | || [testString isEqualToString:@"ftypheix"] 58 | || [testString isEqualToString:@"ftyphevc"] 59 | || [testString isEqualToString:@"ftyphevx"]) { 60 | return SDImageFormatHEIC; 61 | } 62 | } 63 | break; 64 | } 65 | } 66 | return SDImageFormatUndefined; 67 | } 68 | 69 | + (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format { 70 | CFStringRef UTType; 71 | switch (format) { 72 | case SDImageFormatJPEG: 73 | UTType = kUTTypeJPEG; 74 | break; 75 | case SDImageFormatPNG: 76 | UTType = kUTTypePNG; 77 | break; 78 | case SDImageFormatGIF: 79 | UTType = kUTTypeGIF; 80 | break; 81 | case SDImageFormatTIFF: 82 | UTType = kUTTypeTIFF; 83 | break; 84 | case SDImageFormatWebP: 85 | UTType = kSDUTTypeWebP; 86 | break; 87 | case SDImageFormatHEIC: 88 | UTType = kSDUTTypeHEIC; 89 | break; 90 | default: 91 | // default is kUTTypePNG 92 | UTType = kUTTypePNG; 93 | break; 94 | } 95 | return UTType; 96 | } 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | #import 14 | 15 | @interface NSImage (WebCache) 16 | 17 | - (CGImageRef)CGImage; 18 | - (NSArray *)images; 19 | - (BOOL)isGIF; 20 | 21 | @end 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/NSImage+WebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "NSImage+WebCache.h" 10 | 11 | #if SD_MAC 12 | 13 | @implementation NSImage (WebCache) 14 | 15 | - (CGImageRef)CGImage { 16 | NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height); 17 | CGImageRef cgImage = [self CGImageForProposedRect:&imageRect context:NULL hints:nil]; 18 | return cgImage; 19 | } 20 | 21 | - (NSArray *)images { 22 | return nil; 23 | } 24 | 25 | - (BOOL)isGIF { 26 | BOOL isGIF = NO; 27 | for (NSImageRep *rep in self.representations) { 28 | if ([rep isKindOfClass:[NSBitmapImageRep class]]) { 29 | NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; 30 | NSUInteger frameCount = [[bitmapRep valueForProperty:NSImageFrameCount] unsignedIntegerValue]; 31 | isGIF = frameCount > 1 ? YES : NO; 32 | break; 33 | } 34 | } 35 | return isGIF; 36 | } 37 | 38 | @end 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | // A subclass of `NSBitmapImageRep` to fix that GIF loop count issue because `NSBitmapImageRep` will reset `NSImageCurrentFrameDuration` by using `kCGImagePropertyGIFDelayTime` but not `kCGImagePropertyGIFUnclampedDelayTime`. 14 | // Built in GIF coder use this instead of `NSBitmapImageRep` for better GIF rendering. If you do not want this, only enable `SDWebImageImageIOCoder`, which just call `NSImage` API and actually use `NSBitmapImageRep` for GIF image. 15 | 16 | @interface SDAnimatedImageRep : NSBitmapImageRep 17 | 18 | @end 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDAnimatedImageRep.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDAnimatedImageRep.h" 10 | 11 | #if SD_MAC 12 | 13 | #import "SDWebImageGIFCoder.h" 14 | 15 | @interface SDWebImageGIFCoder () 16 | 17 | - (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source; 18 | 19 | @end 20 | 21 | @interface SDAnimatedImageRep () 22 | 23 | @property (nonatomic, assign, readonly, nullable) CGImageSourceRef imageSource; 24 | 25 | @end 26 | 27 | @implementation SDAnimatedImageRep 28 | 29 | // `NSBitmapImageRep` will use `kCGImagePropertyGIFDelayTime` whenever you call `setProperty:withValue:` with `NSImageCurrentFrame` to change the current frame. We override it and use the actual `kCGImagePropertyGIFUnclampedDelayTime` if need. 30 | - (void)setProperty:(NSBitmapImageRepPropertyKey)property withValue:(id)value { 31 | [super setProperty:property withValue:value]; 32 | if ([property isEqualToString:NSImageCurrentFrame]) { 33 | // Access the image source 34 | CGImageSourceRef imageSource = self.imageSource; 35 | if (!imageSource) { 36 | return; 37 | } 38 | // Check format type 39 | CFStringRef type = CGImageSourceGetType(imageSource); 40 | if (!type) { 41 | return; 42 | } 43 | NSUInteger index = [value unsignedIntegerValue]; 44 | float frameDuration = 0; 45 | // Through we currently process GIF only, in the 5.x we support APNG so we keep the extensibility 46 | if (CFStringCompare(type, kUTTypeGIF, 0) == kCFCompareEqualTo) { 47 | frameDuration = [[SDWebImageGIFCoder sharedCoder] sd_frameDurationAtIndex:index source:imageSource]; 48 | } 49 | if (!frameDuration) { 50 | return; 51 | } 52 | // Reset super frame duration with the actual frame duration 53 | [super setProperty:NSImageCurrentFrameDuration withValue:@(frameDuration)]; 54 | } 55 | } 56 | 57 | - (CGImageSourceRef)imageSource { 58 | if (_tiffData) { 59 | return (__bridge CGImageSourceRef)(_tiffData); 60 | } 61 | return NULL; 62 | } 63 | 64 | @end 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDImageCacheConfig : NSObject 13 | 14 | /** 15 | * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. 16 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. 17 | */ 18 | @property (assign, nonatomic) BOOL shouldDecompressImages; 19 | 20 | /** 21 | * disable iCloud backup [defaults to YES] 22 | */ 23 | @property (assign, nonatomic) BOOL shouldDisableiCloud; 24 | 25 | /** 26 | * use memory cache [defaults to YES] 27 | */ 28 | @property (assign, nonatomic) BOOL shouldCacheImagesInMemory; 29 | 30 | /** 31 | * The reading options while reading cache from disk. 32 | * Defaults to 0. You can set this to `NSDataReadingMappedIfSafe` to improve performance. 33 | */ 34 | @property (assign, nonatomic) NSDataReadingOptions diskCacheReadingOptions; 35 | 36 | /** 37 | * The writing options while writing cache to disk. 38 | * Defaults to `NSDataWritingAtomic`. You can set this to `NSDataWritingWithoutOverwriting` to prevent overwriting an existing file. 39 | */ 40 | @property (assign, nonatomic) NSDataWritingOptions diskCacheWritingOptions; 41 | 42 | /** 43 | * The maximum length of time to keep an image in the cache, in seconds. 44 | */ 45 | @property (assign, nonatomic) NSInteger maxCacheAge; 46 | 47 | /** 48 | * The maximum size of the cache, in bytes. 49 | */ 50 | @property (assign, nonatomic) NSUInteger maxCacheSize; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageCacheConfig.h" 10 | 11 | static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week 12 | 13 | @implementation SDImageCacheConfig 14 | 15 | - (instancetype)init { 16 | if (self = [super init]) { 17 | _shouldDecompressImages = YES; 18 | _shouldDisableiCloud = YES; 19 | _shouldCacheImagesInMemory = YES; 20 | _diskCacheReadingOptions = 0; 21 | _diskCacheWritingOptions = NSDataWritingAtomic; 22 | _maxCacheAge = kDefaultCacheMaxCacheAge; 23 | _maxCacheSize = 0; 24 | } 25 | return self; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "NSData+ImageContentType.h" 12 | 13 | /** 14 | A Boolean value indicating whether to scale down large images during decompressing. (NSNumber) 15 | */ 16 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageCoderScaleDownLargeImagesKey; 17 | 18 | /** 19 | Return the shared device-dependent RGB color space created with CGColorSpaceCreateDeviceRGB. 20 | 21 | @return The device-dependent RGB color space 22 | */ 23 | CG_EXTERN CGColorSpaceRef _Nonnull SDCGColorSpaceGetDeviceRGB(void); 24 | 25 | /** 26 | Check whether CGImageRef contains alpha channel. 27 | 28 | @param imageRef The CGImageRef 29 | @return Return YES if CGImageRef contains alpha channel, otherwise return NO 30 | */ 31 | CG_EXTERN BOOL SDCGImageRefContainsAlpha(_Nullable CGImageRef imageRef); 32 | 33 | 34 | /** 35 | This is the image coder protocol to provide custom image decoding/encoding. 36 | These methods are all required to implement. 37 | @note Pay attention that these methods are not called from main queue. 38 | */ 39 | @protocol SDWebImageCoder 40 | 41 | @required 42 | #pragma mark - Decoding 43 | /** 44 | Returns YES if this coder can decode some data. Otherwise, the data should be passed to another coder. 45 | 46 | @param data The image data so we can look at it 47 | @return YES if this coder can decode the data, NO otherwise 48 | */ 49 | - (BOOL)canDecodeFromData:(nullable NSData *)data; 50 | 51 | /** 52 | Decode the image data to image. 53 | 54 | @param data The image data to be decoded 55 | @return The decoded image from data 56 | */ 57 | - (nullable UIImage *)decodedImageWithData:(nullable NSData *)data; 58 | 59 | /** 60 | Decompress the image with original image and image data. 61 | 62 | @param image The original image to be decompressed 63 | @param data The pointer to original image data. The pointer itself is nonnull but image data can be null. This data will set to cache if needed. If you do not need to modify data at the sametime, ignore this param. 64 | @param optionsDict A dictionary containing any decompressing options. Pass {SDWebImageCoderScaleDownLargeImagesKey: @(YES)} to scale down large images 65 | @return The decompressed image 66 | */ 67 | - (nullable UIImage *)decompressedImageWithImage:(nullable UIImage *)image 68 | data:(NSData * _Nullable * _Nonnull)data 69 | options:(nullable NSDictionary*)optionsDict; 70 | 71 | #pragma mark - Encoding 72 | 73 | /** 74 | Returns YES if this coder can encode some image. Otherwise, it should be passed to another coder. 75 | 76 | @param format The image format 77 | @return YES if this coder can encode the image, NO otherwise 78 | */ 79 | - (BOOL)canEncodeToFormat:(SDImageFormat)format; 80 | 81 | /** 82 | Encode the image to image data. 83 | 84 | @param image The image to be encoded 85 | @param format The image format to encode, you should note `SDImageFormatUndefined` format is also possible 86 | @return The encoded image data 87 | */ 88 | - (nullable NSData *)encodedDataWithImage:(nullable UIImage *)image format:(SDImageFormat)format; 89 | 90 | @end 91 | 92 | 93 | /** 94 | This is the image coder protocol to provide custom progressive image decoding. 95 | These methods are all required to implement. 96 | @note Pay attention that these methods are not called from main queue. 97 | */ 98 | @protocol SDWebImageProgressiveCoder 99 | 100 | @required 101 | /** 102 | Returns YES if this coder can incremental decode some data. Otherwise, it should be passed to another coder. 103 | 104 | @param data The image data so we can look at it 105 | @return YES if this coder can decode the data, NO otherwise 106 | */ 107 | - (BOOL)canIncrementallyDecodeFromData:(nullable NSData *)data; 108 | 109 | /** 110 | Incremental decode the image data to image. 111 | 112 | @param data The image data has been downloaded so far 113 | @param finished Whether the download has finished 114 | @warning because incremental decoding need to keep the decoded context, we will alloc a new instance with the same class for each download operation to avoid conflicts 115 | @return The decoded image from data 116 | */ 117 | - (nullable UIImage *)incrementallyDecodedImageWithData:(nullable NSData *)data finished:(BOOL)finished; 118 | 119 | @end 120 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCoder.h" 10 | 11 | NSString * const SDWebImageCoderScaleDownLargeImagesKey = @"scaleDownLargeImages"; 12 | 13 | CGColorSpaceRef SDCGColorSpaceGetDeviceRGB(void) { 14 | static CGColorSpaceRef colorSpace; 15 | static dispatch_once_t onceToken; 16 | dispatch_once(&onceToken, ^{ 17 | colorSpace = CGColorSpaceCreateDeviceRGB(); 18 | }); 19 | return colorSpace; 20 | } 21 | 22 | BOOL SDCGImageRefContainsAlpha(CGImageRef imageRef) { 23 | if (!imageRef) { 24 | return NO; 25 | } 26 | CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef); 27 | BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone || 28 | alphaInfo == kCGImageAlphaNoneSkipFirst || 29 | alphaInfo == kCGImageAlphaNoneSkipLast); 30 | return hasAlpha; 31 | } 32 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageFrame.h" 12 | 13 | @interface SDWebImageCoderHelper : NSObject 14 | 15 | /** 16 | Return an animated image with frames array. 17 | For UIKit, this will apply the patch and then create animated UIImage. The patch is because that `+[UIImage animatedImageWithImages:duration:]` just use the average of duration for each image. So it will not work if different frame has different duration. Therefore we repeat the specify frame for specify times to let it work. 18 | For AppKit, NSImage does not support animates other than GIF. This will try to encode the frames to GIF format and then create an animated NSImage for rendering. Attention the animated image may loss some detail if the input frames contain full alpha channel because GIF only supports 1 bit alpha channel. (For 1 pixel, either transparent or not) 19 | 20 | @param frames The frames array. If no frames or frames is empty, return nil 21 | @return A animated image for rendering on UIImageView(UIKit) or NSImageView(AppKit) 22 | */ 23 | + (UIImage * _Nullable)animatedImageWithFrames:(NSArray * _Nullable)frames; 24 | 25 | /** 26 | Return frames array from an animated image. 27 | For UIKit, this will unapply the patch for the description above and then create frames array. This will also work for normal animated UIImage. 28 | For AppKit, NSImage does not support animates other than GIF. This will try to decode the GIF imageRep and then create frames array. 29 | 30 | @param animatedImage A animated image. If it's not animated, return nil 31 | @return The frames array 32 | */ 33 | + (NSArray * _Nullable)framesFromAnimatedImage:(UIImage * _Nullable)animatedImage; 34 | 35 | #if SD_UIKIT || SD_WATCH 36 | /** 37 | Convert an EXIF image orientation to an iOS one. 38 | 39 | @param exifOrientation EXIF orientation 40 | @return iOS orientation 41 | */ 42 | + (UIImageOrientation)imageOrientationFromEXIFOrientation:(NSInteger)exifOrientation; 43 | /** 44 | Convert an iOS orientation to an EXIF image orientation. 45 | 46 | @param imageOrientation iOS orientation 47 | @return EXIF orientation 48 | */ 49 | + (NSInteger)exifOrientationFromImageOrientation:(UIImageOrientation)imageOrientation; 50 | #endif 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCoder.h" 11 | 12 | /** 13 | Global object holding the array of coders, so that we avoid passing them from object to object. 14 | Uses a priority queue behind scenes, which means the latest added coders have the highest priority. 15 | This is done so when encoding/decoding something, we go through the list and ask each coder if they can handle the current data. 16 | That way, users can add their custom coders while preserving our existing prebuilt ones 17 | 18 | Note: the `coders` getter will return the coders in their reversed order 19 | Example: 20 | - by default we internally set coders = `IOCoder`, `WebPCoder`. (`GIFCoder` is not recommended to add only if you want to get GIF support without `FLAnimatedImage`) 21 | - calling `coders` will return `@[WebPCoder, IOCoder]` 22 | - call `[addCoder:[MyCrazyCoder new]]` 23 | - calling `coders` now returns `@[MyCrazyCoder, WebPCoder, IOCoder]` 24 | 25 | Coders 26 | ------ 27 | A coder must conform to the `SDWebImageCoder` protocol or even to `SDWebImageProgressiveCoder` if it supports progressive decoding 28 | Conformance is important because that way, they will implement `canDecodeFromData` or `canEncodeToFormat` 29 | Those methods are called on each coder in the array (using the priority order) until one of them returns YES. 30 | That means that coder can decode that data / encode to that format 31 | */ 32 | @interface SDWebImageCodersManager : NSObject 33 | 34 | /** 35 | Shared reusable instance 36 | */ 37 | + (nonnull instancetype)sharedInstance; 38 | 39 | /** 40 | All coders in coders manager. The coders array is a priority queue, which means the later added coder will have the highest priority 41 | */ 42 | @property (nonatomic, strong, readwrite, nullable) NSArray* coders; 43 | 44 | /** 45 | Add a new coder to the end of coders array. Which has the highest priority. 46 | 47 | @param coder coder 48 | */ 49 | - (void)addCoder:(nonnull id)coder; 50 | 51 | /** 52 | Remove a coder in the coders array. 53 | 54 | @param coder coder 55 | */ 56 | - (void)removeCoder:(nonnull id)coder; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCodersManager.h" 10 | #import "SDWebImageImageIOCoder.h" 11 | #import "SDWebImageGIFCoder.h" 12 | #ifdef SD_WEBP 13 | #import "SDWebImageWebPCoder.h" 14 | #endif 15 | 16 | @interface SDWebImageCodersManager () 17 | 18 | @property (strong, nonatomic, nonnull) NSMutableArray* mutableCoders; 19 | @property (strong, nonatomic, nullable) dispatch_queue_t mutableCodersAccessQueue; 20 | 21 | @end 22 | 23 | @implementation SDWebImageCodersManager 24 | 25 | + (nonnull instancetype)sharedInstance { 26 | static dispatch_once_t once; 27 | static id instance; 28 | dispatch_once(&once, ^{ 29 | instance = [self new]; 30 | }); 31 | return instance; 32 | } 33 | 34 | - (instancetype)init { 35 | if (self = [super init]) { 36 | // initialize with default coders 37 | _mutableCoders = [@[[SDWebImageImageIOCoder sharedCoder]] mutableCopy]; 38 | #ifdef SD_WEBP 39 | [_mutableCoders addObject:[SDWebImageWebPCoder sharedCoder]]; 40 | #endif 41 | _mutableCodersAccessQueue = dispatch_queue_create("com.hackemist.SDWebImageCodersManager", DISPATCH_QUEUE_CONCURRENT); 42 | } 43 | return self; 44 | } 45 | 46 | #pragma mark - Coder IO operations 47 | 48 | - (void)addCoder:(nonnull id)coder { 49 | if ([coder conformsToProtocol:@protocol(SDWebImageCoder)]) { 50 | dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ 51 | [self.mutableCoders addObject:coder]; 52 | }); 53 | } 54 | } 55 | 56 | - (void)removeCoder:(nonnull id)coder { 57 | dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ 58 | [self.mutableCoders removeObject:coder]; 59 | }); 60 | } 61 | 62 | - (NSArray *)coders { 63 | __block NSArray *sortedCoders = nil; 64 | dispatch_sync(self.mutableCodersAccessQueue, ^{ 65 | sortedCoders = (NSArray *)[[[self.mutableCoders copy] reverseObjectEnumerator] allObjects]; 66 | }); 67 | return sortedCoders; 68 | } 69 | 70 | - (void)setCoders:(NSArray *)coders { 71 | dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ 72 | self.mutableCoders = [coders mutableCopy]; 73 | }); 74 | } 75 | 76 | #pragma mark - SDWebImageCoder 77 | - (BOOL)canDecodeFromData:(NSData *)data { 78 | for (id coder in self.coders) { 79 | if ([coder canDecodeFromData:data]) { 80 | return YES; 81 | } 82 | } 83 | return NO; 84 | } 85 | 86 | - (BOOL)canEncodeToFormat:(SDImageFormat)format { 87 | for (id coder in self.coders) { 88 | if ([coder canEncodeToFormat:format]) { 89 | return YES; 90 | } 91 | } 92 | return NO; 93 | } 94 | 95 | - (UIImage *)decodedImageWithData:(NSData *)data { 96 | if (!data) { 97 | return nil; 98 | } 99 | for (id coder in self.coders) { 100 | if ([coder canDecodeFromData:data]) { 101 | return [coder decodedImageWithData:data]; 102 | } 103 | } 104 | return nil; 105 | } 106 | 107 | - (UIImage *)decompressedImageWithImage:(UIImage *)image 108 | data:(NSData *__autoreleasing _Nullable *)data 109 | options:(nullable NSDictionary*)optionsDict { 110 | if (!image) { 111 | return nil; 112 | } 113 | for (id coder in self.coders) { 114 | if ([coder canDecodeFromData:*data]) { 115 | return [coder decompressedImageWithImage:image data:data options:optionsDict]; 116 | } 117 | } 118 | return nil; 119 | } 120 | 121 | - (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format { 122 | if (!image) { 123 | return nil; 124 | } 125 | for (id coder in self.coders) { 126 | if ([coder canEncodeToFormat:format]) { 127 | return [coder encodedDataWithImage:image format:format]; 128 | } 129 | } 130 | return nil; 131 | } 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | // Apple's defines from TargetConditionals.h are a bit weird. 17 | // Seems like TARGET_OS_MAC is always defined (on all platforms). 18 | // To determine if we are running on OSX, we can only rely on TARGET_OS_IPHONE=0 and all the other platforms 19 | #if !TARGET_OS_IPHONE && !TARGET_OS_IOS && !TARGET_OS_TV && !TARGET_OS_WATCH 20 | #define SD_MAC 1 21 | #else 22 | #define SD_MAC 0 23 | #endif 24 | 25 | // iOS and tvOS are very similar, UIKit exists on both platforms 26 | // Note: watchOS also has UIKit, but it's very limited 27 | #if TARGET_OS_IOS || TARGET_OS_TV 28 | #define SD_UIKIT 1 29 | #else 30 | #define SD_UIKIT 0 31 | #endif 32 | 33 | #if TARGET_OS_IOS 34 | #define SD_IOS 1 35 | #else 36 | #define SD_IOS 0 37 | #endif 38 | 39 | #if TARGET_OS_TV 40 | #define SD_TV 1 41 | #else 42 | #define SD_TV 0 43 | #endif 44 | 45 | #if TARGET_OS_WATCH 46 | #define SD_WATCH 1 47 | #else 48 | #define SD_WATCH 0 49 | #endif 50 | 51 | 52 | #if SD_MAC 53 | #import 54 | #ifndef UIImage 55 | #define UIImage NSImage 56 | #endif 57 | #ifndef UIImageView 58 | #define UIImageView NSImageView 59 | #endif 60 | #ifndef UIView 61 | #define UIView NSView 62 | #endif 63 | #else 64 | #if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 65 | #error SDWebImage doesn't support Deployment Target version < 5.0 66 | #endif 67 | 68 | #if SD_UIKIT 69 | #import 70 | #endif 71 | #if SD_WATCH 72 | #import 73 | #endif 74 | #endif 75 | 76 | #ifndef NS_ENUM 77 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 78 | #endif 79 | 80 | #ifndef NS_OPTIONS 81 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 82 | #endif 83 | 84 | FOUNDATION_EXPORT UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 85 | 86 | typedef void(^SDWebImageNoParamsBlock)(void); 87 | 88 | FOUNDATION_EXPORT NSString *const SDWebImageErrorDomain; 89 | 90 | #ifndef dispatch_queue_async_safe 91 | #define dispatch_queue_async_safe(queue, block)\ 92 | if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(queue)) == 0) {\ 93 | block();\ 94 | } else {\ 95 | dispatch_async(queue, block);\ 96 | } 97 | #endif 98 | 99 | #ifndef dispatch_main_async_safe 100 | #define dispatch_main_async_safe(block) dispatch_queue_async_safe(dispatch_get_main_queue(), block) 101 | #endif 102 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "UIImage+MultiFormat.h" 11 | 12 | #if !__has_feature(objc_arc) 13 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 14 | #endif 15 | 16 | #if !OS_OBJECT_USE_OBJC 17 | #error SDWebImage need ARC for dispatch object 18 | #endif 19 | 20 | inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) { 21 | if (!image) { 22 | return nil; 23 | } 24 | 25 | #if SD_MAC 26 | return image; 27 | #elif SD_UIKIT || SD_WATCH 28 | if ((image.images).count > 0) { 29 | NSMutableArray *scaledImages = [NSMutableArray array]; 30 | 31 | for (UIImage *tempImage in image.images) { 32 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 33 | } 34 | 35 | UIImage *animatedImage = [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 36 | if (animatedImage) { 37 | animatedImage.sd_imageLoopCount = image.sd_imageLoopCount; 38 | } 39 | return animatedImage; 40 | } else { 41 | #if SD_WATCH 42 | if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) { 43 | #elif SD_UIKIT 44 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 45 | #endif 46 | CGFloat scale = 1; 47 | if (key.length >= 8) { 48 | NSRange range = [key rangeOfString:@"@2x."]; 49 | if (range.location != NSNotFound) { 50 | scale = 2.0; 51 | } 52 | 53 | range = [key rangeOfString:@"@3x."]; 54 | if (range.location != NSNotFound) { 55 | scale = 3.0; 56 | } 57 | } 58 | 59 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 60 | image = scaledImage; 61 | } 62 | return image; 63 | } 64 | #endif 65 | } 66 | 67 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 68 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageDownloader.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStartNotification; 14 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadReceiveResponseNotification; 15 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadStopNotification; 16 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageDownloadFinishNotification; 17 | 18 | 19 | 20 | /** 21 | Describes a downloader operation. If one wants to use a custom downloader op, it needs to inherit from `NSOperation` and conform to this protocol 22 | For the description about these methods, see `SDWebImageDownloaderOperation` 23 | */ 24 | @protocol SDWebImageDownloaderOperationInterface 25 | 26 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request 27 | inSession:(nullable NSURLSession *)session 28 | options:(SDWebImageDownloaderOptions)options; 29 | 30 | - (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 31 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; 32 | 33 | - (BOOL)shouldDecompressImages; 34 | - (void)setShouldDecompressImages:(BOOL)value; 35 | 36 | - (nullable NSURLCredential *)credential; 37 | - (void)setCredential:(nullable NSURLCredential *)value; 38 | 39 | - (BOOL)cancel:(nullable id)token; 40 | 41 | @end 42 | 43 | 44 | @interface SDWebImageDownloaderOperation : NSOperation 45 | 46 | /** 47 | * The request used by the operation's task. 48 | */ 49 | @property (strong, nonatomic, readonly, nullable) NSURLRequest *request; 50 | 51 | /** 52 | * The operation's task 53 | */ 54 | @property (strong, nonatomic, readonly, nullable) NSURLSessionTask *dataTask; 55 | 56 | 57 | @property (assign, nonatomic) BOOL shouldDecompressImages; 58 | 59 | /** 60 | * Was used to determine whether the URL connection should consult the credential storage for authenticating the connection. 61 | * @deprecated Not used for a couple of versions 62 | */ 63 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage __deprecated_msg("Property deprecated. Does nothing. Kept only for backwards compatibility"); 64 | 65 | /** 66 | * The credential used for authentication challenges in `-URLSession:task:didReceiveChallenge:completionHandler:`. 67 | * 68 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 69 | */ 70 | @property (nonatomic, strong, nullable) NSURLCredential *credential; 71 | 72 | /** 73 | * The SDWebImageDownloaderOptions for the receiver. 74 | */ 75 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 76 | 77 | /** 78 | * The expected size of data. 79 | */ 80 | @property (assign, nonatomic) NSInteger expectedSize; 81 | 82 | /** 83 | * The response returned by the operation's task. 84 | */ 85 | @property (strong, nonatomic, nullable) NSURLResponse *response; 86 | 87 | /** 88 | * Initializes a `SDWebImageDownloaderOperation` object 89 | * 90 | * @see SDWebImageDownloaderOperation 91 | * 92 | * @param request the URL request 93 | * @param session the URL session in which this operation will run 94 | * @param options downloader options 95 | * 96 | * @return the initialized instance 97 | */ 98 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request 99 | inSession:(nullable NSURLSession *)session 100 | options:(SDWebImageDownloaderOptions)options NS_DESIGNATED_INITIALIZER; 101 | 102 | /** 103 | * Adds handlers for progress and completion. Returns a tokent that can be passed to -cancel: to cancel this set of 104 | * callbacks. 105 | * 106 | * @param progressBlock the block executed when a new chunk of data arrives. 107 | * @note the progress block is executed on a background queue 108 | * @param completedBlock the block executed when the download is done. 109 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue 110 | * 111 | * @return the token to use to cancel this set of handlers 112 | */ 113 | - (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 114 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock; 115 | 116 | /** 117 | * Cancels a set of callbacks. Once all callbacks are canceled, the operation is cancelled. 118 | * 119 | * @param token the token representing a set of callbacks to cancel 120 | * 121 | * @return YES if the operation was stopped because this was the last token to be canceled. NO otherwise. 122 | */ 123 | - (BOOL)cancel:(nullable id)token; 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageFrame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDWebImageFrame : NSObject 13 | 14 | // This class is used for creating animated images via `animatedImageWithFrames` in `SDWebImageCoderHelper`. Attention if you need to specify animated images loop count, use `sd_imageLoopCount` property in `UIImage+MultiFormat`. 15 | 16 | /** 17 | The image of current frame. You should not set an animated image. 18 | */ 19 | @property (nonatomic, strong, readonly, nonnull) UIImage *image; 20 | /** 21 | The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero. 22 | */ 23 | @property (nonatomic, readonly, assign) NSTimeInterval duration; 24 | 25 | /** 26 | Create a frame instance with specify image and duration 27 | 28 | @param image current frame's image 29 | @param duration current frame's duration 30 | @return frame instance 31 | */ 32 | + (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageFrame.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageFrame.h" 10 | 11 | @interface SDWebImageFrame () 12 | 13 | @property (nonatomic, strong, readwrite, nonnull) UIImage *image; 14 | @property (nonatomic, readwrite, assign) NSTimeInterval duration; 15 | 16 | @end 17 | 18 | @implementation SDWebImageFrame 19 | 20 | + (instancetype)frameWithImage:(UIImage *)image duration:(NSTimeInterval)duration { 21 | SDWebImageFrame *frame = [[SDWebImageFrame alloc] init]; 22 | frame.image = image; 23 | frame.duration = duration; 24 | 25 | return frame; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCoder.h" 11 | 12 | /** 13 | Built in coder using ImageIO that supports GIF encoding/decoding 14 | @note `SDWebImageIOCoder` supports GIF but only as static (will use the 1st frame). 15 | @note Use `SDWebImageGIFCoder` for fully animated GIFs - less performant than `FLAnimatedImage` 16 | @note If you decide to make all `UIImageView`(including `FLAnimatedImageView`) instance support GIF. You should add this coder to `SDWebImageCodersManager` and make sure that it has a higher priority than `SDWebImageIOCoder` 17 | @note The recommended approach for animated GIFs is using `FLAnimatedImage`. It's more performant than `UIImageView` for GIF displaying 18 | */ 19 | @interface SDWebImageGIFCoder : NSObject 20 | 21 | + (nonnull instancetype)sharedCoder; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCoder.h" 11 | 12 | /** 13 | Built in coder that supports PNG, JPEG, TIFF, includes support for progressive decoding. 14 | 15 | GIF 16 | Also supports static GIF (meaning will only handle the 1st frame). 17 | For a full GIF support, we recommend `FLAnimatedImage` or our less performant `SDWebImageGIFCoder` 18 | 19 | HEIC 20 | This coder also supports HEIC format because ImageIO supports it natively. But it depends on the system capabilities, so it won't work on all devices, see: https://devstreaming-cdn.apple.com/videos/wwdc/2017/511tj33587vdhds/511/511_working_with_heif_and_hevc.pdf 21 | Decode(Software): !Simulator && (iOS 11 || tvOS 11 || macOS 10.13) 22 | Decode(Hardware): !Simulator && ((iOS 11 && A9Chip) || (macOS 10.13 && 6thGenerationIntelCPU)) 23 | Encode(Software): macOS 10.13 24 | Encode(Hardware): !Simulator && ((iOS 11 && A10FusionChip) || (macOS 10.13 && 6thGenerationIntelCPU)) 25 | */ 26 | @interface SDWebImageImageIOCoder : NSObject 27 | 28 | + (nonnull instancetype)sharedCoder; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(nullable NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly, nonnull) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (strong, nonatomic, nonnull) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic, nullable) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (nonnull instancetype)sharedImagePrefetcher; 72 | 73 | /** 74 | * Allows you to instantiate a prefetcher with any arbitrary image manager. 75 | */ 76 | - (nonnull instancetype)initWithImageManager:(nonnull SDWebImageManager *)manager NS_DESIGNATED_INITIALIZER; 77 | 78 | /** 79 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 80 | * currently one image is downloaded at a time, 81 | * and skips images for failed downloads and proceed to the next image in the list. 82 | * Any previously-running prefetch operations are canceled. 83 | * 84 | * @param urls list of URLs to prefetch 85 | */ 86 | - (void)prefetchURLs:(nullable NSArray *)urls; 87 | 88 | /** 89 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 90 | * currently one image is downloaded at a time, 91 | * and skips images for failed downloads and proceed to the next image in the list. 92 | * Any previously-running prefetch operations are canceled. 93 | * 94 | * @param urls list of URLs to prefetch 95 | * @param progressBlock block to be called when progress updates; 96 | * first parameter is the number of completed (successful or not) requests, 97 | * second parameter is the total number of images originally requested to be prefetched 98 | * @param completionBlock block to be called when prefetching is completed 99 | * first param is the number of completed (successful or not) requests, 100 | * second parameter is the number of skipped requests 101 | */ 102 | - (void)prefetchURLs:(nullable NSArray *)urls 103 | progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock 104 | completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock; 105 | 106 | /** 107 | * Remove and cancel queued list 108 | */ 109 | - (void)cancelPrefetching; 110 | 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageTransition.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | #import "SDImageCache.h" 13 | 14 | // This class is used to provide a transition animation after the view category load image finished. Use this on `sd_imageTransition` in UIView+WebCache.h 15 | // for UIKit(iOS & tvOS), we use `+[UIView transitionWithView:duration:options:animations:completion]` for transition animation. 16 | // for AppKit(macOS), we use `+[NSAnimationContext runAnimationGroup:completionHandler:]` for transition animation. You can call `+[NSAnimationContext currentContext]` to grab the context during animations block. 17 | // These transition are provided for basic usage. If you need complicated animation, consider to directly use Core Animation or use `SDWebImageAvoidAutoSetImage` and implement your own after image load finished. 18 | 19 | #if SD_UIKIT 20 | typedef UIViewAnimationOptions SDWebImageAnimationOptions; 21 | #else 22 | typedef NS_OPTIONS(NSUInteger, SDWebImageAnimationOptions) { 23 | SDWebImageAnimationOptionAllowsImplicitAnimation = 1 << 0, // specify `allowsImplicitAnimation` for the `NSAnimationContext` 24 | }; 25 | #endif 26 | 27 | typedef void (^SDWebImageTransitionPreparesBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image, NSData * _Nullable imageData, SDImageCacheType cacheType, NSURL * _Nullable imageURL); 28 | typedef void (^SDWebImageTransitionAnimationsBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image); 29 | typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished); 30 | 31 | @interface SDWebImageTransition : NSObject 32 | 33 | /** 34 | By default, we set the image to the view at the beginning of the animtions. You can disable this and provide custom set image process 35 | */ 36 | @property (nonatomic, assign) BOOL avoidAutoSetImage; 37 | /** 38 | The duration of the transition animation, measured in seconds. Defaults to 0.5. 39 | */ 40 | @property (nonatomic, assign) NSTimeInterval duration; 41 | /** 42 | The timing function used for all animations within this transition animation (macOS). 43 | */ 44 | @property (nonatomic, strong, nullable) CAMediaTimingFunction *timingFunction NS_AVAILABLE_MAC(10_7); 45 | /** 46 | A mask of options indicating how you want to perform the animations. 47 | */ 48 | @property (nonatomic, assign) SDWebImageAnimationOptions animationOptions; 49 | /** 50 | A block object to be executed before the animation sequence starts. 51 | */ 52 | @property (nonatomic, copy, nullable) SDWebImageTransitionPreparesBlock prepares; 53 | /** 54 | A block object that contains the changes you want to make to the specified view. 55 | */ 56 | @property (nonatomic, copy, nullable) SDWebImageTransitionAnimationsBlock animations; 57 | /** 58 | A block object to be executed when the animation sequence ends. 59 | */ 60 | @property (nonatomic, copy, nullable) SDWebImageTransitionCompletionBlock completion; 61 | 62 | @end 63 | 64 | // Convenience way to create transition. Remember to specify the duration if needed. 65 | // for UIKit, these transition just use the correspond `animationOptions` 66 | // for AppKit, these transition use Core Animation in `animations`. So your view must be layer-backed. Set `wantsLayer = YES` before you apply it. 67 | 68 | @interface SDWebImageTransition (Conveniences) 69 | 70 | // class property is available in Xcode 8. We will drop the Xcode 7.3 support in 5.x 71 | #if __has_feature(objc_class_property) 72 | /// Fade transition. 73 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *fadeTransition; 74 | /// Flip from left transition. 75 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromLeftTransition; 76 | /// Flip from right transition. 77 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromRightTransition; 78 | /// Flip from top transition. 79 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromTopTransition; 80 | /// Flip from bottom transition. 81 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromBottomTransition; 82 | /// Curl up transition. 83 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlUpTransition; 84 | /// Curl down transition. 85 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlDownTransition; 86 | #else 87 | + (nonnull instancetype)fadeTransition; 88 | + (nonnull instancetype)flipFromLeftTransition; 89 | + (nonnull instancetype)flipFromRightTransition; 90 | + (nonnull instancetype)flipFromTopTransition; 91 | + (nonnull instancetype)flipFromBottomTransition; 92 | + (nonnull instancetype)curlUpTransition; 93 | + (nonnull instancetype)curlDownTransition; 94 | #endif 95 | 96 | @end 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageTransition.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageTransition.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #if SD_MAC 14 | #import 15 | #endif 16 | 17 | @implementation SDWebImageTransition 18 | 19 | - (instancetype)init { 20 | self = [super init]; 21 | if (self) { 22 | self.duration = 0.5; 23 | } 24 | return self; 25 | } 26 | 27 | @end 28 | 29 | @implementation SDWebImageTransition (Conveniences) 30 | 31 | + (SDWebImageTransition *)fadeTransition { 32 | SDWebImageTransition *transition = [SDWebImageTransition new]; 33 | #if SD_UIKIT 34 | transition.animationOptions = UIViewAnimationOptionTransitionCrossDissolve; 35 | #else 36 | transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) { 37 | CATransition *trans = [CATransition animation]; 38 | trans.type = kCATransitionFade; 39 | [view.layer addAnimation:trans forKey:kCATransition]; 40 | }; 41 | #endif 42 | return transition; 43 | } 44 | 45 | + (SDWebImageTransition *)flipFromLeftTransition { 46 | SDWebImageTransition *transition = [SDWebImageTransition new]; 47 | #if SD_UIKIT 48 | transition.animationOptions = UIViewAnimationOptionTransitionFlipFromLeft; 49 | #else 50 | transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) { 51 | CATransition *trans = [CATransition animation]; 52 | trans.type = kCATransitionPush; 53 | trans.subtype = kCATransitionFromLeft; 54 | [view.layer addAnimation:trans forKey:kCATransition]; 55 | }; 56 | #endif 57 | return transition; 58 | } 59 | 60 | + (SDWebImageTransition *)flipFromRightTransition { 61 | SDWebImageTransition *transition = [SDWebImageTransition new]; 62 | #if SD_UIKIT 63 | transition.animationOptions = UIViewAnimationOptionTransitionFlipFromRight; 64 | #else 65 | transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) { 66 | CATransition *trans = [CATransition animation]; 67 | trans.type = kCATransitionPush; 68 | trans.subtype = kCATransitionFromRight; 69 | [view.layer addAnimation:trans forKey:kCATransition]; 70 | }; 71 | #endif 72 | return transition; 73 | } 74 | 75 | + (SDWebImageTransition *)flipFromTopTransition { 76 | SDWebImageTransition *transition = [SDWebImageTransition new]; 77 | #if SD_UIKIT 78 | transition.animationOptions = UIViewAnimationOptionTransitionFlipFromTop; 79 | #else 80 | transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) { 81 | CATransition *trans = [CATransition animation]; 82 | trans.type = kCATransitionPush; 83 | trans.subtype = kCATransitionFromTop; 84 | [view.layer addAnimation:trans forKey:kCATransition]; 85 | }; 86 | #endif 87 | return transition; 88 | } 89 | 90 | + (SDWebImageTransition *)flipFromBottomTransition { 91 | SDWebImageTransition *transition = [SDWebImageTransition new]; 92 | #if SD_UIKIT 93 | transition.animationOptions = UIViewAnimationOptionTransitionFlipFromBottom; 94 | #else 95 | transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) { 96 | CATransition *trans = [CATransition animation]; 97 | trans.type = kCATransitionPush; 98 | trans.subtype = kCATransitionFromBottom; 99 | [view.layer addAnimation:trans forKey:kCATransition]; 100 | }; 101 | #endif 102 | return transition; 103 | } 104 | 105 | + (SDWebImageTransition *)curlUpTransition { 106 | SDWebImageTransition *transition = [SDWebImageTransition new]; 107 | #if SD_UIKIT 108 | transition.animationOptions = UIViewAnimationOptionTransitionCurlUp; 109 | #else 110 | transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) { 111 | CATransition *trans = [CATransition animation]; 112 | trans.type = kCATransitionReveal; 113 | trans.subtype = kCATransitionFromTop; 114 | [view.layer addAnimation:trans forKey:kCATransition]; 115 | }; 116 | #endif 117 | return transition; 118 | } 119 | 120 | + (SDWebImageTransition *)curlDownTransition { 121 | SDWebImageTransition *transition = [SDWebImageTransition new]; 122 | #if SD_UIKIT 123 | transition.animationOptions = UIViewAnimationOptionTransitionCurlDown; 124 | #else 125 | transition.animations = ^(__kindof NSView * _Nonnull view, NSImage * _Nullable image) { 126 | CATransition *trans = [CATransition animation]; 127 | trans.type = kCATransitionReveal; 128 | trans.subtype = kCATransitionFromBottom; 129 | [view.layer addAnimation:trans forKey:kCATransition]; 130 | }; 131 | #endif 132 | return transition; 133 | } 134 | 135 | @end 136 | 137 | #endif 138 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | @interface UIImage (ForceDecode) 12 | 13 | + (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image; 14 | 15 | + (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+ForceDecode.h" 10 | #import "SDWebImageCodersManager.h" 11 | 12 | @implementation UIImage (ForceDecode) 13 | 14 | + (UIImage *)decodedImageWithImage:(UIImage *)image { 15 | if (!image) { 16 | return nil; 17 | } 18 | NSData *tempData; 19 | return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(NO)}]; 20 | } 21 | 22 | + (UIImage *)decodedAndScaledDownImageWithImage:(UIImage *)image { 23 | if (!image) { 24 | return nil; 25 | } 26 | NSData *tempData; 27 | return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(YES)}]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface UIImage (GIF) 13 | 14 | /** 15 | * Creates an animated UIImage from an NSData. 16 | * For static GIF, will create an UIImage with `images` array set to nil. For animated GIF, will create an UIImage with valid `images` array. 17 | */ 18 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 19 | 20 | /** 21 | * Checks if an UIImage instance is a GIF. Will use the `images` array. 22 | */ 23 | - (BOOL)isGIF; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+GIF.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "UIImage+GIF.h" 11 | #import "SDWebImageGIFCoder.h" 12 | #import "NSImage+WebCache.h" 13 | 14 | @implementation UIImage (GIF) 15 | 16 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data { 17 | if (!data) { 18 | return nil; 19 | } 20 | return [[SDWebImageGIFCoder sharedCoder] decodedImageWithData:data]; 21 | } 22 | 23 | - (BOOL)isGIF { 24 | return (self.images != nil); 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "NSData+ImageContentType.h" 11 | 12 | @interface UIImage (MultiFormat) 13 | 14 | /** 15 | * UIKit: 16 | * For static image format, this value is always 0. 17 | * For animated image format, 0 means infinite looping. 18 | * Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods. 19 | * AppKit: 20 | * NSImage currently only support animated via GIF imageRep unlike UIImage. 21 | * The getter of this property will get the loop count from GIF imageRep 22 | * The setter of this property will set the loop count from GIF imageRep 23 | */ 24 | @property (nonatomic, assign) NSUInteger sd_imageLoopCount; 25 | 26 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data; 27 | - (nullable NSData *)sd_imageData; 28 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+MultiFormat.h" 10 | 11 | #import "objc/runtime.h" 12 | #import "SDWebImageCodersManager.h" 13 | 14 | @implementation UIImage (MultiFormat) 15 | 16 | #if SD_MAC 17 | - (NSUInteger)sd_imageLoopCount { 18 | NSUInteger imageLoopCount = 0; 19 | for (NSImageRep *rep in self.representations) { 20 | if ([rep isKindOfClass:[NSBitmapImageRep class]]) { 21 | NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; 22 | imageLoopCount = [[bitmapRep valueForProperty:NSImageLoopCount] unsignedIntegerValue]; 23 | break; 24 | } 25 | } 26 | return imageLoopCount; 27 | } 28 | 29 | - (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount { 30 | for (NSImageRep *rep in self.representations) { 31 | if ([rep isKindOfClass:[NSBitmapImageRep class]]) { 32 | NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; 33 | [bitmapRep setProperty:NSImageLoopCount withValue:@(sd_imageLoopCount)]; 34 | break; 35 | } 36 | } 37 | } 38 | 39 | #else 40 | 41 | - (NSUInteger)sd_imageLoopCount { 42 | NSUInteger imageLoopCount = 0; 43 | NSNumber *value = objc_getAssociatedObject(self, @selector(sd_imageLoopCount)); 44 | if ([value isKindOfClass:[NSNumber class]]) { 45 | imageLoopCount = value.unsignedIntegerValue; 46 | } 47 | return imageLoopCount; 48 | } 49 | 50 | - (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount { 51 | NSNumber *value = @(sd_imageLoopCount); 52 | objc_setAssociatedObject(self, @selector(sd_imageLoopCount), value, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 53 | } 54 | #endif 55 | 56 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data { 57 | return [[SDWebImageCodersManager sharedInstance] decodedImageWithData:data]; 58 | } 59 | 60 | - (nullable NSData *)sd_imageData { 61 | return [self sd_imageDataAsFormat:SDImageFormatUndefined]; 62 | } 63 | 64 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat { 65 | NSData *imageData = nil; 66 | if (self) { 67 | imageData = [[SDWebImageCodersManager sharedInstance] encodedDataWithImage:self format:imageFormat]; 68 | } 69 | return imageData; 70 | } 71 | 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | /** 16 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. 17 | */ 18 | @interface UIImageView (HighlightedWebCache) 19 | 20 | /** 21 | * Set the imageView `highlightedImage` with an `url`. 22 | * 23 | * The download is asynchronous and cached. 24 | * 25 | * @param url The url for the image. 26 | */ 27 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; 28 | 29 | /** 30 | * Set the imageView `highlightedImage` with an `url` and custom options. 31 | * 32 | * The download is asynchronous and cached. 33 | * 34 | * @param url The url for the image. 35 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 36 | */ 37 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 38 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; 39 | 40 | /** 41 | * Set the imageView `highlightedImage` with an `url`. 42 | * 43 | * The download is asynchronous and cached. 44 | * 45 | * @param url The url for the image. 46 | * @param completedBlock A block called when operation has been completed. This block has no return value 47 | * and takes the requested UIImage as first parameter. In case of error the image parameter 48 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 49 | * indicating if the image was retrieved from the local cache or from the network. 50 | * The fourth parameter is the original image url. 51 | */ 52 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 53 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; 54 | 55 | /** 56 | * Set the imageView `highlightedImage` with an `url` and custom options. 57 | * 58 | * The download is asynchronous and cached. 59 | * 60 | * @param url The url for the image. 61 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 62 | * @param completedBlock A block called when operation has been completed. This block has no return value 63 | * and takes the requested UIImage as first parameter. In case of error the image parameter 64 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 65 | * indicating if the image was retrieved from the local cache or from the network. 66 | * The fourth parameter is the original image url. 67 | */ 68 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 69 | options:(SDWebImageOptions)options 70 | completed:(nullable SDExternalCompletionBlock)completedBlock; 71 | 72 | /** 73 | * Set the imageView `highlightedImage` with an `url` and custom options. 74 | * 75 | * The download is asynchronous and cached. 76 | * 77 | * @param url The url for the image. 78 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 79 | * @param progressBlock A block called while image is downloading 80 | * @note the progress block is executed on a background queue 81 | * @param completedBlock A block called when operation has been completed. This block has no return value 82 | * and takes the requested UIImage as first parameter. In case of error the image parameter 83 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 84 | * indicating if the image was retrieved from the local cache or from the network. 85 | * The fourth parameter is the original image url. 86 | */ 87 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 88 | options:(SDWebImageOptions)options 89 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 90 | completed:(nullable SDExternalCompletionBlock)completedBlock; 91 | 92 | @end 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImageView+HighlightedWebCache.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "UIView+WebCacheOperation.h" 14 | #import "UIView+WebCache.h" 15 | 16 | @implementation UIImageView (HighlightedWebCache) 17 | 18 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url { 19 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 20 | } 21 | 22 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options { 23 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 24 | } 25 | 26 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { 27 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 28 | } 29 | 30 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { 31 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 32 | } 33 | 34 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 35 | options:(SDWebImageOptions)options 36 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 37 | completed:(nullable SDExternalCompletionBlock)completedBlock { 38 | __weak typeof(self)weakSelf = self; 39 | [self sd_internalSetImageWithURL:url 40 | placeholderImage:nil 41 | options:options 42 | operationKey:@"UIImageViewImageOperationHighlighted" 43 | setImageBlock:^(UIImage *image, NSData *imageData) { 44 | weakSelf.highlightedImage = image; 45 | } 46 | progress:progressBlock 47 | completed:completedBlock]; 48 | } 49 | 50 | @end 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | // These methods are used to support canceling for UIView image loading, it's designed to be used internal but not external. 16 | // All the stored operations are weak, so it will be dalloced after image loading finished. If you need to store operations, use your own class to keep a strong reference for them. 17 | @interface UIView (WebCacheOperation) 18 | 19 | /** 20 | * Set the image load operation (storage in a UIView based weak map table) 21 | * 22 | * @param operation the operation 23 | * @param key key for storing the operation 24 | */ 25 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; 26 | 27 | /** 28 | * Cancel all operations for the current UIView and key 29 | * 30 | * @param key key for identifying the operations 31 | */ 32 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; 33 | 34 | /** 35 | * Just remove the operations corresponding to the current UIView and key without cancelling them 36 | * 37 | * @param key key for identifying the operations 38 | */ 39 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; 40 | 41 | @end 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCacheOperation.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "objc/runtime.h" 14 | 15 | static char loadOperationKey; 16 | 17 | // key is copy, value is weak because operation instance is retained by SDWebImageManager's runningOperations property 18 | // we should use lock to keep thread-safe because these method may not be acessed from main queue 19 | typedef NSMapTable> SDOperationsDictionary; 20 | 21 | @implementation UIView (WebCacheOperation) 22 | 23 | - (SDOperationsDictionary *)sd_operationDictionary { 24 | @synchronized(self) { 25 | SDOperationsDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 26 | if (operations) { 27 | return operations; 28 | } 29 | operations = [[NSMapTable alloc] initWithKeyOptions:NSPointerFunctionsStrongMemory valueOptions:NSPointerFunctionsWeakMemory capacity:0]; 30 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 31 | return operations; 32 | } 33 | } 34 | 35 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key { 36 | if (key) { 37 | [self sd_cancelImageLoadOperationWithKey:key]; 38 | if (operation) { 39 | SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; 40 | @synchronized (self) { 41 | [operationDictionary setObject:operation forKey:key]; 42 | } 43 | } 44 | } 45 | } 46 | 47 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key { 48 | // Cancel in progress downloader from queue 49 | SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; 50 | id operation; 51 | @synchronized (self) { 52 | operation = [operationDictionary objectForKey:key]; 53 | } 54 | if (operation) { 55 | if ([operation conformsToProtocol:@protocol(SDWebImageOperation)]){ 56 | [operation cancel]; 57 | } 58 | @synchronized (self) { 59 | [operationDictionary removeObjectForKey:key]; 60 | } 61 | } 62 | } 63 | 64 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key { 65 | if (key) { 66 | SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; 67 | @synchronized (self) { 68 | [operationDictionary removeObjectForKey:key]; 69 | } 70 | } 71 | } 72 | 73 | @end 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/CYLTabBarController-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_CYLTabBarController : NSObject 3 | @end 4 | @implementation PodsDummy_CYLTabBarController 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/CYLTabBarController-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/CYLTabBarController.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CYLTabBarController 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/CYLTabBarController" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CYLTabBarController" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/CYLTabBarController 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 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /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 = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${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 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MBVideoPlayer/Pods-MBVideoPlayer-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## CYLTabBarController 5 | 6 | Copyright (c) 2015 CYLTabBarController(https://github.com/ChenYilong/CYLTabBarController), L.L.C. 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 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 | ## Masonry 28 | 29 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 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 | ## SDWebImage 50 | 51 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com 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 furnished 58 | to do so, subject to the following conditions: 59 | 60 | The above copyright notice and this permission notice shall be included in all 61 | 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 | 71 | 72 | Generated by CocoaPods - https://cocoapods.org 73 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MBVideoPlayer/Pods-MBVideoPlayer-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2015 CYLTabBarController(https://github.com/ChenYilong/CYLTabBarController), L.L.C. All rights reserved. 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE 36 | 37 | License 38 | MIT 39 | Title 40 | CYLTabBarController 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy 49 | of this software and associated documentation files (the "Software"), to deal 50 | in the Software without restriction, including without limitation the rights 51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 52 | copies of the Software, and to permit persons to whom the Software is 53 | furnished to do so, subject to the following conditions: 54 | 55 | The above copyright notice and this permission notice shall be included in 56 | all copies or substantial portions of the Software. 57 | 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 64 | THE SOFTWARE. 65 | License 66 | MIT 67 | Title 68 | Masonry 69 | Type 70 | PSGroupSpecifier 71 | 72 | 73 | FooterText 74 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com 75 | 76 | Permission is hereby granted, free of charge, to any person obtaining a copy 77 | of this software and associated documentation files (the "Software"), to deal 78 | in the Software without restriction, including without limitation the rights 79 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 80 | copies of the Software, and to permit persons to whom the Software is furnished 81 | to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all 84 | copies or substantial portions of the Software. 85 | 86 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 87 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 88 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 89 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 90 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 91 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 92 | THE SOFTWARE. 93 | 94 | 95 | License 96 | MIT 97 | Title 98 | SDWebImage 99 | Type 100 | PSGroupSpecifier 101 | 102 | 103 | FooterText 104 | Generated by CocoaPods - https://cocoapods.org 105 | Title 106 | 107 | Type 108 | PSGroupSpecifier 109 | 110 | 111 | StringsTable 112 | Acknowledgements 113 | Title 114 | Acknowledgements 115 | 116 | 117 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MBVideoPlayer/Pods-MBVideoPlayer-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MBVideoPlayer : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MBVideoPlayer 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MBVideoPlayer/Pods-MBVideoPlayer.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CYLTabBarController" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CYLTabBarController" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"CYLTabBarController" -l"Masonry" -l"SDWebImage" -framework "Foundation" -framework "ImageIO" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-MBVideoPlayer/Pods-MBVideoPlayer.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/CYLTabBarController" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CYLTabBarController" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/CYLTabBarController" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"CYLTabBarController" -l"Masonry" -l"SDWebImage" -framework "Foundation" -framework "ImageIO" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SDWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_SDWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | OTHER_LDFLAGS = -framework "ImageIO" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /ReadMeImage/avplayerprocess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/ReadMeImage/avplayerprocess.png -------------------------------------------------------------------------------- /ReadMeImage/avplayerresourceLoader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/ReadMeImage/avplayerresourceLoader.png -------------------------------------------------------------------------------- /ReadMeImage/preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/ReadMeImage/preview.gif -------------------------------------------------------------------------------- /ReadMeImage/project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/ReadMeImage/project.png -------------------------------------------------------------------------------- /ReadMeImage/unlimitscroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dk250/MBVideoPlayer/1fc99f59efb0d076357baf2f2b87e6ffede5591c/ReadMeImage/unlimitscroll.png --------------------------------------------------------------------------------