├── Pods
├── Headers
│ ├── Public
│ │ └── SDWebImage
│ │ │ ├── UIImage+GIF.h
│ │ │ ├── SDImageCache.h
│ │ │ ├── NSImage+WebCache.h
│ │ │ ├── SDWebImageCompat.h
│ │ │ ├── UIView+WebCache.h
│ │ │ ├── SDImageCacheConfig.h
│ │ │ ├── SDWebImageDecoder.h
│ │ │ ├── SDWebImageManager.h
│ │ │ ├── UIButton+WebCache.h
│ │ │ ├── SDWebImageDownloader.h
│ │ │ ├── SDWebImageOperation.h
│ │ │ ├── SDWebImagePrefetcher.h
│ │ │ ├── UIImage+MultiFormat.h
│ │ │ ├── UIImageView+WebCache.h
│ │ │ ├── NSData+ImageContentType.h
│ │ │ ├── UIView+WebCacheOperation.h
│ │ │ ├── SDWebImageDownloaderOperation.h
│ │ │ └── UIImageView+HighlightedWebCache.h
│ └── Private
│ │ └── SDWebImage
│ │ ├── SDImageCache.h
│ │ ├── UIImage+GIF.h
│ │ ├── UIView+WebCache.h
│ │ ├── NSImage+WebCache.h
│ │ ├── SDImageCacheConfig.h
│ │ ├── SDWebImageCompat.h
│ │ ├── SDWebImageDecoder.h
│ │ ├── SDWebImageManager.h
│ │ ├── UIButton+WebCache.h
│ │ ├── SDWebImageDownloader.h
│ │ ├── SDWebImageOperation.h
│ │ ├── SDWebImagePrefetcher.h
│ │ ├── UIImage+MultiFormat.h
│ │ ├── UIImageView+WebCache.h
│ │ ├── NSData+ImageContentType.h
│ │ ├── UIView+WebCacheOperation.h
│ │ ├── SDWebImageDownloaderOperation.h
│ │ └── UIImageView+HighlightedWebCache.h
├── Target Support Files
│ ├── SDWebImage
│ │ ├── SDWebImage-dummy.m
│ │ ├── SDWebImage-prefix.pch
│ │ └── SDWebImage.xcconfig
│ ├── Pods-LB3DBanner
│ │ ├── Pods-LB3DBanner-dummy.m
│ │ ├── Pods-LB3DBanner.debug.xcconfig
│ │ ├── Pods-LB3DBanner.release.xcconfig
│ │ ├── Pods-LB3DBanner-acknowledgements.markdown
│ │ ├── Pods-LB3DBanner-acknowledgements.plist
│ │ ├── Pods-LB3DBanner-frameworks.sh
│ │ └── Pods-LB3DBanner-resources.sh
│ ├── Pods-LB3DBannerTests
│ │ ├── Pods-LB3DBannerTests-acknowledgements.markdown
│ │ ├── Pods-LB3DBannerTests-dummy.m
│ │ ├── Pods-LB3DBannerTests.debug.xcconfig
│ │ ├── Pods-LB3DBannerTests.release.xcconfig
│ │ ├── Pods-LB3DBannerTests-acknowledgements.plist
│ │ ├── Pods-LB3DBannerTests-frameworks.sh
│ │ └── Pods-LB3DBannerTests-resources.sh
│ └── Pods-LB3DBannerUITests
│ │ ├── Pods-LB3DBannerUITests-acknowledgements.markdown
│ │ ├── Pods-LB3DBannerUITests-dummy.m
│ │ ├── Pods-LB3DBannerUITests.debug.xcconfig
│ │ ├── Pods-LB3DBannerUITests.release.xcconfig
│ │ ├── Pods-LB3DBannerUITests-acknowledgements.plist
│ │ ├── Pods-LB3DBannerUITests-frameworks.sh
│ │ └── Pods-LB3DBannerUITests-resources.sh
├── Manifest.lock
├── SDWebImage
│ ├── SDWebImage
│ │ ├── SDWebImageOperation.h
│ │ ├── NSImage+WebCache.h
│ │ ├── UIImage+MultiFormat.h
│ │ ├── SDWebImageDecoder.h
│ │ ├── SDImageCacheConfig.m
│ │ ├── UIImage+GIF.h
│ │ ├── NSImage+WebCache.m
│ │ ├── NSData+ImageContentType.h
│ │ ├── SDImageCacheConfig.h
│ │ ├── UIView+WebCacheOperation.h
│ │ ├── NSData+ImageContentType.m
│ │ ├── UIImage+GIF.m
│ │ ├── SDWebImageCompat.m
│ │ ├── UIImageView+HighlightedWebCache.m
│ │ ├── UIView+WebCacheOperation.m
│ │ ├── UIView+WebCache.h
│ │ ├── SDWebImageCompat.h
│ │ ├── UIImageView+HighlightedWebCache.h
│ │ ├── SDWebImagePrefetcher.h
│ │ ├── SDWebImageDownloaderOperation.h
│ │ ├── UIImageView+WebCache.m
│ │ ├── SDWebImagePrefetcher.m
│ │ ├── UIImage+MultiFormat.m
│ │ ├── UIButton+WebCache.m
│ │ ├── UIView+WebCache.m
│ │ ├── UIImageView+WebCache.h
│ │ └── SDWebImageDownloader.h
│ ├── LICENSE
│ └── README.md
└── Pods.xcodeproj
│ └── xcuserdata
│ ├── wulongbo.xcuserdatad
│ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ ├── SDWebImage.xcscheme
│ │ ├── Pods-LB3DBanner.xcscheme
│ │ ├── Pods-LB3DBannerTests.xcscheme
│ │ └── Pods-LB3DBannerUITests.xcscheme
│ └── Bo.xcuserdatad
│ └── xcschemes
│ ├── xcschememanagement.plist
│ ├── SDWebImage.xcscheme
│ ├── Pods-LB3DBanner.xcscheme
│ ├── Pods-LB3DBannerTests.xcscheme
│ └── Pods-LB3DBannerUITests.xcscheme
├── LB3DBanner
├── ezgif.com-video-to-gif.gif
├── ViewController.h
├── AppDelegate.h
├── main.m
├── LB3DBanner
│ ├── LB3DBannerImageView.h
│ ├── LB3DBannerView.h
│ └── LB3DBannerImageView.m
├── Info.plist
├── Base.lproj
│ ├── Main.storyboard
│ └── LaunchScreen.storyboard
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── AppDelegate.m
└── ViewController.m
├── LB3DBanner.xcworkspace
├── xcuserdata
│ ├── wulongbo.xcuserdatad
│ │ ├── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ │ └── UserInterfaceState.xcuserstate
│ └── Bo.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── contents.xcworkspacedata
├── LB3DBanner.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── wulongbo.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── xcuserdata
│ ├── Bo.xcuserdatad
│ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── LB3DBanner.xcscheme
│ └── wulongbo.xcuserdatad
│ └── xcschemes
│ ├── xcschememanagement.plist
│ └── LB3DBanner.xcscheme
├── Podfile.lock
├── Podfile
├── LB3DBannerTests
├── Info.plist
└── LB3DBannerTests.m
├── LB3DBannerUITests
├── Info.plist
└── LB3DBannerUITests.m
├── README.md
└── .gitignore
/Pods/Headers/Public/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDImageCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDImageCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/NSImage+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSImage+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageCompat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/NSImage+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSImage+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDImageCacheConfig.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCacheConfig.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageManager.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDImageCacheConfig.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCacheConfig.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageDecoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageManager.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIButton+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.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/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.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/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h
--------------------------------------------------------------------------------
/LB3DBanner/ezgif.com-video-to-gif.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Fantast-WLB/LB3DBanner/HEAD/LB3DBanner/ezgif.com-video-to-gif.gif
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h
--------------------------------------------------------------------------------
/LB3DBanner.xcworkspace/xcuserdata/wulongbo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SDWebImage : NSObject
3 | @end
4 | @implementation PodsDummy_SDWebImage
5 | @end
6 |
--------------------------------------------------------------------------------
/LB3DBanner.xcworkspace/xcuserdata/Bo.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Fantast-WLB/LB3DBanner/HEAD/LB3DBanner.xcworkspace/xcuserdata/Bo.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBanner/Pods-LB3DBanner-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_LB3DBanner : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_LB3DBanner
5 | @end
6 |
--------------------------------------------------------------------------------
/LB3DBanner.xcworkspace/xcuserdata/wulongbo.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Fantast-WLB/LB3DBanner/HEAD/LB3DBanner.xcworkspace/xcuserdata/wulongbo.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerTests/Pods-LB3DBannerTests-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerTests/Pods-LB3DBannerTests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_LB3DBannerTests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_LB3DBannerTests
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerUITests/Pods-LB3DBannerUITests-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/LB3DBanner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerUITests/Pods-LB3DBannerUITests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_LB3DBannerUITests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_LB3DBannerUITests
5 | @end
6 |
--------------------------------------------------------------------------------
/LB3DBanner.xcodeproj/project.xcworkspace/xcuserdata/wulongbo.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Fantast-WLB/LB3DBanner/HEAD/LB3DBanner.xcodeproj/project.xcworkspace/xcuserdata/wulongbo.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/LB3DBanner/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // LB3DBanner
4 | //
5 | // Created by 吴龙波 on 2017/2/15.
6 | // Copyright © 2017年 吴龙波. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/LB3DBanner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - SDWebImage (4.0.0):
3 | - SDWebImage/Core (= 4.0.0)
4 | - SDWebImage/Core (4.0.0)
5 |
6 | DEPENDENCIES:
7 | - SDWebImage
8 |
9 | SPEC CHECKSUMS:
10 | SDWebImage: 76a6348bdc74eb5a55dd08a091ef298e56b55e41
11 |
12 | PODFILE CHECKSUM: 93722a4eb359352875c836db9f84075d3efb026e
13 |
14 | COCOAPODS: 1.2.0
15 |
--------------------------------------------------------------------------------
/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - SDWebImage (4.0.0):
3 | - SDWebImage/Core (= 4.0.0)
4 | - SDWebImage/Core (4.0.0)
5 |
6 | DEPENDENCIES:
7 | - SDWebImage
8 |
9 | SPEC CHECKSUMS:
10 | SDWebImage: 76a6348bdc74eb5a55dd08a091ef298e56b55e41
11 |
12 | PODFILE CHECKSUM: 93722a4eb359352875c836db9f84075d3efb026e
13 |
14 | COCOAPODS: 1.2.0
15 |
--------------------------------------------------------------------------------
/LB3DBanner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // LB3DBanner
4 | //
5 | // Created by 吴龙波 on 2017/2/15.
6 | // Copyright © 2017年 吴龙波. 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 |
--------------------------------------------------------------------------------
/LB3DBanner/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // LB3DBanner
4 | //
5 | // Created by 吴龙波 on 2017/2/15.
6 | // Copyright © 2017年 吴龙波. 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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/LB3DBanner/LB3DBanner/LB3DBannerImageView.h:
--------------------------------------------------------------------------------
1 | //
2 | // LB3DBannerImageView.h
3 | // LB3DBanner
4 | //
5 | // Created by 吴龙波 on 2017/2/16.
6 | // Copyright © 2017年 吴龙波. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LB3DBannerImageView : UIImageView
12 | ///如果要加载本地图片则直接传图片名
13 | @property(nonatomic,copy)NSString *imageURL;
14 | ///如果要加载本地图片更改此属性
15 | @property(nonatomic,assign)BOOL isOffline;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | target 'LB3DBanner' do
5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
6 | # use_frameworks!
7 |
8 | # Pods for LB3DBanner
9 |
10 | target 'LB3DBannerTests' do
11 | inherit! :search_paths
12 | # Pods for testing
13 | end
14 |
15 | target 'LB3DBannerUITests' do
16 | inherit! :search_paths
17 | # Pods for testing
18 | end
19 |
20 | pod 'SDWebImage'
21 |
22 | end
23 |
--------------------------------------------------------------------------------
/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/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 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data;
15 | - (nullable NSData *)sd_imageData;
16 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) james
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 | @interface UIImage (ForceDecode)
14 |
15 | + (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image;
16 |
17 | + (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerTests/Pods-LB3DBannerTests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "ImageIO"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerTests/Pods-LB3DBannerTests.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "ImageIO"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerUITests/Pods-LB3DBannerUITests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "ImageIO"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBanner/Pods-LB3DBanner.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SDWebImage" -framework "ImageIO"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBanner/Pods-LB3DBanner.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SDWebImage" -framework "ImageIO"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerUITests/Pods-LB3DBannerUITests.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "ImageIO"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}/Pods
9 |
--------------------------------------------------------------------------------
/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 = "${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 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDImageCacheConfig.m
3 | // SDWebImage
4 | //
5 | // Created by Bogdan on 09/09/16.
6 | // Copyright © 2016 Dailymotion. All rights reserved.
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 | _maxCacheAge = kDefaultCacheMaxCacheAge;
21 | _maxCacheSize = 0;
22 | }
23 | return self;
24 | }
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/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 | * Compatibility method - creates an animated UIImage from an NSData, it will only contain the 1st frame image
16 | */
17 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data;
18 |
19 | /**
20 | * Checks if an UIImage instance is a GIF. Will use the `images` array
21 | */
22 | - (BOOL)isGIF;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/LB3DBannerTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/LB3DBannerUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/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 | return NO;
27 | }
28 |
29 | @end
30 |
31 | #endif
32 |
33 |
--------------------------------------------------------------------------------
/LB3DBanner/LB3DBanner/LB3DBannerView.h:
--------------------------------------------------------------------------------
1 | //
2 | // LB3DBannerView.h
3 | // LB3DBanner
4 | //
5 | // Created by 吴龙波 on 2017/2/15.
6 | // Copyright © 2017年 吴龙波. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol LB3DBannerViewDelegate
12 |
13 | -(void)didTapTheMidImageView:(id)object;
14 |
15 | @end
16 |
17 | @interface LB3DBannerView : UIView
18 |
19 | @property(nonatomic,weak)id delegate;
20 |
21 | ///从xid、storyboard创建需要手动给图片
22 | @property(nonatomic,strong)NSArray *imageURLArr;
23 | ///在线或离线图片
24 | @property(nonatomic,assign)BOOL isOffline;
25 | ///代码创建
26 | -(instancetype)initWithFrame:(CGRect)frame andImageURLArray:(NSArray *)imageURLArr;
27 |
28 | /********* 轮播 *********/
29 | @property(nonatomic,assign)BOOL isAutoCarousel;
30 | -(void)starCarousel;
31 | -(void)stopCarousel;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/LB3DBanner.xcodeproj/xcuserdata/Bo.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | LB3DBanner.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 53F0A9A81E543FEE00B33232
16 |
17 | primary
18 |
19 |
20 | 53F0A9C11E543FEE00B33232
21 |
22 | primary
23 |
24 |
25 | 53F0A9CC1E543FEE00B33232
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/LB3DBanner.xcodeproj/xcuserdata/wulongbo.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | LB3DBanner.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 53F0A9A81E543FEE00B33232
16 |
17 | primary
18 |
19 |
20 | 53F0A9C11E543FEE00B33232
21 |
22 | primary
23 |
24 |
25 | 53F0A9CC1E543FEE00B33232
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/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 | };
21 |
22 | @interface NSData (ImageContentType)
23 |
24 | /**
25 | * Return image format
26 | *
27 | * @param data the input image data
28 | *
29 | * @return the image format as `SDImageFormat` (enum)
30 | */
31 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # LB3DBanner
2 | A 3D BannerView support tap and swipe gesture.
3 |
4 | # Usage
5 | Here is how you can use it:
6 |
7 | ///yourImageArray can be array of URLs or imagenames
8 | LB3DBannerView *view = [[LB3DBannerView alloc]initWithFrame:CGRectMake(40, 40, 280,400) andImageURLArray:yourImageArray];
9 | [self.view addSubview:view];
10 | view.delegate = self;
11 | //view.isAutoCarousel = YES;
12 | //view.isOffline = YES;
13 |
14 | # LB3DBannerViewDelegate
15 |
16 | -(void)didTapTheMidImageView:(id)object
17 | {
18 | NSLog(@"点击中间--代理");
19 | }
20 |
21 |
22 | # AutoCarousel
23 |
24 | ///default is NO
25 | @property(nonatomic,assign)BOOL isAutoCarousel;
26 | -(void)starCarousel;
27 | -(void)stopCarousel;
28 |
29 |
30 | # Effect Picture
31 | 
32 |
33 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerTests/Pods-LB3DBannerTests-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 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerUITests/Pods-LB3DBannerUITests-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 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/LB3DBannerTests/LB3DBannerTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // LB3DBannerTests.m
3 | // LB3DBannerTests
4 | //
5 | // Created by 吴龙波 on 2017/2/15.
6 | // Copyright © 2017年 吴龙波. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LB3DBannerTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation LB3DBannerTests
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 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016 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/SDImageCacheConfig.h:
--------------------------------------------------------------------------------
1 | //
2 | // SDImageCacheConfig.h
3 | // SDWebImage
4 | //
5 | // Created by Bogdan on 09/09/16.
6 | // Copyright © 2016 Dailymotion. All rights reserved.
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 maximum length of time to keep an image in the cache, in seconds
32 | */
33 | @property (assign, nonatomic) NSInteger maxCacheAge;
34 |
35 | /**
36 | * The maximum size of the cache, in bytes.
37 | */
38 | @property (assign, nonatomic) NSUInteger maxCacheSize;
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/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 | @interface UIView (WebCacheOperation)
16 |
17 | /**
18 | * Set the image load operation (storage in a UIView based dictionary)
19 | *
20 | * @param operation the operation
21 | * @param key key for storing the operation
22 | */
23 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key;
24 |
25 | /**
26 | * Cancel all operations for the current UIView and key
27 | *
28 | * @param key key for identifying the operations
29 | */
30 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key;
31 |
32 | /**
33 | * Just remove the operations corresponding to the current UIView and key without cancelling them
34 | *
35 | * @param key key for identifying the operations
36 | */
37 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key;
38 |
39 | @end
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/wulongbo.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Pods-LB3DBanner.xcscheme
8 |
9 | isShown
10 |
11 |
12 | Pods-LB3DBannerTests.xcscheme
13 |
14 | isShown
15 |
16 |
17 | Pods-LB3DBannerUITests.xcscheme
18 |
19 | isShown
20 |
21 |
22 | SDWebImage.xcscheme
23 |
24 | isShown
25 |
26 |
27 |
28 | SuppressBuildableAutocreation
29 |
30 | 9D7F25E19F67D27598F62CCA7467840D
31 |
32 | primary
33 |
34 |
35 | B1FF92C7AE8341A7BC085C7E7C243743
36 |
37 | primary
38 |
39 |
40 | E9A619EE05F324AE125887B0ED5834F4
41 |
42 | primary
43 |
44 |
45 | F7D78C942231D687791EDCE97A8C8CBA
46 |
47 | primary
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/LB3DBannerUITests/LB3DBannerUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // LB3DBannerUITests.m
3 | // LB3DBannerUITests
4 | //
5 | // Created by 吴龙波 on 2017/2/15.
6 | // Copyright © 2017年 吴龙波. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LB3DBannerUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation LB3DBannerUITests
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 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/Bo.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Pods-LB3DBanner.xcscheme
8 |
9 | orderHint
10 | 1
11 |
12 | Pods-LB3DBannerTests.xcscheme
13 |
14 | orderHint
15 | 2
16 |
17 | Pods-LB3DBannerUITests.xcscheme
18 |
19 | orderHint
20 | 3
21 |
22 | SDWebImage.xcscheme
23 |
24 | orderHint
25 | 4
26 |
27 |
28 | SuppressBuildableAutocreation
29 |
30 | 9D7F25E19F67D27598F62CCA7467840D
31 |
32 | primary
33 |
34 |
35 | B1FF92C7AE8341A7BC085C7E7C243743
36 |
37 | primary
38 |
39 |
40 | E9A619EE05F324AE125887B0ED5834F4
41 |
42 | primary
43 |
44 |
45 | F7D78C942231D687791EDCE97A8C8CBA
46 |
47 | primary
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBanner/Pods-LB3DBanner-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## SDWebImage
5 |
6 | Copyright (c) 2016 Olivier Poitrey rs@dailymotion.com
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 furnished
13 | to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in all
16 | copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 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 | Generated by CocoaPods - https://cocoapods.org
28 |
--------------------------------------------------------------------------------
/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 |
12 |
13 | @implementation NSData (ImageContentType)
14 |
15 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data {
16 | if (!data) {
17 | return SDImageFormatUndefined;
18 | }
19 |
20 | uint8_t c;
21 | [data getBytes:&c length:1];
22 | switch (c) {
23 | case 0xFF:
24 | return SDImageFormatJPEG;
25 | case 0x89:
26 | return SDImageFormatPNG;
27 | case 0x47:
28 | return SDImageFormatGIF;
29 | case 0x49:
30 | case 0x4D:
31 | return SDImageFormatTIFF;
32 | case 0x52:
33 | // R as RIFF for WEBP
34 | if (data.length < 12) {
35 | return SDImageFormatUndefined;
36 | }
37 |
38 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding];
39 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) {
40 | return SDImageFormatWebP;
41 | }
42 | }
43 | return SDImageFormatUndefined;
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/LB3DBanner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/LB3DBanner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/LB3DBanner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/LB3DBanner/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 | "info" : {
90 | "version" : 1,
91 | "author" : "xcode"
92 | }
93 | }
--------------------------------------------------------------------------------
/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
12 | #import "objc/runtime.h"
13 | #import "NSImage+WebCache.h"
14 |
15 | @implementation UIImage (GIF)
16 |
17 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data {
18 | if (!data) {
19 | return nil;
20 | }
21 |
22 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
23 |
24 | size_t count = CGImageSourceGetCount(source);
25 |
26 | UIImage *staticImage;
27 |
28 | if (count <= 1) {
29 | staticImage = [[UIImage alloc] initWithData:data];
30 | } else {
31 | // we will only retrieve the 1st frame. the full GIF support is available via the FLAnimatedImageView category.
32 | // this here is only code to allow drawing animated images as static ones
33 | #if SD_WATCH
34 | CGFloat scale = 1;
35 | scale = [WKInterfaceDevice currentDevice].screenScale;
36 | #elif SD_UIKIT
37 | CGFloat scale = 1;
38 | scale = [UIScreen mainScreen].scale;
39 | #endif
40 |
41 | CGImageRef CGImage = CGImageSourceCreateImageAtIndex(source, 0, NULL);
42 | #if SD_UIKIT || SD_WATCH
43 | UIImage *frameImage = [UIImage imageWithCGImage:CGImage scale:scale orientation:UIImageOrientationUp];
44 | staticImage = [UIImage animatedImageWithImages:@[frameImage] duration:0.0f];
45 | #elif SD_MAC
46 | staticImage = [[UIImage alloc] initWithCGImage:CGImage size:NSZeroSize];
47 | #endif
48 | CGImageRelease(CGImage);
49 | }
50 |
51 | CFRelease(source);
52 |
53 | return staticImage;
54 | }
55 |
56 | - (BOOL)isGIF {
57 | return (self.images != nil);
58 | }
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/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 |
11 | #if !__has_feature(objc_arc)
12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag
13 | #endif
14 |
15 | inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) {
16 | if (!image) {
17 | return nil;
18 | }
19 |
20 | #if SD_MAC
21 | return image;
22 | #elif SD_UIKIT || SD_WATCH
23 | if ((image.images).count > 0) {
24 | NSMutableArray *scaledImages = [NSMutableArray array];
25 |
26 | for (UIImage *tempImage in image.images) {
27 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)];
28 | }
29 |
30 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration];
31 | }
32 | else {
33 | #if SD_WATCH
34 | if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) {
35 | #elif SD_UIKIT
36 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
37 | #endif
38 | CGFloat scale = 1;
39 | if (key.length >= 8) {
40 | NSRange range = [key rangeOfString:@"@2x."];
41 | if (range.location != NSNotFound) {
42 | scale = 2.0;
43 | }
44 |
45 | range = [key rangeOfString:@"@3x."];
46 | if (range.location != NSNotFound) {
47 | scale = 3.0;
48 | }
49 | }
50 |
51 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation];
52 | image = scaledImage;
53 | }
54 | return image;
55 | }
56 | #endif
57 | }
58 |
59 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain";
60 |
--------------------------------------------------------------------------------
/LB3DBanner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // LB3DBanner
4 | //
5 | // Created by 吴龙波 on 2017/2/15.
6 | // Copyright © 2017年 吴龙波. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 |
24 | - (void)applicationWillResignActive:(UIApplication *)application {
25 | // 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.
26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
27 | }
28 |
29 |
30 | - (void)applicationDidEnterBackground:(UIApplication *)application {
31 | // 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.
32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
33 | }
34 |
35 |
36 | - (void)applicationWillEnterForeground:(UIApplication *)application {
37 | // 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.
38 | }
39 |
40 |
41 | - (void)applicationDidBecomeActive:(UIApplication *)application {
42 | // 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.
43 | }
44 |
45 |
46 | - (void)applicationWillTerminate:(UIApplication *)application {
47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48 | }
49 |
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/LB3DBanner/LB3DBanner/LB3DBannerImageView.m:
--------------------------------------------------------------------------------
1 | //
2 | // LB3DBannerImageView.m
3 | // LB3DBanner
4 | //
5 | // Created by 吴龙波 on 2017/2/16.
6 | // Copyright © 2017年 吴龙波. All rights reserved.
7 | //
8 |
9 | #import "LB3DBannerImageView.h"
10 | #import
11 |
12 | @interface LB3DBannerImageView ()
13 |
14 | @property(nonatomic,strong)CALayer *imageLayer;
15 |
16 | @end
17 |
18 | @implementation LB3DBannerImageView
19 |
20 | /*
21 | // Only override drawRect: if you perform custom drawing.
22 | // An empty implementation adversely affects performance during animation.
23 | - (void)drawRect:(CGRect)rect {
24 | // Drawing code
25 | }
26 | */
27 |
28 | -(instancetype)initWithFrame:(CGRect)frame
29 | {
30 | if (self = [super initWithFrame:frame])
31 | {
32 | self.userInteractionEnabled = YES;
33 | self.layer.shadowColor = [UIColor blackColor].CGColor;
34 | self.layer.shadowOffset = CGSizeMake(0, 0);
35 | self.layer.shadowOpacity = 0.4;
36 | self.layer.shadowRadius = 15;
37 | // self.layer.borderColor = [UIColor colorWithRed:0.85 green:0.85 blue:0.85 alpha:1.00].CGColor;
38 | // self.layer.borderWidth = 0.1f;
39 | self.backgroundColor = [UIColor clearColor];
40 | }
41 | return self;
42 | }
43 |
44 | -(void)layoutSubviews
45 | {
46 | [super layoutSubviews];
47 |
48 | }
49 |
50 | -(void)setImageURL:(NSString *)imageURL
51 | {
52 | _imageURL = imageURL;
53 |
54 | if (self.isOffline)
55 | {
56 | self.image = [UIImage imageNamed:imageURL];
57 | return;
58 | }
59 |
60 | [self sd_setImageWithURL:[NSURL URLWithString:imageURL]];
61 | }
62 |
63 | -(void)setImage:(UIImage *)image
64 | {
65 | if (self.imageLayer)
66 | {
67 | [self.imageLayer removeFromSuperlayer];
68 | self.imageLayer = nil;
69 | }
70 | self.imageLayer = [CALayer layer];
71 | self.imageLayer.frame = self.bounds;
72 | self.imageLayer.cornerRadius = 20.0;
73 | self.imageLayer.contents = (id)image.CGImage;
74 | self.imageLayer.masksToBounds=YES;
75 | [self.layer addSublayer:self.imageLayer];
76 | }
77 |
78 | -(void)setFrame:(CGRect)frame
79 | {
80 | self.imageLayer.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
81 |
82 | [super setFrame:frame];
83 | }
84 | @end
85 |
--------------------------------------------------------------------------------
/LB3DBanner/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // LB3DBanner
4 | //
5 | // Created by 吴龙波 on 2017/2/15.
6 | // Copyright © 2017年 吴龙波. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "LB3DBannerView.h"
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view, typically from a nib.
20 | LB3DBannerView *view = [[LB3DBannerView alloc]initWithFrame:CGRectMake(40, 40, 280,400) andImageURLArray:@[@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1487240041469&di=d44bad880daebe63d05956a98515dc64&imgtype=jpg&src=http%3A%2F%2Fimg2.imgtn.bdimg.com%2Fit%2Fu%3D1199672924%2C1879436334%26fm%3D214%26gp%3D0.jpg",@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1487240066179&di=107bb41b6b64628a1e61dea3d1d2f717&imgtype=jpg&src=http%3A%2F%2Fimg2.imgtn.bdimg.com%2Fit%2Fu%3D705536584%2C2440543459%26fm%3D214%26gp%3D0.jpg",@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1487240041049&di=7bc831ec6a066bdc7c9dfa506c2ddd37&imgtype=0&src=http%3A%2F%2Fm.c.lnkd.licdn.com%2Fmpr%2Fmpr%2Fshrinknp_400_400%2Fp%2F2%2F000%2F006%2F104%2F0cc2646.jpg",@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1487240041049&di=24caeaf54703f2fb7bbdc9981cbafd93&imgtype=0&src=http%3A%2F%2Fimg2-ak.lst.fm%2Fi%2Fu%2Favatar170s%2F5788f607aa164041c086630dd6dcee37.png",@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1487240132608&di=897274e55b05f3579aa2ef382b44599e&imgtype=jpg&src=http%3A%2F%2Fimg3.imgtn.bdimg.com%2Fit%2Fu%3D1680871507%2C1191018650%26fm%3D214%26gp%3D0.jpg",@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1487240041049&di=42be2afc7154ca000a6a6813b1e3a095&imgtype=0&src=http%3A%2F%2Fcdn.aixifan.com%2Fdotnet%2Fartemis%2Fu%2Fcms%2Fwww%2F201506%2F09195920qex0.jpg"]];
21 |
22 | [self.view addSubview:view];
23 | view.delegate = self;
24 | view.isAutoCarousel = YES;
25 | }
26 |
27 | -(void)didTapTheMidImageView:(id)object
28 | {
29 | // NSLog(@"点击中间--代理");
30 | }
31 |
32 | - (void)didReceiveMemoryWarning {
33 | [super didReceiveMemoryWarning];
34 | // Dispose of any resources that can be recreated.
35 | }
36 |
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/wulongbo.xcuserdatad/xcschemes/SDWebImage.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBanner/Pods-LB3DBanner-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) 2016 Olivier Poitrey rs@dailymotion.com
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 furnished
24 | to do so, subject to the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be included in all
27 | 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 |
38 | License
39 | MIT
40 | Title
41 | SDWebImage
42 | Type
43 | PSGroupSpecifier
44 |
45 |
46 | FooterText
47 | Generated by CocoaPods - https://cocoapods.org
48 | Title
49 |
50 | Type
51 | PSGroupSpecifier
52 |
53 |
54 | StringsTable
55 | Acknowledgements
56 | Title
57 | Acknowledgements
58 |
59 |
60 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/wulongbo.xcuserdatad/xcschemes/Pods-LB3DBanner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/wulongbo.xcuserdatad/xcschemes/Pods-LB3DBannerTests.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/wulongbo.xcuserdatad/xcschemes/Pods-LB3DBannerUITests.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/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 | typedef NSMutableDictionary SDOperationsDictionary;
18 |
19 | @implementation UIView (WebCacheOperation)
20 |
21 | - (SDOperationsDictionary *)operationDictionary {
22 | SDOperationsDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey);
23 | if (operations) {
24 | return operations;
25 | }
26 | operations = [NSMutableDictionary dictionary];
27 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
28 | return operations;
29 | }
30 |
31 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key {
32 | if (key) {
33 | [self sd_cancelImageLoadOperationWithKey:key];
34 | if (operation) {
35 | SDOperationsDictionary *operationDictionary = [self operationDictionary];
36 | operationDictionary[key] = operation;
37 | }
38 | }
39 | }
40 |
41 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key {
42 | // Cancel in progress downloader from queue
43 | SDOperationsDictionary *operationDictionary = [self operationDictionary];
44 | id operations = operationDictionary[key];
45 | if (operations) {
46 | if ([operations isKindOfClass:[NSArray class]]) {
47 | for (id operation in operations) {
48 | if (operation) {
49 | [operation cancel];
50 | }
51 | }
52 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){
53 | [(id) operations cancel];
54 | }
55 | [operationDictionary removeObjectForKey:key];
56 | }
57 | }
58 |
59 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key {
60 | if (key) {
61 | SDOperationsDictionary *operationDictionary = [self operationDictionary];
62 | [operationDictionary removeObjectForKey:key];
63 | }
64 | }
65 |
66 | @end
67 |
68 | #endif
69 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/Bo.xcuserdatad/xcschemes/SDWebImage.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIView+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_UIKIT || SD_MAC
12 |
13 | #import "SDWebImageManager.h"
14 |
15 | typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable imageData);
16 |
17 | @interface UIView (WebCache)
18 |
19 | /**
20 | * Get the current image URL.
21 | *
22 | * Note that because of the limitations of categories this property can get out of sync
23 | * if you use setImage: directly.
24 | */
25 | - (nullable NSURL *)sd_imageURL;
26 |
27 | /**
28 | * Set the imageView `image` with an `url` and optionally a placeholder image.
29 | *
30 | * The download is asynchronous and cached.
31 | *
32 | * @param url The url for the image.
33 | * @param placeholder The image to be set initially, until the image request finishes.
34 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
35 | * @param operationKey A string to be used as the operation key. If nil, will use the class name
36 | * @param setImageBlock Block used for custom set image code
37 | * @param progressBlock A block called while image is downloading
38 | * @note the progress block is executed on a background queue
39 | * @param completedBlock A block called when operation has been completed. This block has no return value
40 | * and takes the requested UIImage as first parameter. In case of error the image parameter
41 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
42 | * indicating if the image was retrieved from the local cache or from the network.
43 | * The fourth parameter is the original image url.
44 | */
45 | - (void)sd_internalSetImageWithURL:(nullable NSURL *)url
46 | placeholderImage:(nullable UIImage *)placeholder
47 | options:(SDWebImageOptions)options
48 | operationKey:(nullable NSString *)operationKey
49 | setImageBlock:(nullable SDSetImageBlock)setImageBlock
50 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
51 | completed:(nullable SDExternalCompletionBlock)completedBlock;
52 |
53 | /**
54 | * Cancel the current download
55 | */
56 | - (void)sd_cancelCurrentImageLoad;
57 |
58 | #if SD_UIKIT
59 |
60 | #pragma mark - Activity indicator
61 |
62 | /**
63 | * Show activity UIActivityIndicatorView
64 | */
65 | - (void)sd_setShowActivityIndicatorView:(BOOL)show;
66 |
67 | /**
68 | * set desired UIActivityIndicatorViewStyle
69 | *
70 | * @param style The style of the UIActivityIndicatorView
71 | */
72 | - (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style;
73 |
74 | - (BOOL)sd_showActivityIndicatorView;
75 | - (void)sd_addActivityIndicator;
76 | - (void)sd_removeActivityIndicator;
77 |
78 | #endif
79 |
80 | @end
81 |
82 | #endif
83 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/Bo.xcuserdatad/xcschemes/Pods-LB3DBanner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/Bo.xcuserdatad/xcschemes/Pods-LB3DBannerTests.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/Bo.xcuserdatad/xcschemes/Pods-LB3DBannerUITests.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/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 relly 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 | #if OS_OBJECT_USE_OBJC
85 | #undef SDDispatchQueueRelease
86 | #undef SDDispatchQueueSetterSementics
87 | #define SDDispatchQueueRelease(q)
88 | #define SDDispatchQueueSetterSementics strong
89 | #else
90 | #undef SDDispatchQueueRelease
91 | #undef SDDispatchQueueSetterSementics
92 | #define SDDispatchQueueRelease(q) (dispatch_release(q))
93 | #define SDDispatchQueueSetterSementics assign
94 | #endif
95 |
96 | extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image);
97 |
98 | typedef void(^SDWebImageNoParamsBlock)();
99 |
100 | extern NSString *const SDWebImageErrorDomain;
101 |
102 | #ifndef dispatch_main_async_safe
103 | #define dispatch_main_async_safe(block)\
104 | if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(dispatch_get_main_queue())) == 0) {\
105 | block();\
106 | } else {\
107 | dispatch_async(dispatch_get_main_queue(), block);\
108 | }
109 | #endif
110 |
111 | static int64_t kAsyncTestTimeout = 5;
112 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io/api/objective-c,swift
2 |
3 | ### Objective-C ###
4 | # Xcode
5 | #
6 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
7 |
8 | ## Build generated
9 | build/
10 | DerivedData/
11 |
12 | ## Various settings
13 | *.pbxuser
14 | !default.pbxuser
15 | *.mode1v3
16 | !default.mode1v3
17 | *.mode2v3
18 | !default.mode2v3
19 | *.perspectivev3
20 | !default.perspectivev3
21 | xcuserdata/
22 |
23 | ## Other
24 | *.moved-aside
25 | *.xcuserstate
26 |
27 | ## Obj-C/Swift specific
28 | *.hmap
29 | *.ipa
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://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
52 |
53 | fastlane/report.xml
54 | fastlane/screenshots
55 |
56 | ### Objective-C Patch ###
57 | *.xcscmblueprint
58 |
59 | ### Swift ###
60 | # Xcode
61 | #
62 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
63 |
64 | ## Build generated
65 | build/
66 | DerivedData/
67 |
68 | ## Various settings
69 | *.pbxuser
70 | !default.pbxuser
71 | *.mode1v3
72 | !default.mode1v3
73 | *.mode2v3
74 | !default.mode2v3
75 | *.perspectivev3
76 | !default.perspectivev3
77 | xcuserdata/
78 |
79 | ## Other
80 | *.moved-aside
81 | *.xcuserstate
82 |
83 | ## Obj-C/Swift specific
84 | *.hmap
85 | *.ipa
86 |
87 | ## Playgrounds
88 | timeline.xctimeline
89 | playground.xcworkspace
90 |
91 | # Swift Package Manager
92 | #
93 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
94 | # Packages/
95 | .build/
96 |
97 | # CocoaPods
98 | #
99 | # We recommend against adding the Pods directory to your .gitignore. However
100 | # you should judge for yourself, the pros and cons are mentioned at:
101 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
102 | #
103 | # Pods/
104 |
105 | # Carthage
106 | #
107 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
108 | # Carthage/Checkouts
109 |
110 | Carthage/Build
111 |
112 | # fastlane
113 | #
114 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
115 | # screenshots whenever they are needed.
116 | # For more information about the recommended setup visit:
117 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
118 |
119 | fastlane/report.xml
120 | fastlane/Preview.html
121 | fastlane/screenshots
122 | fastlane/test_output
123 |
124 | 作者:马克叔_Marco
125 | 链接:https://www.jianshu.com/p/35780446b133
126 | 來源:简书
127 | 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
128 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBanner/Pods-LB3DBanner-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
63 |
64 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
65 | code_sign_cmd="$code_sign_cmd &"
66 | fi
67 | echo "$code_sign_cmd"
68 | eval "$code_sign_cmd"
69 | fi
70 | }
71 |
72 | # Strip invalid architectures
73 | strip_invalid_archs() {
74 | binary="$1"
75 | # Get architectures for current file
76 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
77 | stripped=""
78 | for arch in $archs; do
79 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
80 | # Strip non-valid architectures in-place
81 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
82 | stripped="$stripped $arch"
83 | fi
84 | done
85 | if [[ "$stripped" ]]; then
86 | echo "Stripped $binary of architectures:$stripped"
87 | fi
88 | }
89 |
90 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
91 | wait
92 | fi
93 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerTests/Pods-LB3DBannerTests-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
63 |
64 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
65 | code_sign_cmd="$code_sign_cmd &"
66 | fi
67 | echo "$code_sign_cmd"
68 | eval "$code_sign_cmd"
69 | fi
70 | }
71 |
72 | # Strip invalid architectures
73 | strip_invalid_archs() {
74 | binary="$1"
75 | # Get architectures for current file
76 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
77 | stripped=""
78 | for arch in $archs; do
79 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
80 | # Strip non-valid architectures in-place
81 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
82 | stripped="$stripped $arch"
83 | fi
84 | done
85 | if [[ "$stripped" ]]; then
86 | echo "Stripped $binary of architectures:$stripped"
87 | fi
88 | }
89 |
90 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
91 | wait
92 | fi
93 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerUITests/Pods-LB3DBannerUITests-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
6 |
7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
8 |
9 | install_framework()
10 | {
11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
12 | local source="${BUILT_PRODUCTS_DIR}/$1"
13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
15 | elif [ -r "$1" ]; then
16 | local source="$1"
17 | fi
18 |
19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
20 |
21 | if [ -L "${source}" ]; then
22 | echo "Symlinked..."
23 | source="$(readlink "${source}")"
24 | fi
25 |
26 | # use filter instead of exclude so missing patterns dont' throw errors
27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
29 |
30 | local basename
31 | basename="$(basename -s .framework "$1")"
32 | binary="${destination}/${basename}.framework/${basename}"
33 | if ! [ -r "$binary" ]; then
34 | binary="${destination}/${basename}"
35 | fi
36 |
37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
39 | strip_invalid_archs "$binary"
40 | fi
41 |
42 | # Resign the code if required by the build settings to avoid unstable apps
43 | code_sign_if_enabled "${destination}/$(basename "$1")"
44 |
45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
47 | local swift_runtime_libs
48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
49 | for lib in $swift_runtime_libs; do
50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
52 | code_sign_if_enabled "${destination}/${lib}"
53 | done
54 | fi
55 | }
56 |
57 | # Signs a framework with the provided identity
58 | code_sign_if_enabled() {
59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
60 | # Use the current code_sign_identitiy
61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
62 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
63 |
64 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
65 | code_sign_cmd="$code_sign_cmd &"
66 | fi
67 | echo "$code_sign_cmd"
68 | eval "$code_sign_cmd"
69 | fi
70 | }
71 |
72 | # Strip invalid architectures
73 | strip_invalid_archs() {
74 | binary="$1"
75 | # Get architectures for current file
76 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
77 | stripped=""
78 | for arch in $archs; do
79 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
80 | # Strip non-valid architectures in-place
81 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1
82 | stripped="$stripped $arch"
83 | fi
84 | done
85 | if [[ "$stripped" ]]; then
86 | echo "Stripped $binary of architectures:$stripped"
87 | fi
88 | }
89 |
90 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
91 | wait
92 | fi
93 |
--------------------------------------------------------------------------------
/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;
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;
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;
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/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 (nonatomic, assign, 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 |
--------------------------------------------------------------------------------
/LB3DBanner.xcodeproj/xcuserdata/Bo.xcuserdatad/xcschemes/LB3DBanner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/LB3DBanner.xcodeproj/xcuserdata/wulongbo.xcuserdatad/xcschemes/LB3DBanner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/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 | extern NSString * _Nonnull const SDWebImageDownloadStartNotification;
14 | extern NSString * _Nonnull const SDWebImageDownloadReceiveResponseNotification;
15 | extern NSString * _Nonnull const SDWebImageDownloadStopNotification;
16 | extern 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 | */
23 | @protocol SDWebImageDownloaderOperationInterface
24 |
25 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request
26 | inSession:(nullable NSURLSession *)session
27 | options:(SDWebImageDownloaderOptions)options;
28 |
29 | - (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
30 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock;
31 |
32 | - (BOOL)shouldDecompressImages;
33 | - (void)setShouldDecompressImages:(BOOL)value;
34 |
35 | - (nullable NSURLCredential *)credential;
36 | - (void)setCredential:(nullable NSURLCredential *)value;
37 |
38 | @end
39 |
40 |
41 | @interface SDWebImageDownloaderOperation : NSOperation
42 |
43 | /**
44 | * The request used by the operation's task.
45 | */
46 | @property (strong, nonatomic, readonly, nullable) NSURLRequest *request;
47 |
48 | /**
49 | * The operation's task
50 | */
51 | @property (strong, nonatomic, readonly, nullable) NSURLSessionTask *dataTask;
52 |
53 |
54 | @property (assign, nonatomic) BOOL shouldDecompressImages;
55 |
56 | /**
57 | * Was used to determine whether the URL connection should consult the credential storage for authenticating the connection.
58 | * @deprecated Not used for a couple of versions
59 | */
60 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage __deprecated_msg("Property deprecated. Does nothing. Kept only for backwards compatibility");
61 |
62 | /**
63 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`.
64 | *
65 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present.
66 | */
67 | @property (nonatomic, strong, nullable) NSURLCredential *credential;
68 |
69 | /**
70 | * The SDWebImageDownloaderOptions for the receiver.
71 | */
72 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options;
73 |
74 | /**
75 | * The expected size of data.
76 | */
77 | @property (assign, nonatomic) NSInteger expectedSize;
78 |
79 | /**
80 | * The response returned by the operation's connection.
81 | */
82 | @property (strong, nonatomic, nullable) NSURLResponse *response;
83 |
84 | /**
85 | * Initializes a `SDWebImageDownloaderOperation` object
86 | *
87 | * @see SDWebImageDownloaderOperation
88 | *
89 | * @param request the URL request
90 | * @param session the URL session in which this operation will run
91 | * @param options downloader options
92 | *
93 | * @return the initialized instance
94 | */
95 | - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request
96 | inSession:(nullable NSURLSession *)session
97 | options:(SDWebImageDownloaderOptions)options NS_DESIGNATED_INITIALIZER;
98 |
99 | /**
100 | * Adds handlers for progress and completion. Returns a tokent that can be passed to -cancel: to cancel this set of
101 | * callbacks.
102 | *
103 | * @param progressBlock the block executed when a new chunk of data arrives.
104 | * @note the progress block is executed on a background queue
105 | * @param completedBlock the block executed when the download is done.
106 | * @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
107 | *
108 | * @return the token to use to cancel this set of handlers
109 | */
110 | - (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
111 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock;
112 |
113 | /**
114 | * Cancels a set of callbacks. Once all callbacks are canceled, the operation is cancelled.
115 | *
116 | * @param token the token representing a set of callbacks to cancel
117 | *
118 | * @return YES if the operation was stopped because this was the last token to be canceled. NO otherwise.
119 | */
120 | - (BOOL)cancel:(nullable id)token;
121 |
122 | @end
123 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImageView+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 "UIImageView+WebCache.h"
10 |
11 | #if SD_UIKIT || SD_MAC
12 |
13 | #import "objc/runtime.h"
14 | #import "UIView+WebCacheOperation.h"
15 | #import "UIView+WebCache.h"
16 |
17 | @implementation UIImageView (WebCache)
18 |
19 | - (void)sd_setImageWithURL:(nullable NSURL *)url {
20 | [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:nil];
21 | }
22 |
23 | - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder {
24 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:nil];
25 | }
26 |
27 | - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options {
28 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:nil];
29 | }
30 |
31 | - (void)sd_setImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock {
32 | [self sd_setImageWithURL:url placeholderImage:nil options:0 progress:nil completed:completedBlock];
33 | }
34 |
35 | - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock {
36 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 progress:nil completed:completedBlock];
37 | }
38 |
39 | - (void)sd_setImageWithURL:(nullable NSURL *)url placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock {
40 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options progress:nil completed:completedBlock];
41 | }
42 |
43 | - (void)sd_setImageWithURL:(nullable NSURL *)url
44 | placeholderImage:(nullable UIImage *)placeholder
45 | options:(SDWebImageOptions)options
46 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
47 | completed:(nullable SDExternalCompletionBlock)completedBlock {
48 | [self sd_internalSetImageWithURL:url
49 | placeholderImage:placeholder
50 | options:options
51 | operationKey:nil
52 | setImageBlock:nil
53 | progress:progressBlock
54 | completed:completedBlock];
55 | }
56 |
57 | - (void)sd_setImageWithPreviousCachedImageWithURL:(nullable NSURL *)url
58 | placeholderImage:(nullable UIImage *)placeholder
59 | options:(SDWebImageOptions)options
60 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
61 | completed:(nullable SDExternalCompletionBlock)completedBlock {
62 | NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url];
63 | UIImage *lastPreviousCachedImage = [[SDImageCache sharedImageCache] imageFromCacheForKey:key];
64 |
65 | [self sd_setImageWithURL:url placeholderImage:lastPreviousCachedImage ?: placeholder options:options progress:progressBlock completed:completedBlock];
66 | }
67 |
68 | #if SD_UIKIT
69 |
70 | #pragma mark - Animation of multiple images
71 |
72 | - (void)sd_setAnimationImagesWithURLs:(nonnull NSArray *)arrayOfURLs {
73 | [self sd_cancelCurrentAnimationImagesLoad];
74 | __weak __typeof(self)wself = self;
75 |
76 | NSMutableArray> *operationsArray = [[NSMutableArray alloc] init];
77 |
78 | for (NSURL *logoImageURL in arrayOfURLs) {
79 | id operation = [SDWebImageManager.sharedManager loadImageWithURL:logoImageURL options:0 progress:nil completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
80 | if (!wself) return;
81 | dispatch_main_async_safe(^{
82 | __strong UIImageView *sself = wself;
83 | [sself stopAnimating];
84 | if (sself && image) {
85 | NSMutableArray *currentImages = [[sself animationImages] mutableCopy];
86 | if (!currentImages) {
87 | currentImages = [[NSMutableArray alloc] init];
88 | }
89 | [currentImages addObject:image];
90 |
91 | sself.animationImages = currentImages;
92 | [sself setNeedsLayout];
93 | }
94 | [sself startAnimating];
95 | });
96 | }];
97 | [operationsArray addObject:operation];
98 | }
99 |
100 | [self sd_setImageLoadOperation:[operationsArray copy] forKey:@"UIImageViewAnimationImages"];
101 | }
102 |
103 | - (void)sd_cancelCurrentAnimationImagesLoad {
104 | [self sd_cancelImageLoadOperationWithKey:@"UIImageViewAnimationImages"];
105 | }
106 | #endif
107 |
108 | @end
109 |
110 | #endif
111 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBanner/Pods-LB3DBanner-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | 3)
22 | TARGET_DEVICE_ARGS="--target-device tv"
23 | ;;
24 | *)
25 | TARGET_DEVICE_ARGS="--target-device mac"
26 | ;;
27 | esac
28 |
29 | install_resource()
30 | {
31 | if [[ "$1" = /* ]] ; then
32 | RESOURCE_PATH="$1"
33 | else
34 | RESOURCE_PATH="${PODS_ROOT}/$1"
35 | fi
36 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
37 | cat << EOM
38 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
39 | EOM
40 | exit 1
41 | fi
42 | case $RESOURCE_PATH in
43 | *.storyboard)
44 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
45 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
46 | ;;
47 | *.xib)
48 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
49 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
50 | ;;
51 | *.framework)
52 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
53 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
54 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
55 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
56 | ;;
57 | *.xcdatamodel)
58 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
59 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
60 | ;;
61 | *.xcdatamodeld)
62 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
63 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
64 | ;;
65 | *.xcmappingmodel)
66 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
67 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
68 | ;;
69 | *.xcassets)
70 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
71 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
72 | ;;
73 | *)
74 | echo "$RESOURCE_PATH"
75 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
76 | ;;
77 | esac
78 | }
79 |
80 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
82 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
83 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
85 | fi
86 | rm -f "$RESOURCES_TO_COPY"
87 |
88 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
89 | then
90 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
91 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
92 | while read line; do
93 | if [[ $line != "${PODS_ROOT}*" ]]; then
94 | XCASSET_FILES+=("$line")
95 | fi
96 | done <<<"$OTHER_XCASSETS"
97 |
98 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | fi
100 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerTests/Pods-LB3DBannerTests-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | 3)
22 | TARGET_DEVICE_ARGS="--target-device tv"
23 | ;;
24 | *)
25 | TARGET_DEVICE_ARGS="--target-device mac"
26 | ;;
27 | esac
28 |
29 | install_resource()
30 | {
31 | if [[ "$1" = /* ]] ; then
32 | RESOURCE_PATH="$1"
33 | else
34 | RESOURCE_PATH="${PODS_ROOT}/$1"
35 | fi
36 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
37 | cat << EOM
38 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
39 | EOM
40 | exit 1
41 | fi
42 | case $RESOURCE_PATH in
43 | *.storyboard)
44 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
45 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
46 | ;;
47 | *.xib)
48 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
49 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
50 | ;;
51 | *.framework)
52 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
53 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
54 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
55 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
56 | ;;
57 | *.xcdatamodel)
58 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
59 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
60 | ;;
61 | *.xcdatamodeld)
62 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
63 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
64 | ;;
65 | *.xcmappingmodel)
66 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
67 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
68 | ;;
69 | *.xcassets)
70 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
71 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
72 | ;;
73 | *)
74 | echo "$RESOURCE_PATH"
75 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
76 | ;;
77 | esac
78 | }
79 |
80 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
82 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
83 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
85 | fi
86 | rm -f "$RESOURCES_TO_COPY"
87 |
88 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
89 | then
90 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
91 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
92 | while read line; do
93 | if [[ $line != "${PODS_ROOT}*" ]]; then
94 | XCASSET_FILES+=("$line")
95 | fi
96 | done <<<"$OTHER_XCASSETS"
97 |
98 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | fi
100 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-LB3DBannerUITests/Pods-LB3DBannerUITests-resources.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
5 |
6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
7 | > "$RESOURCES_TO_COPY"
8 |
9 | XCASSET_FILES=()
10 |
11 | case "${TARGETED_DEVICE_FAMILY}" in
12 | 1,2)
13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
14 | ;;
15 | 1)
16 | TARGET_DEVICE_ARGS="--target-device iphone"
17 | ;;
18 | 2)
19 | TARGET_DEVICE_ARGS="--target-device ipad"
20 | ;;
21 | 3)
22 | TARGET_DEVICE_ARGS="--target-device tv"
23 | ;;
24 | *)
25 | TARGET_DEVICE_ARGS="--target-device mac"
26 | ;;
27 | esac
28 |
29 | install_resource()
30 | {
31 | if [[ "$1" = /* ]] ; then
32 | RESOURCE_PATH="$1"
33 | else
34 | RESOURCE_PATH="${PODS_ROOT}/$1"
35 | fi
36 | if [[ ! -e "$RESOURCE_PATH" ]] ; then
37 | cat << EOM
38 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
39 | EOM
40 | exit 1
41 | fi
42 | case $RESOURCE_PATH in
43 | *.storyboard)
44 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
45 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
46 | ;;
47 | *.xib)
48 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
49 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
50 | ;;
51 | *.framework)
52 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
53 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
54 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
55 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
56 | ;;
57 | *.xcdatamodel)
58 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
59 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
60 | ;;
61 | *.xcdatamodeld)
62 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
63 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
64 | ;;
65 | *.xcmappingmodel)
66 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
67 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
68 | ;;
69 | *.xcassets)
70 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
71 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
72 | ;;
73 | *)
74 | echo "$RESOURCE_PATH"
75 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
76 | ;;
77 | esac
78 | }
79 |
80 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
82 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
83 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
85 | fi
86 | rm -f "$RESOURCES_TO_COPY"
87 |
88 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
89 | then
90 | # Find all other xcassets (this unfortunately includes those of path pods and other targets).
91 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
92 | while read line; do
93 | if [[ $line != "${PODS_ROOT}*" ]]; then
94 | XCASSET_FILES+=("$line")
95 | fi
96 | done <<<"$OTHER_XCASSETS"
97 |
98 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
99 | fi
100 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.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 "SDWebImagePrefetcher.h"
10 |
11 | @interface SDWebImagePrefetcher ()
12 |
13 | @property (strong, nonatomic, nonnull) SDWebImageManager *manager;
14 | @property (strong, nonatomic, nullable) NSArray *prefetchURLs;
15 | @property (assign, nonatomic) NSUInteger requestedCount;
16 | @property (assign, nonatomic) NSUInteger skippedCount;
17 | @property (assign, nonatomic) NSUInteger finishedCount;
18 | @property (assign, nonatomic) NSTimeInterval startedTime;
19 | @property (copy, nonatomic, nullable) SDWebImagePrefetcherCompletionBlock completionBlock;
20 | @property (copy, nonatomic, nullable) SDWebImagePrefetcherProgressBlock progressBlock;
21 |
22 | @end
23 |
24 | @implementation SDWebImagePrefetcher
25 |
26 | + (nonnull instancetype)sharedImagePrefetcher {
27 | static dispatch_once_t once;
28 | static id instance;
29 | dispatch_once(&once, ^{
30 | instance = [self new];
31 | });
32 | return instance;
33 | }
34 |
35 | - (nonnull instancetype)init {
36 | return [self initWithImageManager:[SDWebImageManager new]];
37 | }
38 |
39 | - (nonnull instancetype)initWithImageManager:(SDWebImageManager *)manager {
40 | if ((self = [super init])) {
41 | _manager = manager;
42 | _options = SDWebImageLowPriority;
43 | _prefetcherQueue = dispatch_get_main_queue();
44 | self.maxConcurrentDownloads = 3;
45 | }
46 | return self;
47 | }
48 |
49 | - (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads {
50 | self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads;
51 | }
52 |
53 | - (NSUInteger)maxConcurrentDownloads {
54 | return self.manager.imageDownloader.maxConcurrentDownloads;
55 | }
56 |
57 | - (void)startPrefetchingAtIndex:(NSUInteger)index {
58 | if (index >= self.prefetchURLs.count) return;
59 | self.requestedCount++;
60 | [self.manager loadImageWithURL:self.prefetchURLs[index] options:self.options progress:nil completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
61 | if (!finished) return;
62 | self.finishedCount++;
63 |
64 | if (image) {
65 | if (self.progressBlock) {
66 | self.progressBlock(self.finishedCount,(self.prefetchURLs).count);
67 | }
68 | }
69 | else {
70 | if (self.progressBlock) {
71 | self.progressBlock(self.finishedCount,(self.prefetchURLs).count);
72 | }
73 | // Add last failed
74 | self.skippedCount++;
75 | }
76 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) {
77 | [self.delegate imagePrefetcher:self
78 | didPrefetchURL:self.prefetchURLs[index]
79 | finishedCount:self.finishedCount
80 | totalCount:self.prefetchURLs.count
81 | ];
82 | }
83 | if (self.prefetchURLs.count > self.requestedCount) {
84 | dispatch_async(self.prefetcherQueue, ^{
85 | [self startPrefetchingAtIndex:self.requestedCount];
86 | });
87 | } else if (self.finishedCount == self.requestedCount) {
88 | [self reportStatus];
89 | if (self.completionBlock) {
90 | self.completionBlock(self.finishedCount, self.skippedCount);
91 | self.completionBlock = nil;
92 | }
93 | self.progressBlock = nil;
94 | }
95 | }];
96 | }
97 |
98 | - (void)reportStatus {
99 | NSUInteger total = (self.prefetchURLs).count;
100 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) {
101 | [self.delegate imagePrefetcher:self
102 | didFinishWithTotalCount:(total - self.skippedCount)
103 | skippedCount:self.skippedCount
104 | ];
105 | }
106 | }
107 |
108 | - (void)prefetchURLs:(nullable NSArray *)urls {
109 | [self prefetchURLs:urls progress:nil completed:nil];
110 | }
111 |
112 | - (void)prefetchURLs:(nullable NSArray *)urls
113 | progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock
114 | completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock {
115 | [self cancelPrefetching]; // Prevent duplicate prefetch request
116 | self.startedTime = CFAbsoluteTimeGetCurrent();
117 | self.prefetchURLs = urls;
118 | self.completionBlock = completionBlock;
119 | self.progressBlock = progressBlock;
120 |
121 | if (urls.count == 0) {
122 | if (completionBlock) {
123 | completionBlock(0,0);
124 | }
125 | } else {
126 | // Starts prefetching from the very first image on the list with the max allowed concurrency
127 | NSUInteger listCount = self.prefetchURLs.count;
128 | for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) {
129 | [self startPrefetchingAtIndex:i];
130 | }
131 | }
132 | }
133 |
134 | - (void)cancelPrefetching {
135 | self.prefetchURLs = nil;
136 | self.skippedCount = 0;
137 | self.requestedCount = 0;
138 | self.finishedCount = 0;
139 | [self.manager cancelAll];
140 | }
141 |
142 | @end
143 |
--------------------------------------------------------------------------------
/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 | #import "UIImage+GIF.h"
11 | #import "NSData+ImageContentType.h"
12 | #import
13 |
14 | #ifdef SD_WEBP
15 | #import "UIImage+WebP.h"
16 | #endif
17 |
18 | @implementation UIImage (MultiFormat)
19 |
20 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data {
21 | if (!data) {
22 | return nil;
23 | }
24 |
25 | UIImage *image;
26 | SDImageFormat imageFormat = [NSData sd_imageFormatForImageData:data];
27 | if (imageFormat == SDImageFormatGIF) {
28 | image = [UIImage sd_animatedGIFWithData:data];
29 | }
30 | #ifdef SD_WEBP
31 | else if (imageFormat == SDImageFormatWebP)
32 | {
33 | image = [UIImage sd_imageWithWebPData:data];
34 | }
35 | #endif
36 | else {
37 | image = [[UIImage alloc] initWithData:data];
38 | #if SD_UIKIT || SD_WATCH
39 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data];
40 | if (orientation != UIImageOrientationUp) {
41 | image = [UIImage imageWithCGImage:image.CGImage
42 | scale:image.scale
43 | orientation:orientation];
44 | }
45 | #endif
46 | }
47 |
48 |
49 | return image;
50 | }
51 |
52 | #if SD_UIKIT || SD_WATCH
53 | +(UIImageOrientation)sd_imageOrientationFromImageData:(nonnull NSData *)imageData {
54 | UIImageOrientation result = UIImageOrientationUp;
55 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL);
56 | if (imageSource) {
57 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL);
58 | if (properties) {
59 | CFTypeRef val;
60 | int exifOrientation;
61 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation);
62 | if (val) {
63 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation);
64 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation];
65 | } // else - if it's not set it remains at up
66 | CFRelease((CFTypeRef) properties);
67 | } else {
68 | //NSLog(@"NO PROPERTIES, FAIL");
69 | }
70 | CFRelease(imageSource);
71 | }
72 | return result;
73 | }
74 |
75 | #pragma mark EXIF orientation tag converter
76 | // Convert an EXIF image orientation to an iOS one.
77 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html
78 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation {
79 | UIImageOrientation orientation = UIImageOrientationUp;
80 | switch (exifOrientation) {
81 | case 1:
82 | orientation = UIImageOrientationUp;
83 | break;
84 |
85 | case 3:
86 | orientation = UIImageOrientationDown;
87 | break;
88 |
89 | case 8:
90 | orientation = UIImageOrientationLeft;
91 | break;
92 |
93 | case 6:
94 | orientation = UIImageOrientationRight;
95 | break;
96 |
97 | case 2:
98 | orientation = UIImageOrientationUpMirrored;
99 | break;
100 |
101 | case 4:
102 | orientation = UIImageOrientationDownMirrored;
103 | break;
104 |
105 | case 5:
106 | orientation = UIImageOrientationLeftMirrored;
107 | break;
108 |
109 | case 7:
110 | orientation = UIImageOrientationRightMirrored;
111 | break;
112 | default:
113 | break;
114 | }
115 | return orientation;
116 | }
117 | #endif
118 |
119 | - (nullable NSData *)sd_imageData {
120 | return [self sd_imageDataAsFormat:SDImageFormatUndefined];
121 | }
122 |
123 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat {
124 | NSData *imageData = nil;
125 | if (self) {
126 | #if SD_UIKIT || SD_WATCH
127 | int alphaInfo = CGImageGetAlphaInfo(self.CGImage);
128 | BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone ||
129 | alphaInfo == kCGImageAlphaNoneSkipFirst ||
130 | alphaInfo == kCGImageAlphaNoneSkipLast);
131 |
132 | BOOL usePNG = hasAlpha;
133 |
134 | // the imageFormat param has priority here. But if the format is undefined, we relly on the alpha channel
135 | if (imageFormat != SDImageFormatUndefined) {
136 | usePNG = (imageFormat == SDImageFormatPNG);
137 | }
138 |
139 | if (usePNG) {
140 | imageData = UIImagePNGRepresentation(self);
141 | } else {
142 | imageData = UIImageJPEGRepresentation(self, (CGFloat)1.0);
143 | }
144 | #else
145 | NSBitmapImageFileType imageFileType = NSJPEGFileType;
146 | if (imageFormat == SDImageFormatGIF) {
147 | imageFileType = NSGIFFileType;
148 | } else if (imageFormat == SDImageFormatPNG) {
149 | imageFileType = NSPNGFileType;
150 | }
151 |
152 | imageData = [NSBitmapImageRep representationOfImageRepsInArray:self.representations
153 | usingType:imageFileType
154 | properties:@{}];
155 | #endif
156 | }
157 | return imageData;
158 | }
159 |
160 |
161 | @end
162 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIButton+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 "UIButton+WebCache.h"
10 |
11 | #if SD_UIKIT
12 |
13 | #import "objc/runtime.h"
14 | #import "UIView+WebCacheOperation.h"
15 | #import "UIView+WebCache.h"
16 |
17 | static char imageURLStorageKey;
18 |
19 | typedef NSMutableDictionary SDStateImageURLDictionary;
20 |
21 | @implementation UIButton (WebCache)
22 |
23 | - (nullable NSURL *)sd_currentImageURL {
24 | NSURL *url = self.imageURLStorage[@(self.state)];
25 |
26 | if (!url) {
27 | url = self.imageURLStorage[@(UIControlStateNormal)];
28 | }
29 |
30 | return url;
31 | }
32 |
33 | - (nullable NSURL *)sd_imageURLForState:(UIControlState)state {
34 | return self.imageURLStorage[@(state)];
35 | }
36 |
37 | #pragma mark - Image
38 |
39 | - (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state {
40 | [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil];
41 | }
42 |
43 | - (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder {
44 | [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil];
45 | }
46 |
47 | - (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options {
48 | [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil];
49 | }
50 |
51 | - (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state completed:(nullable SDExternalCompletionBlock)completedBlock {
52 | [self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock];
53 | }
54 |
55 | - (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock {
56 | [self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock];
57 | }
58 |
59 | - (void)sd_setImageWithURL:(nullable NSURL *)url
60 | forState:(UIControlState)state
61 | placeholderImage:(nullable UIImage *)placeholder
62 | options:(SDWebImageOptions)options
63 | completed:(nullable SDExternalCompletionBlock)completedBlock {
64 | if (!url) {
65 | [self.imageURLStorage removeObjectForKey:@(state)];
66 | return;
67 | }
68 |
69 | self.imageURLStorage[@(state)] = url;
70 |
71 | __weak typeof(self)weakSelf = self;
72 | [self sd_internalSetImageWithURL:url
73 | placeholderImage:placeholder
74 | options:options
75 | operationKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]
76 | setImageBlock:^(UIImage *image, NSData *imageData) {
77 | [weakSelf setImage:image forState:state];
78 | }
79 | progress:nil
80 | completed:completedBlock];
81 | }
82 |
83 | #pragma mark - Background image
84 |
85 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state {
86 | [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil];
87 | }
88 |
89 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder {
90 | [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil];
91 | }
92 |
93 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options {
94 | [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options completed:nil];
95 | }
96 |
97 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state completed:(nullable SDExternalCompletionBlock)completedBlock {
98 | [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock];
99 | }
100 |
101 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock {
102 | [self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock];
103 | }
104 |
105 | - (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
106 | forState:(UIControlState)state
107 | placeholderImage:(nullable UIImage *)placeholder
108 | options:(SDWebImageOptions)options
109 | completed:(nullable SDExternalCompletionBlock)completedBlock {
110 | if (!url) {
111 | [self.imageURLStorage removeObjectForKey:@(state)];
112 | return;
113 | }
114 |
115 | self.imageURLStorage[@(state)] = url;
116 |
117 | __weak typeof(self)weakSelf = self;
118 | [self sd_internalSetImageWithURL:url
119 | placeholderImage:placeholder
120 | options:options
121 | operationKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]
122 | setImageBlock:^(UIImage *image, NSData *imageData) {
123 | [weakSelf setBackgroundImage:image forState:state];
124 | }
125 | progress:nil
126 | completed:completedBlock];
127 | }
128 |
129 | - (void)sd_setImageLoadOperation:(id)operation forState:(UIControlState)state {
130 | [self sd_setImageLoadOperation:operation forKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]];
131 | }
132 |
133 | - (void)sd_cancelImageLoadForState:(UIControlState)state {
134 | [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonImageOperation%@", @(state)]];
135 | }
136 |
137 | - (void)sd_setBackgroundImageLoadOperation:(id)operation forState:(UIControlState)state {
138 | [self sd_setImageLoadOperation:operation forKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]];
139 | }
140 |
141 | - (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state {
142 | [self sd_cancelImageLoadOperationWithKey:[NSString stringWithFormat:@"UIButtonBackgroundImageOperation%@", @(state)]];
143 | }
144 |
145 | - (SDStateImageURLDictionary *)imageURLStorage {
146 | SDStateImageURLDictionary *storage = objc_getAssociatedObject(self, &imageURLStorageKey);
147 | if (!storage) {
148 | storage = [NSMutableDictionary dictionary];
149 | objc_setAssociatedObject(self, &imageURLStorageKey, storage, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
150 | }
151 |
152 | return storage;
153 | }
154 |
155 | @end
156 |
157 | #endif
158 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIView+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 "UIView+WebCache.h"
10 |
11 | #if SD_UIKIT || SD_MAC
12 |
13 | #import "objc/runtime.h"
14 | #import "UIView+WebCacheOperation.h"
15 |
16 | static char imageURLKey;
17 |
18 | #if SD_UIKIT
19 | static char TAG_ACTIVITY_INDICATOR;
20 | static char TAG_ACTIVITY_STYLE;
21 | #endif
22 | static char TAG_ACTIVITY_SHOW;
23 |
24 | @implementation UIView (WebCache)
25 |
26 | - (nullable NSURL *)sd_imageURL {
27 | return objc_getAssociatedObject(self, &imageURLKey);
28 | }
29 |
30 | - (void)sd_internalSetImageWithURL:(nullable NSURL *)url
31 | placeholderImage:(nullable UIImage *)placeholder
32 | options:(SDWebImageOptions)options
33 | operationKey:(nullable NSString *)operationKey
34 | setImageBlock:(nullable SDSetImageBlock)setImageBlock
35 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
36 | completed:(nullable SDExternalCompletionBlock)completedBlock {
37 | NSString *validOperationKey = operationKey ?: NSStringFromClass([self class]);
38 | [self sd_cancelImageLoadOperationWithKey:validOperationKey];
39 | objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
40 |
41 | if (!(options & SDWebImageDelayPlaceholder)) {
42 | dispatch_main_async_safe(^{
43 | [self sd_setImage:placeholder imageData:nil basedOnClassOrViaCustomSetImageBlock:setImageBlock];
44 | });
45 | }
46 |
47 | if (url) {
48 | // check if activityView is enabled or not
49 | if ([self sd_showActivityIndicatorView]) {
50 | [self sd_addActivityIndicator];
51 | }
52 |
53 | __weak __typeof(self)wself = self;
54 | id operation = [SDWebImageManager.sharedManager loadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
55 | __strong __typeof (wself) sself = wself;
56 | [sself sd_removeActivityIndicator];
57 | if (!sself) {
58 | return;
59 | }
60 | dispatch_main_async_safe(^{
61 | if (!sself) {
62 | return;
63 | }
64 | if (image && (options & SDWebImageAvoidAutoSetImage) && completedBlock) {
65 | completedBlock(image, error, cacheType, url);
66 | return;
67 | } else if (image) {
68 | [sself sd_setImage:image imageData:data basedOnClassOrViaCustomSetImageBlock:setImageBlock];
69 | [sself sd_setNeedsLayout];
70 | } else {
71 | if ((options & SDWebImageDelayPlaceholder)) {
72 | [sself sd_setImage:placeholder imageData:nil basedOnClassOrViaCustomSetImageBlock:setImageBlock];
73 | [sself sd_setNeedsLayout];
74 | }
75 | }
76 | if (completedBlock && finished) {
77 | completedBlock(image, error, cacheType, url);
78 | }
79 | });
80 | }];
81 | [self sd_setImageLoadOperation:operation forKey:validOperationKey];
82 | } else {
83 | dispatch_main_async_safe(^{
84 | [self sd_removeActivityIndicator];
85 | if (completedBlock) {
86 | NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}];
87 | completedBlock(nil, error, SDImageCacheTypeNone, url);
88 | }
89 | });
90 | }
91 | }
92 |
93 | - (void)sd_cancelCurrentImageLoad {
94 | [self sd_cancelImageLoadOperationWithKey:NSStringFromClass([self class])];
95 | }
96 |
97 | - (void)sd_setImage:(UIImage *)image imageData:(NSData *)imageData basedOnClassOrViaCustomSetImageBlock:(SDSetImageBlock)setImageBlock {
98 | if (setImageBlock) {
99 | setImageBlock(image, imageData);
100 | return;
101 | }
102 |
103 | #if SD_UIKIT || SD_MAC
104 | if ([self isKindOfClass:[UIImageView class]]) {
105 | UIImageView *imageView = (UIImageView *)self;
106 | imageView.image = image;
107 | }
108 | #endif
109 |
110 | #if SD_UIKIT
111 | if ([self isKindOfClass:[UIButton class]]) {
112 | UIButton *button = (UIButton *)self;
113 | [button setImage:image forState:UIControlStateNormal];
114 | }
115 | #endif
116 | }
117 |
118 | - (void)sd_setNeedsLayout {
119 | #if SD_UIKIT
120 | [self setNeedsLayout];
121 | #elif SD_MAC
122 | [self setNeedsLayout:YES];
123 | #endif
124 | }
125 |
126 | #pragma mark - Activity indicator
127 |
128 | #pragma mark -
129 | #if SD_UIKIT
130 | - (UIActivityIndicatorView *)activityIndicator {
131 | return (UIActivityIndicatorView *)objc_getAssociatedObject(self, &TAG_ACTIVITY_INDICATOR);
132 | }
133 |
134 | - (void)setActivityIndicator:(UIActivityIndicatorView *)activityIndicator {
135 | objc_setAssociatedObject(self, &TAG_ACTIVITY_INDICATOR, activityIndicator, OBJC_ASSOCIATION_RETAIN);
136 | }
137 | #endif
138 |
139 | - (void)sd_setShowActivityIndicatorView:(BOOL)show {
140 | objc_setAssociatedObject(self, &TAG_ACTIVITY_SHOW, @(show), OBJC_ASSOCIATION_RETAIN);
141 | }
142 |
143 | - (BOOL)sd_showActivityIndicatorView {
144 | return [objc_getAssociatedObject(self, &TAG_ACTIVITY_SHOW) boolValue];
145 | }
146 |
147 | #if SD_UIKIT
148 | - (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style{
149 | objc_setAssociatedObject(self, &TAG_ACTIVITY_STYLE, [NSNumber numberWithInt:style], OBJC_ASSOCIATION_RETAIN);
150 | }
151 |
152 | - (int)sd_getIndicatorStyle{
153 | return [objc_getAssociatedObject(self, &TAG_ACTIVITY_STYLE) intValue];
154 | }
155 | #endif
156 |
157 | - (void)sd_addActivityIndicator {
158 | #if SD_UIKIT
159 | if (!self.activityIndicator) {
160 | self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:[self sd_getIndicatorStyle]];
161 | self.activityIndicator.translatesAutoresizingMaskIntoConstraints = NO;
162 |
163 | dispatch_main_async_safe(^{
164 | [self addSubview:self.activityIndicator];
165 |
166 | [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator
167 | attribute:NSLayoutAttributeCenterX
168 | relatedBy:NSLayoutRelationEqual
169 | toItem:self
170 | attribute:NSLayoutAttributeCenterX
171 | multiplier:1.0
172 | constant:0.0]];
173 | [self addConstraint:[NSLayoutConstraint constraintWithItem:self.activityIndicator
174 | attribute:NSLayoutAttributeCenterY
175 | relatedBy:NSLayoutRelationEqual
176 | toItem:self
177 | attribute:NSLayoutAttributeCenterY
178 | multiplier:1.0
179 | constant:0.0]];
180 | });
181 | }
182 |
183 | dispatch_main_async_safe(^{
184 | [self.activityIndicator startAnimating];
185 | });
186 | #endif
187 | }
188 |
189 | - (void)sd_removeActivityIndicator {
190 | #if SD_UIKIT
191 | if (self.activityIndicator) {
192 | [self.activityIndicator removeFromSuperview];
193 | self.activityIndicator = nil;
194 | }
195 | #endif
196 | }
197 |
198 | @end
199 |
200 | #endif
201 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImageView+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_UIKIT || SD_MAC
12 |
13 | #import "SDWebImageManager.h"
14 |
15 | /**
16 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView.
17 | *
18 | * Usage with a UITableViewCell sub-class:
19 | *
20 | * @code
21 |
22 | #import
23 |
24 | ...
25 |
26 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
27 | {
28 | static NSString *MyIdentifier = @"MyIdentifier";
29 |
30 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
31 |
32 | if (cell == nil) {
33 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier]
34 | autorelease];
35 | }
36 |
37 | // Here we use the provided sd_setImageWithURL: method to load the web image
38 | // Ensure you use a placeholder image otherwise cells will be initialized with no image
39 | [cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://example.com/image.jpg"]
40 | placeholderImage:[UIImage imageNamed:@"placeholder"]];
41 |
42 | cell.textLabel.text = @"My Text";
43 | return cell;
44 | }
45 |
46 | * @endcode
47 | */
48 | @interface UIImageView (WebCache)
49 |
50 | /**
51 | * Set the imageView `image` with an `url`.
52 | *
53 | * The download is asynchronous and cached.
54 | *
55 | * @param url The url for the image.
56 | */
57 | - (void)sd_setImageWithURL:(nullable NSURL *)url;
58 |
59 | /**
60 | * Set the imageView `image` with an `url` and a placeholder.
61 | *
62 | * The download is asynchronous and cached.
63 | *
64 | * @param url The url for the image.
65 | * @param placeholder The image to be set initially, until the image request finishes.
66 | * @see sd_setImageWithURL:placeholderImage:options:
67 | */
68 | - (void)sd_setImageWithURL:(nullable NSURL *)url
69 | placeholderImage:(nullable UIImage *)placeholder;
70 |
71 | /**
72 | * Set the imageView `image` with an `url`, placeholder and custom options.
73 | *
74 | * The download is asynchronous and cached.
75 | *
76 | * @param url The url for the image.
77 | * @param placeholder The image to be set initially, until the image request finishes.
78 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
79 | */
80 | - (void)sd_setImageWithURL:(nullable NSURL *)url
81 | placeholderImage:(nullable UIImage *)placeholder
82 | options:(SDWebImageOptions)options;
83 |
84 | /**
85 | * Set the imageView `image` with an `url`.
86 | *
87 | * The download is asynchronous and cached.
88 | *
89 | * @param url The url for the image.
90 | * @param completedBlock A block called when operation has been completed. This block has no return value
91 | * and takes the requested UIImage as first parameter. In case of error the image parameter
92 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
93 | * indicating if the image was retrieved from the local cache or from the network.
94 | * The fourth parameter is the original image url.
95 | */
96 | - (void)sd_setImageWithURL:(nullable NSURL *)url
97 | completed:(nullable SDExternalCompletionBlock)completedBlock;
98 |
99 | /**
100 | * Set the imageView `image` with an `url`, placeholder.
101 | *
102 | * The download is asynchronous and cached.
103 | *
104 | * @param url The url for the image.
105 | * @param placeholder The image to be set initially, until the image request finishes.
106 | * @param completedBlock A block called when operation has been completed. This block has no return value
107 | * and takes the requested UIImage as first parameter. In case of error the image parameter
108 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
109 | * indicating if the image was retrieved from the local cache or from the network.
110 | * The fourth parameter is the original image url.
111 | */
112 | - (void)sd_setImageWithURL:(nullable NSURL *)url
113 | placeholderImage:(nullable UIImage *)placeholder
114 | completed:(nullable SDExternalCompletionBlock)completedBlock;
115 |
116 | /**
117 | * Set the imageView `image` with an `url`, placeholder and custom options.
118 | *
119 | * The download is asynchronous and cached.
120 | *
121 | * @param url The url for the image.
122 | * @param placeholder The image to be set initially, until the image request finishes.
123 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
124 | * @param completedBlock A block called when operation has been completed. This block has no return value
125 | * and takes the requested UIImage as first parameter. In case of error the image parameter
126 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
127 | * indicating if the image was retrieved from the local cache or from the network.
128 | * The fourth parameter is the original image url.
129 | */
130 | - (void)sd_setImageWithURL:(nullable NSURL *)url
131 | placeholderImage:(nullable UIImage *)placeholder
132 | options:(SDWebImageOptions)options
133 | completed:(nullable SDExternalCompletionBlock)completedBlock;
134 |
135 | /**
136 | * Set the imageView `image` with an `url`, placeholder and custom options.
137 | *
138 | * The download is asynchronous and cached.
139 | *
140 | * @param url The url for the image.
141 | * @param placeholder The image to be set initially, until the image request finishes.
142 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
143 | * @param progressBlock A block called while image is downloading
144 | * @note the progress block is executed on a background queue
145 | * @param completedBlock A block called when operation has been completed. This block has no return value
146 | * and takes the requested UIImage as first parameter. In case of error the image parameter
147 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
148 | * indicating if the image was retrieved from the local cache or from the network.
149 | * The fourth parameter is the original image url.
150 | */
151 | - (void)sd_setImageWithURL:(nullable NSURL *)url
152 | placeholderImage:(nullable UIImage *)placeholder
153 | options:(SDWebImageOptions)options
154 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
155 | completed:(nullable SDExternalCompletionBlock)completedBlock;
156 |
157 | /**
158 | * Set the imageView `image` with an `url` and optionally a placeholder image.
159 | *
160 | * The download is asynchronous and cached.
161 | *
162 | * @param url The url for the image.
163 | * @param placeholder The image to be set initially, until the image request finishes.
164 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
165 | * @param progressBlock A block called while image is downloading
166 | * @note the progress block is executed on a background queue
167 | * @param completedBlock A block called when operation has been completed. This block has no return value
168 | * and takes the requested UIImage as first parameter. In case of error the image parameter
169 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
170 | * indicating if the image was retrieved from the local cache or from the network.
171 | * The fourth parameter is the original image url.
172 | */
173 | - (void)sd_setImageWithPreviousCachedImageWithURL:(nullable NSURL *)url
174 | placeholderImage:(nullable UIImage *)placeholder
175 | options:(SDWebImageOptions)options
176 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
177 | completed:(nullable SDExternalCompletionBlock)completedBlock;
178 |
179 | #if SD_UIKIT
180 |
181 | #pragma mark - Animation of multiple images
182 |
183 | /**
184 | * Download an array of images and starts them in an animation loop
185 | *
186 | * @param arrayOfURLs An array of NSURL
187 | */
188 | - (void)sd_setAnimationImagesWithURLs:(nonnull NSArray *)arrayOfURLs;
189 |
190 | - (void)sd_cancelCurrentAnimationImagesLoad;
191 |
192 | #endif
193 |
194 | @end
195 |
196 | #endif
197 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageDownloader.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 "SDWebImageOperation.h"
12 |
13 | typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) {
14 | SDWebImageDownloaderLowPriority = 1 << 0,
15 | SDWebImageDownloaderProgressiveDownload = 1 << 1,
16 |
17 | /**
18 | * By default, request prevent the use of NSURLCache. With this flag, NSURLCache
19 | * is used with default policies.
20 | */
21 | SDWebImageDownloaderUseNSURLCache = 1 << 2,
22 |
23 | /**
24 | * Call completion block with nil image/imageData if the image was read from NSURLCache
25 | * (to be combined with `SDWebImageDownloaderUseNSURLCache`).
26 | */
27 |
28 | SDWebImageDownloaderIgnoreCachedResponse = 1 << 3,
29 | /**
30 | * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for
31 | * extra time in background to let the request finish. If the background task expires the operation will be cancelled.
32 | */
33 |
34 | SDWebImageDownloaderContinueInBackground = 1 << 4,
35 |
36 | /**
37 | * Handles cookies stored in NSHTTPCookieStore by setting
38 | * NSMutableURLRequest.HTTPShouldHandleCookies = YES;
39 | */
40 | SDWebImageDownloaderHandleCookies = 1 << 5,
41 |
42 | /**
43 | * Enable to allow untrusted SSL certificates.
44 | * Useful for testing purposes. Use with caution in production.
45 | */
46 | SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6,
47 |
48 | /**
49 | * Put the image in the high priority queue.
50 | */
51 | SDWebImageDownloaderHighPriority = 1 << 7,
52 |
53 | /**
54 | * Scale down the image
55 | */
56 | SDWebImageDownloaderScaleDownLargeImages = 1 << 8,
57 | };
58 |
59 | typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) {
60 | /**
61 | * Default value. All download operations will execute in queue style (first-in-first-out).
62 | */
63 | SDWebImageDownloaderFIFOExecutionOrder,
64 |
65 | /**
66 | * All download operations will execute in stack style (last-in-first-out).
67 | */
68 | SDWebImageDownloaderLIFOExecutionOrder
69 | };
70 |
71 | extern NSString * _Nonnull const SDWebImageDownloadStartNotification;
72 | extern NSString * _Nonnull const SDWebImageDownloadStopNotification;
73 |
74 | typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL);
75 |
76 | typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished);
77 |
78 | typedef NSDictionary SDHTTPHeadersDictionary;
79 | typedef NSMutableDictionary SDHTTPHeadersMutableDictionary;
80 |
81 | typedef SDHTTPHeadersDictionary * _Nullable (^SDWebImageDownloaderHeadersFilterBlock)(NSURL * _Nullable url, SDHTTPHeadersDictionary * _Nullable headers);
82 |
83 | /**
84 | * A token associated with each download. Can be used to cancel a download
85 | */
86 | @interface SDWebImageDownloadToken : NSObject
87 |
88 | @property (nonatomic, strong, nullable) NSURL *url;
89 | @property (nonatomic, strong, nullable) id downloadOperationCancelToken;
90 |
91 | @end
92 |
93 |
94 | /**
95 | * Asynchronous downloader dedicated and optimized for image loading.
96 | */
97 | @interface SDWebImageDownloader : NSObject
98 |
99 | /**
100 | * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory.
101 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption.
102 | */
103 | @property (assign, nonatomic) BOOL shouldDecompressImages;
104 |
105 | /**
106 | * The maximum number of concurrent downloads
107 | */
108 | @property (assign, nonatomic) NSInteger maxConcurrentDownloads;
109 |
110 | /**
111 | * Shows the current amount of downloads that still need to be downloaded
112 | */
113 | @property (readonly, nonatomic) NSUInteger currentDownloadCount;
114 |
115 |
116 | /**
117 | * The timeout value (in seconds) for the download operation. Default: 15.0.
118 | */
119 | @property (assign, nonatomic) NSTimeInterval downloadTimeout;
120 |
121 |
122 | /**
123 | * Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`.
124 | */
125 | @property (assign, nonatomic) SDWebImageDownloaderExecutionOrder executionOrder;
126 |
127 | /**
128 | * Singleton method, returns the shared instance
129 | *
130 | * @return global shared instance of downloader class
131 | */
132 | + (nonnull instancetype)sharedDownloader;
133 |
134 | /**
135 | * Set the default URL credential to be set for request operations.
136 | */
137 | @property (strong, nonatomic, nullable) NSURLCredential *urlCredential;
138 |
139 | /**
140 | * Set username
141 | */
142 | @property (strong, nonatomic, nullable) NSString *username;
143 |
144 | /**
145 | * Set password
146 | */
147 | @property (strong, nonatomic, nullable) NSString *password;
148 |
149 | /**
150 | * Set filter to pick headers for downloading image HTTP request.
151 | *
152 | * This block will be invoked for each downloading image request, returned
153 | * NSDictionary will be used as headers in corresponding HTTP request.
154 | */
155 | @property (nonatomic, copy, nullable) SDWebImageDownloaderHeadersFilterBlock headersFilter;
156 |
157 | /**
158 | * Creates an instance of a downloader with specified session configuration.
159 | * *Note*: `timeoutIntervalForRequest` is going to be overwritten.
160 | * @return new instance of downloader class
161 | */
162 | - (nonnull instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)sessionConfiguration NS_DESIGNATED_INITIALIZER;
163 |
164 | /**
165 | * Set a value for a HTTP header to be appended to each download HTTP request.
166 | *
167 | * @param value The value for the header field. Use `nil` value to remove the header.
168 | * @param field The name of the header field to set.
169 | */
170 | - (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field;
171 |
172 | /**
173 | * Returns the value of the specified HTTP header field.
174 | *
175 | * @return The value associated with the header field field, or `nil` if there is no corresponding header field.
176 | */
177 | - (nullable NSString *)valueForHTTPHeaderField:(nullable NSString *)field;
178 |
179 | /**
180 | * Sets a subclass of `SDWebImageDownloaderOperation` as the default
181 | * `NSOperation` to be used each time SDWebImage constructs a request
182 | * operation to download an image.
183 | *
184 | * @param operationClass The subclass of `SDWebImageDownloaderOperation` to set
185 | * as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`.
186 | */
187 | - (void)setOperationClass:(nullable Class)operationClass;
188 |
189 | /**
190 | * Creates a SDWebImageDownloader async downloader instance with a given URL
191 | *
192 | * The delegate will be informed when the image is finish downloaded or an error has happen.
193 | *
194 | * @see SDWebImageDownloaderDelegate
195 | *
196 | * @param url The URL to the image to download
197 | * @param options The options to be used for this download
198 | * @param progressBlock A block called repeatedly while the image is downloading
199 | * @note the progress block is executed on a background queue
200 | * @param completedBlock A block called once the download is completed.
201 | * If the download succeeded, the image parameter is set, in case of error,
202 | * error parameter is set with the error. The last parameter is always YES
203 | * if SDWebImageDownloaderProgressiveDownload isn't use. With the
204 | * SDWebImageDownloaderProgressiveDownload option, this block is called
205 | * repeatedly with the partial image object and the finished argument set to NO
206 | * before to be called a last time with the full image and finished argument
207 | * set to YES. In case of error, the finished argument is always YES.
208 | *
209 | * @return A token (SDWebImageDownloadToken) that can be passed to -cancel: to cancel this operation
210 | */
211 | - (nullable SDWebImageDownloadToken *)downloadImageWithURL:(nullable NSURL *)url
212 | options:(SDWebImageDownloaderOptions)options
213 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
214 | completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock;
215 |
216 | /**
217 | * Cancels a download that was previously queued using -downloadImageWithURL:options:progress:completed:
218 | *
219 | * @param token The token received from -downloadImageWithURL:options:progress:completed: that should be canceled.
220 | */
221 | - (void)cancel:(nullable SDWebImageDownloadToken *)token;
222 |
223 | /**
224 | * Sets the download queue suspension state
225 | */
226 | - (void)setSuspended:(BOOL)suspended;
227 |
228 | /**
229 | * Cancels all download operations in the queue
230 | */
231 | - (void)cancelAllDownloads;
232 |
233 | @end
234 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | [](https://travis-ci.org/rs/SDWebImage)
7 | [](http://cocoadocs.org/docsets/SDWebImage/)
8 | [](http://cocoadocs.org/docsets/SDWebImage/)
9 | [](https://www.apache.org/licenses/LICENSE-2.0.html)
10 | [](https://www.versioneye.com/objective-c/sdwebimage)
11 | [](https://www.versioneye.com/objective-c/sdwebimage/references)
12 | [](https://github.com/rs/SDWebImage)
13 | [](https://codecov.io/gh/rs/SDWebImage)
14 |
15 | This library provides an async image downloader with cache support. For convenience, we added categories for UI elements like `UIImageView`, `UIButton`, `MKAnnotationView`.
16 |
17 | ## Features
18 |
19 | - [x] Categories for `UIImageView`, `UIButton`, `MKAnnotationView` adding web image and cache management
20 | - [x] An asynchronous image downloader
21 | - [x] An asynchronous memory + disk image caching with automatic cache expiration handling
22 | - [x] A background image decompression
23 | - [x] A guarantee that the same URL won't be downloaded several times
24 | - [x] A guarantee that bogus URLs won't be retried again and again
25 | - [x] A guarantee that main thread will never be blocked
26 | - [x] Performances!
27 | - [x] Use GCD and ARC
28 |
29 | ## Supported Image Formats
30 |
31 | - Image formats supported by UIImage (JPEG, PNG, ...), including GIF
32 | - WebP format, including animated WebP (use the `WebP` subspec)
33 |
34 | ## Requirements
35 |
36 | - iOS 7.0 or later
37 | - tvOS 9.0 or later
38 | - watchOS 2.0 or later
39 | - OS X 10.8 or later
40 | - Xcode 7.3 or later
41 |
42 | #### Backwards compatibility
43 |
44 | - For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/rs/SDWebImage/tree/3.7.6)
45 | - For iOS < 5.0, please use the last [2.0 version](https://github.com/rs/SDWebImage/tree/2.0-compat).
46 |
47 | ## Getting Started
48 |
49 | - Read this Readme doc
50 | - Read the [How to use section](https://github.com/rs/SDWebImage#how-to-use)
51 | - Read the [documentation @ CocoaDocs](http://cocoadocs.org/docsets/SDWebImage/)
52 | - Read [How is SDWebImage better than X?](https://github.com/rs/SDWebImage/wiki/How-is-SDWebImage-better-than-X%3F)
53 | - Try the example by downloading the project from Github or even easier using CocoaPods try `pod try SDWebImage`
54 | - Get to the [installation steps](https://github.com/rs/SDWebImage#installation)
55 | - Read the [SDWebImage 4.0 Migration Guide](Docs/SDWebImage-4.0-Migration-guide.md) to get an idea of the changes from 3.x to 4.x
56 |
57 | ## Who Uses It
58 | - Find out [who uses SDWebImage](https://github.com/rs/SDWebImage/wiki/Who-Uses-SDWebImage) and add your app to the list.
59 |
60 | ## Communication
61 |
62 | - If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/sdwebimage). (Tag 'sdwebimage')
63 | - If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/sdwebimage).
64 | - If you **found a bug**, open an issue.
65 | - If you **have a feature request**, open an issue.
66 | - If you **want to contribute**, submit a pull request.
67 |
68 | ## Installation
69 |
70 | ## How To Use
71 |
72 | ```objective-c
73 | Objective-C:
74 |
75 | #import
76 | ...
77 | [imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"]
78 | placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
79 | ```
80 |
81 | ```swift
82 | Swift:
83 |
84 | @import SDWebImage
85 |
86 | imageView.sd_setImage(with: URL(string: "http://www.domain.com/path/to/image.jpg"), placeholderImage: UIImage(named: "placeholder.png"))
87 | ```
88 |
89 | - For details about how to use the library and clear examples, see [The detailed How to use](Docs/HowToUse.md)
90 |
91 | ## Animated Images (GIF) support
92 |
93 | - Starting with the 4.0 version, we rely on [FLAnimatedImage](https://github.com/Flipboard/FLAnimatedImage) to take care of our animated images.
94 | - To use it, simply make sure you use `FLAnimatedImageView` instead of `UIImageView`.
95 | - **Note**: there is a backwards compatible feature, so if you are still trying to load a GIF into a `UIImageView`, it will only show the 1st frame as a static image.
96 | - **Important**: FLAnimatedImage only works on the iOS platform, so for all the other platforms (OS X, tvOS, watchOS) we will fallback to the backwards compatibility feature described above
97 |
98 | Common Problems
99 | ---------------
100 |
101 | ### Using dynamic image size with UITableViewCell
102 |
103 | UITableView determines the size of the image by the first image set for a cell. If your remote images
104 | don't have the same size as your placeholder image, you may experience strange anamorphic scaling issue.
105 | The following article gives a way to workaround this issue:
106 |
107 | [http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/](http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/)
108 |
109 |
110 | ### Handle image refresh
111 |
112 | SDWebImage does very aggressive caching by default. It ignores all kind of caching control header returned by the HTTP server and cache the returned images with no time restriction. It implies your images URLs are static URLs pointing to images that never change. If the pointed image happen to change, some parts of the URL should change accordingly.
113 |
114 | If you don't control the image server you're using, you may not be able to change the URL when its content is updated. This is the case for Facebook avatar URLs for instance. In such case, you may use the `SDWebImageRefreshCached` flag. This will slightly degrade the performance but will respect the HTTP caching control headers:
115 |
116 | ``` objective-c
117 | [imageView sd_setImageWithURL:[NSURL URLWithString:@"https://graph.facebook.com/olivier.poitrey/picture"]
118 | placeholderImage:[UIImage imageNamed:@"avatar-placeholder.png"]
119 | options:SDWebImageRefreshCached];
120 | ```
121 |
122 | ### Add a progress indicator
123 |
124 | Add these before you call ```sd_setImageWithURL```
125 |
126 | ``` objective-c
127 | [imageView setShowActivityIndicatorView:YES];
128 | [imageView setIndicatorStyle:UIActivityIndicatorViewStyleGray];
129 | ```
130 |
131 | ``` swift
132 | imageView.setShowActivityIndicatorView(true)
133 | imageView.setIndicatorStyle(.Gray)
134 | ```
135 |
136 | Installation
137 | ------------
138 |
139 | There are three ways to use SDWebImage in your project:
140 | - using CocoaPods
141 | - using Carthage
142 | - by cloning the project into your repository
143 |
144 | ### Installation with CocoaPods
145 |
146 | [CocoaPods](http://cocoapods.org/) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the [Get Started](http://cocoapods.org/#get_started) section for more details.
147 |
148 | #### Podfile
149 | ```
150 | platform :ios, '7.0'
151 | pod 'SDWebImage', '~>3.8'
152 | ```
153 |
154 | If you are using Swift, be sure to add `use_frameworks!` and set your target to iOS 8+:
155 | ```
156 | platform :ios, '8.0'
157 | use_frameworks!
158 | ```
159 |
160 | #### Subspecs
161 |
162 | There are 3 subspecs available now: `Core`, `MapKit` and `WebP` (this means you can install only some of the SDWebImage modules. By default, you get just `Core`, so if you need `WebP`, you need to specify it).
163 |
164 | Podfile example:
165 | ```
166 | pod 'SDWebImage/WebP'
167 | ```
168 |
169 | ### Installation with Carthage (iOS 8+)
170 |
171 | [Carthage](https://github.com/Carthage/Carthage) is a lightweight dependency manager for Swift and Objective-C. It leverages CocoaTouch modules and is less invasive than CocoaPods.
172 |
173 | To install with carthage, follow the instruction on [Carthage](https://github.com/Carthage/Carthage)
174 |
175 | #### Cartfile
176 | ```
177 | github "rs/SDWebImage"
178 | ```
179 |
180 | ### Installation by cloning the repository
181 | - see [Manual install](Docs/ManualInstallation.md)
182 |
183 | ### Import headers in your source files
184 |
185 | In the source files where you need to use the library, import the header file:
186 |
187 | ```objective-c
188 | #import
189 | ```
190 |
191 | ### Build Project
192 |
193 | At this point your workspace should build without error. If you are having problem, post to the Issue and the
194 | community can help you solve it.
195 |
196 | ## Author
197 | - [Olivier Poitrey](https://github.com/rs)
198 |
199 | ## Collaborators
200 | - [Konstantinos K.](https://github.com/mythodeia)
201 | - [Bogdan Poplauschi](https://github.com/bpoplauschi)
202 |
203 | ## Licenses
204 |
205 | All source code is licensed under the [MIT License](https://raw.github.com/rs/SDWebImage/master/LICENSE).
206 |
207 | ## Architecture
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
--------------------------------------------------------------------------------