├── .gitignore ├── .travis.yml ├── Example ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── XMultiTabModule-iOS.podspec.json │ ├── MJExtension │ │ ├── LICENSE │ │ ├── MJExtension │ │ │ ├── MJExtension.h │ │ │ ├── MJExtensionConst.h │ │ │ ├── MJExtensionConst.m │ │ │ ├── MJFoundation.h │ │ │ ├── MJFoundation.m │ │ │ ├── MJProperty.h │ │ │ ├── MJProperty.m │ │ │ ├── MJPropertyKey.h │ │ │ ├── MJPropertyKey.m │ │ │ ├── MJPropertyType.h │ │ │ ├── MJPropertyType.m │ │ │ ├── NSObject+MJClass.h │ │ │ ├── NSObject+MJClass.m │ │ │ ├── NSObject+MJCoding.h │ │ │ ├── NSObject+MJCoding.m │ │ │ ├── NSObject+MJKeyValue.h │ │ │ ├── NSObject+MJKeyValue.m │ │ │ ├── NSObject+MJProperty.h │ │ │ ├── NSObject+MJProperty.m │ │ │ ├── NSString+MJExtension.h │ │ │ └── NSString+MJExtension.m │ │ └── README.md │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ ├── SDWebImage │ │ ├── LICENSE │ │ ├── README.md │ │ ├── SDWebImage │ │ │ ├── Core │ │ │ │ ├── NSButton+WebCache.h │ │ │ │ ├── NSButton+WebCache.m │ │ │ │ ├── NSData+ImageContentType.h │ │ │ │ ├── NSData+ImageContentType.m │ │ │ │ ├── NSImage+Compatibility.h │ │ │ │ ├── NSImage+Compatibility.m │ │ │ │ ├── SDAnimatedImage.h │ │ │ │ ├── SDAnimatedImage.m │ │ │ │ ├── SDAnimatedImagePlayer.h │ │ │ │ ├── SDAnimatedImagePlayer.m │ │ │ │ ├── SDAnimatedImageRep.h │ │ │ │ ├── SDAnimatedImageRep.m │ │ │ │ ├── SDAnimatedImageView+WebCache.h │ │ │ │ ├── SDAnimatedImageView+WebCache.m │ │ │ │ ├── SDAnimatedImageView.h │ │ │ │ ├── SDAnimatedImageView.m │ │ │ │ ├── SDDiskCache.h │ │ │ │ ├── SDDiskCache.m │ │ │ │ ├── SDGraphicsImageRenderer.h │ │ │ │ ├── SDGraphicsImageRenderer.m │ │ │ │ ├── SDImageAPNGCoder.h │ │ │ │ ├── SDImageAPNGCoder.m │ │ │ │ ├── SDImageAWebPCoder.h │ │ │ │ ├── SDImageAWebPCoder.m │ │ │ │ ├── SDImageCache.h │ │ │ │ ├── SDImageCache.m │ │ │ │ ├── SDImageCacheConfig.h │ │ │ │ ├── SDImageCacheConfig.m │ │ │ │ ├── SDImageCacheDefine.h │ │ │ │ ├── SDImageCacheDefine.m │ │ │ │ ├── SDImageCachesManager.h │ │ │ │ ├── SDImageCachesManager.m │ │ │ │ ├── SDImageCoder.h │ │ │ │ ├── SDImageCoder.m │ │ │ │ ├── SDImageCoderHelper.h │ │ │ │ ├── SDImageCoderHelper.m │ │ │ │ ├── SDImageCodersManager.h │ │ │ │ ├── SDImageCodersManager.m │ │ │ │ ├── SDImageFrame.h │ │ │ │ ├── SDImageFrame.m │ │ │ │ ├── SDImageGIFCoder.h │ │ │ │ ├── SDImageGIFCoder.m │ │ │ │ ├── SDImageGraphics.h │ │ │ │ ├── SDImageGraphics.m │ │ │ │ ├── SDImageHEICCoder.h │ │ │ │ ├── SDImageHEICCoder.m │ │ │ │ ├── SDImageIOAnimatedCoder.h │ │ │ │ ├── SDImageIOAnimatedCoder.m │ │ │ │ ├── SDImageIOCoder.h │ │ │ │ ├── SDImageIOCoder.m │ │ │ │ ├── SDImageLoader.h │ │ │ │ ├── SDImageLoader.m │ │ │ │ ├── SDImageLoadersManager.h │ │ │ │ ├── SDImageLoadersManager.m │ │ │ │ ├── SDImageTransformer.h │ │ │ │ ├── SDImageTransformer.m │ │ │ │ ├── SDMemoryCache.h │ │ │ │ ├── SDMemoryCache.m │ │ │ │ ├── SDWebImageCacheKeyFilter.h │ │ │ │ ├── SDWebImageCacheKeyFilter.m │ │ │ │ ├── SDWebImageCacheSerializer.h │ │ │ │ ├── SDWebImageCacheSerializer.m │ │ │ │ ├── SDWebImageCompat.h │ │ │ │ ├── SDWebImageCompat.m │ │ │ │ ├── SDWebImageDefine.h │ │ │ │ ├── SDWebImageDefine.m │ │ │ │ ├── SDWebImageDownloader.h │ │ │ │ ├── SDWebImageDownloader.m │ │ │ │ ├── SDWebImageDownloaderConfig.h │ │ │ │ ├── SDWebImageDownloaderConfig.m │ │ │ │ ├── SDWebImageDownloaderDecryptor.h │ │ │ │ ├── SDWebImageDownloaderDecryptor.m │ │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ │ ├── SDWebImageDownloaderOperation.m │ │ │ │ ├── SDWebImageDownloaderRequestModifier.h │ │ │ │ ├── SDWebImageDownloaderRequestModifier.m │ │ │ │ ├── SDWebImageDownloaderResponseModifier.h │ │ │ │ ├── SDWebImageDownloaderResponseModifier.m │ │ │ │ ├── SDWebImageError.h │ │ │ │ ├── SDWebImageError.m │ │ │ │ ├── SDWebImageIndicator.h │ │ │ │ ├── SDWebImageIndicator.m │ │ │ │ ├── SDWebImageManager.h │ │ │ │ ├── SDWebImageManager.m │ │ │ │ ├── SDWebImageOperation.h │ │ │ │ ├── SDWebImageOperation.m │ │ │ │ ├── SDWebImageOptionsProcessor.h │ │ │ │ ├── SDWebImageOptionsProcessor.m │ │ │ │ ├── SDWebImagePrefetcher.h │ │ │ │ ├── SDWebImagePrefetcher.m │ │ │ │ ├── SDWebImageTransition.h │ │ │ │ ├── SDWebImageTransition.m │ │ │ │ ├── UIButton+WebCache.h │ │ │ │ ├── UIButton+WebCache.m │ │ │ │ ├── UIImage+ExtendedCacheData.h │ │ │ │ ├── UIImage+ExtendedCacheData.m │ │ │ │ ├── UIImage+ForceDecode.h │ │ │ │ ├── UIImage+ForceDecode.m │ │ │ │ ├── UIImage+GIF.h │ │ │ │ ├── UIImage+GIF.m │ │ │ │ ├── UIImage+MemoryCacheCost.h │ │ │ │ ├── UIImage+MemoryCacheCost.m │ │ │ │ ├── UIImage+Metadata.h │ │ │ │ ├── UIImage+Metadata.m │ │ │ │ ├── UIImage+MultiFormat.h │ │ │ │ ├── UIImage+MultiFormat.m │ │ │ │ ├── UIImage+Transform.h │ │ │ │ ├── UIImage+Transform.m │ │ │ │ ├── UIImageView+HighlightedWebCache.h │ │ │ │ ├── UIImageView+HighlightedWebCache.m │ │ │ │ ├── UIImageView+WebCache.h │ │ │ │ ├── UIImageView+WebCache.m │ │ │ │ ├── UIView+WebCache.h │ │ │ │ ├── UIView+WebCache.m │ │ │ │ ├── UIView+WebCacheOperation.h │ │ │ │ └── UIView+WebCacheOperation.m │ │ │ └── Private │ │ │ │ ├── NSBezierPath+SDRoundedCorners.h │ │ │ │ ├── NSBezierPath+SDRoundedCorners.m │ │ │ │ ├── SDAssociatedObject.h │ │ │ │ ├── SDAssociatedObject.m │ │ │ │ ├── SDAsyncBlockOperation.h │ │ │ │ ├── SDAsyncBlockOperation.m │ │ │ │ ├── SDDeviceHelper.h │ │ │ │ ├── SDDeviceHelper.m │ │ │ │ ├── SDDisplayLink.h │ │ │ │ ├── SDDisplayLink.m │ │ │ │ ├── SDFileAttributeHelper.h │ │ │ │ ├── SDFileAttributeHelper.m │ │ │ │ ├── SDImageAssetManager.h │ │ │ │ ├── SDImageAssetManager.m │ │ │ │ ├── SDImageCachesManagerOperation.h │ │ │ │ ├── SDImageCachesManagerOperation.m │ │ │ │ ├── SDImageIOAnimatedCoderInternal.h │ │ │ │ ├── SDInternalMacros.h │ │ │ │ ├── SDInternalMacros.m │ │ │ │ ├── SDWeakProxy.h │ │ │ │ ├── SDWeakProxy.m │ │ │ │ ├── SDWebImageTransitionInternal.h │ │ │ │ ├── SDmetamacros.h │ │ │ │ ├── UIColor+SDHexString.h │ │ │ │ └── UIColor+SDHexString.m │ │ └── WebImage │ │ │ └── SDWebImage.h │ └── Target Support Files │ │ ├── MJExtension │ │ ├── MJExtension-Info.plist │ │ ├── MJExtension-dummy.m │ │ ├── MJExtension-prefix.pch │ │ ├── MJExtension-umbrella.h │ │ ├── MJExtension.modulemap │ │ └── MJExtension.xcconfig │ │ ├── Pods-XMultiTabModule-iOS_Example │ │ ├── Pods-XMultiTabModule-iOS_Example-Info.plist │ │ ├── Pods-XMultiTabModule-iOS_Example-acknowledgements.markdown │ │ ├── Pods-XMultiTabModule-iOS_Example-acknowledgements.plist │ │ ├── Pods-XMultiTabModule-iOS_Example-dummy.m │ │ ├── Pods-XMultiTabModule-iOS_Example-frameworks.sh │ │ ├── Pods-XMultiTabModule-iOS_Example-umbrella.h │ │ ├── Pods-XMultiTabModule-iOS_Example.debug.xcconfig │ │ ├── Pods-XMultiTabModule-iOS_Example.modulemap │ │ └── Pods-XMultiTabModule-iOS_Example.release.xcconfig │ │ ├── Pods-XMultiTabModule-iOS_Tests │ │ ├── Pods-XMultiTabModule-iOS_Tests-Info.plist │ │ ├── Pods-XMultiTabModule-iOS_Tests-acknowledgements.markdown │ │ ├── Pods-XMultiTabModule-iOS_Tests-acknowledgements.plist │ │ ├── Pods-XMultiTabModule-iOS_Tests-dummy.m │ │ ├── Pods-XMultiTabModule-iOS_Tests-umbrella.h │ │ ├── Pods-XMultiTabModule-iOS_Tests.debug.xcconfig │ │ ├── Pods-XMultiTabModule-iOS_Tests.modulemap │ │ └── Pods-XMultiTabModule-iOS_Tests.release.xcconfig │ │ ├── SDWebImage │ │ ├── SDWebImage-Info.plist │ │ ├── SDWebImage-dummy.m │ │ ├── SDWebImage-prefix.pch │ │ ├── SDWebImage-umbrella.h │ │ ├── SDWebImage.modulemap │ │ └── SDWebImage.xcconfig │ │ └── XMultiTabModule-iOS │ │ ├── XMultiTabModule-iOS-Info.plist │ │ ├── XMultiTabModule-iOS-dummy.m │ │ ├── XMultiTabModule-iOS-prefix.pch │ │ ├── XMultiTabModule-iOS-umbrella.h │ │ ├── XMultiTabModule-iOS.modulemap │ │ └── XMultiTabModule-iOS.xcconfig ├── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ │ └── InfoPlist.strings ├── XMultiTabModule-iOS.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── XMultiTabModule-iOS-Example.xcscheme ├── XMultiTabModule-iOS.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── XMultiTabModule-iOS │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── JDBAppDelegate.h │ ├── JDBAppDelegate.m │ ├── JDBMultiTabModule-Info.plist │ ├── JDBMultiTabModule-Prefix.pch │ ├── JDBTabLoader.h │ ├── JDBTabLoader.m │ ├── JDBViewController.h │ ├── JDBViewController.m │ ├── XMultiTabModule-iOS-Info.plist │ ├── XMultiTabModule-iOS-Prefix.pch │ ├── en.lproj │ └── InfoPlist.strings │ ├── main.m │ └── tabs.json ├── LICENSE ├── README.md ├── XMultiTabModule-iOS.podspec ├── XMultiTabModule-iOS ├── Assets │ ├── .gitkeep │ └── Media.xcassets │ │ ├── Contents.json │ │ └── placeholder_100x100.imageset │ │ ├── Contents.json │ │ └── placeholder_100x100@2x.png └── Classes │ ├── .gitkeep │ ├── NSArray+SSSSafe.h │ ├── NSArray+SSSSafe.m │ ├── SSSMultiTabController.h │ ├── SSSMultiTabController.m │ ├── SSSMutableTabContainerHelper.h │ ├── SSSMutableTabContainerHelper.m │ ├── SSSTabModel.h │ ├── SSSTabModel.m │ ├── SSSUtils.h │ ├── SSSUtils.m │ ├── UIColor+SSS.h │ └── UIColor+SSS.m └── _Pods.xcodeproj /.gitignore: -------------------------------------------------------------------------------- 1 | # macOS 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | *.moved-aside 17 | DerivedData 18 | *.hmap 19 | *.ipa 20 | 21 | # Bundler 22 | .bundle 23 | 24 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 25 | # Carthage/Checkouts 26 | 27 | Carthage/Build 28 | 29 | # We recommend against adding the Pods directory to your .gitignore. However 30 | # you should judge for yourself, the pros and cons are mentioned at: 31 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 32 | # 33 | # Note: if you ignore the Pods directory, make sure to uncomment 34 | # `pod install` in .travis.yml 35 | # 36 | # Pods/ 37 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/ 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/XMultiTabModule-iOS.xcworkspace -scheme XMultiTabModule-iOS-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | platform :ios, '10.0' 4 | 5 | target 'XMultiTabModule-iOS_Example' do 6 | pod 'XMultiTabModule-iOS', :path => '../' 7 | pod 'MJExtension' 8 | 9 | target 'XMultiTabModule-iOS_Tests' do 10 | inherit! :search_paths 11 | 12 | 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MJExtension (3.4.1) 3 | - SDWebImage (5.13.2): 4 | - SDWebImage/Core (= 5.13.2) 5 | - SDWebImage/Core (5.13.2) 6 | - XMultiTabModule-iOS (0.1.0): 7 | - SDWebImage 8 | 9 | DEPENDENCIES: 10 | - MJExtension 11 | - XMultiTabModule-iOS (from `../`) 12 | 13 | SPEC REPOS: 14 | trunk: 15 | - MJExtension 16 | - SDWebImage 17 | 18 | EXTERNAL SOURCES: 19 | XMultiTabModule-iOS: 20 | :path: "../" 21 | 22 | SPEC CHECKSUMS: 23 | MJExtension: 21c5f6f8c4d5d8844b7ae8fbae08fed0b501f961 24 | SDWebImage: 72f86271a6f3139cc7e4a89220946489d4b9a866 25 | XMultiTabModule-iOS: 4199cb26b13c23393d4f80a4a2523d0140a360ea 26 | 27 | PODFILE CHECKSUM: c35da12977f8aca0c076af81b308b7306a0b45e2 28 | 29 | COCOAPODS: 1.8.3 30 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/XMultiTabModule-iOS.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "XMultiTabModule-iOS", 3 | "version": "0.1.0", 4 | "summary": "A short description of XMultiTabModule-iOS.", 5 | "description": "TODO: Add long description of the pod here.", 6 | "homepage": "https://github.com/lixianke1/XMultiTabModule-iOS", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "lixianke1": "lixianke1@jd.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/lixianke1/XMultiTabModule-iOS.git", 16 | "tag": "0.1.0" 17 | }, 18 | "platforms": { 19 | "ios": "9.0" 20 | }, 21 | "source_files": "XMultiTabModule-iOS/Classes/**/*", 22 | "resources": "XMultiTabModule-iOS/Assets/*.xcassets", 23 | "public_header_files": "Pod/Classes/**/*.h", 24 | "dependencies": { 25 | "SDWebImage": [ 26 | 27 | ] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2019 MJExtension (https://github.com/CoderMJLee/MJExtension) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/MJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJExtension.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NSObject+MJCoding.h" 11 | #import "NSObject+MJProperty.h" 12 | #import "NSObject+MJClass.h" 13 | #import "NSObject+MJKeyValue.h" 14 | #import "NSString+MJExtension.h" 15 | #import "MJExtensionConst.h" 16 | 17 | #import "MJFoundation.h" 18 | 19 | //! Project version number for MJExtension. 20 | FOUNDATION_EXPORT double MJExtensionVersionNumber; 21 | 22 | //! Project version string for MJExtension. 23 | FOUNDATION_EXPORT const unsigned char MJExtensionVersionString[]; 24 | 25 | // In this header, you should import all the public headers of your framework using statements like #import 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/MJExtensionConst.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __MJExtensionConst__H__ 3 | #define __MJExtensionConst__H__ 4 | 5 | #import 6 | 7 | #ifndef MJ_LOCK 8 | #define MJ_LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); 9 | #endif 10 | 11 | #ifndef MJ_UNLOCK 12 | #define MJ_UNLOCK(lock) dispatch_semaphore_signal(lock); 13 | #endif 14 | 15 | // 信号量 16 | #define MJExtensionSemaphoreCreate \ 17 | extern dispatch_semaphore_t mje_signalSemaphore; \ 18 | extern dispatch_once_t mje_onceTokenSemaphore; \ 19 | dispatch_once(&mje_onceTokenSemaphore, ^{ \ 20 | mje_signalSemaphore = dispatch_semaphore_create(1); \ 21 | }); 22 | 23 | // 过期 24 | #define MJExtensionDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead) 25 | 26 | // 构建错误 27 | #define MJExtensionBuildError(clazz, msg) \ 28 | NSError *error = [NSError errorWithDomain:msg code:250 userInfo:nil]; \ 29 | [clazz setMj_error:error]; 30 | 31 | // 日志输出 32 | #ifdef DEBUG 33 | #define MJExtensionLog(...) NSLog(__VA_ARGS__) 34 | #else 35 | #define MJExtensionLog(...) 36 | #endif 37 | 38 | /** 39 | * 断言 40 | * @param condition 条件 41 | * @param returnValue 返回值 42 | */ 43 | #define MJExtensionAssertError(condition, returnValue, clazz, msg) \ 44 | [clazz setMj_error:nil]; \ 45 | if ((condition) == NO) { \ 46 | MJExtensionBuildError(clazz, msg); \ 47 | return returnValue;\ 48 | } 49 | 50 | #define MJExtensionAssert2(condition, returnValue) \ 51 | if ((condition) == NO) return returnValue; 52 | 53 | /** 54 | * 断言 55 | * @param condition 条件 56 | */ 57 | #define MJExtensionAssert(condition) MJExtensionAssert2(condition, ) 58 | 59 | /** 60 | * 断言 61 | * @param param 参数 62 | * @param returnValue 返回值 63 | */ 64 | #define MJExtensionAssertParamNotNil2(param, returnValue) \ 65 | MJExtensionAssert2((param) != nil, returnValue) 66 | 67 | /** 68 | * 断言 69 | * @param param 参数 70 | */ 71 | #define MJExtensionAssertParamNotNil(param) MJExtensionAssertParamNotNil2(param, ) 72 | 73 | /** 74 | * 打印所有的属性 75 | */ 76 | #define MJLogAllIvars \ 77 | - (NSString *)description \ 78 | { \ 79 | return [self mj_keyValues].description; \ 80 | } 81 | #define MJExtensionLogAllProperties MJLogAllIvars 82 | 83 | /** 仅在 Debugger 展示所有的属性 */ 84 | #define MJImplementDebugDescription \ 85 | - (NSString *)debugDescription \ 86 | { \ 87 | return [self mj_keyValues].debugDescription; \ 88 | } 89 | 90 | /** 91 | * 类型(属性类型) 92 | */ 93 | FOUNDATION_EXPORT NSString *const MJPropertyTypeInt; 94 | FOUNDATION_EXPORT NSString *const MJPropertyTypeShort; 95 | FOUNDATION_EXPORT NSString *const MJPropertyTypeFloat; 96 | FOUNDATION_EXPORT NSString *const MJPropertyTypeDouble; 97 | FOUNDATION_EXPORT NSString *const MJPropertyTypeLong; 98 | FOUNDATION_EXPORT NSString *const MJPropertyTypeLongLong; 99 | FOUNDATION_EXPORT NSString *const MJPropertyTypeChar; 100 | FOUNDATION_EXPORT NSString *const MJPropertyTypeBOOL1; 101 | FOUNDATION_EXPORT NSString *const MJPropertyTypeBOOL2; 102 | FOUNDATION_EXPORT NSString *const MJPropertyTypePointer; 103 | 104 | FOUNDATION_EXPORT NSString *const MJPropertyTypeIvar; 105 | FOUNDATION_EXPORT NSString *const MJPropertyTypeMethod; 106 | FOUNDATION_EXPORT NSString *const MJPropertyTypeBlock; 107 | FOUNDATION_EXPORT NSString *const MJPropertyTypeClass; 108 | FOUNDATION_EXPORT NSString *const MJPropertyTypeSEL; 109 | FOUNDATION_EXPORT NSString *const MJPropertyTypeId; 110 | 111 | #endif 112 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/MJExtensionConst.m: -------------------------------------------------------------------------------- 1 | #ifndef __MJExtensionConst__M__ 2 | #define __MJExtensionConst__M__ 3 | 4 | #import 5 | 6 | /** 7 | * 成员变量类型(属性类型) 8 | */ 9 | NSString *const MJPropertyTypeInt = @"i"; 10 | NSString *const MJPropertyTypeShort = @"s"; 11 | NSString *const MJPropertyTypeFloat = @"f"; 12 | NSString *const MJPropertyTypeDouble = @"d"; 13 | NSString *const MJPropertyTypeLong = @"l"; 14 | NSString *const MJPropertyTypeLongLong = @"q"; 15 | NSString *const MJPropertyTypeChar = @"c"; 16 | NSString *const MJPropertyTypeBOOL1 = @"c"; 17 | NSString *const MJPropertyTypeBOOL2 = @"b"; 18 | NSString *const MJPropertyTypePointer = @"*"; 19 | 20 | NSString *const MJPropertyTypeIvar = @"^{objc_ivar=}"; 21 | NSString *const MJPropertyTypeMethod = @"^{objc_method=}"; 22 | NSString *const MJPropertyTypeBlock = @"@?"; 23 | NSString *const MJPropertyTypeClass = @"#"; 24 | NSString *const MJPropertyTypeSEL = @":"; 25 | NSString *const MJPropertyTypeId = @"@"; 26 | 27 | #endif -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/MJFoundation.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJFoundation.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 14/7/16. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MJFoundation : NSObject 12 | 13 | + (BOOL)isClassFromFoundation:(Class)c; 14 | + (BOOL)isFromNSObjectProtocolProperty:(NSString *)propertyName; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/MJFoundation.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJFoundation.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 14/7/16. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJFoundation.h" 10 | #import "MJExtensionConst.h" 11 | #import 12 | #import "objc/runtime.h" 13 | 14 | @implementation MJFoundation 15 | 16 | + (BOOL)isClassFromFoundation:(Class)c 17 | { 18 | if (c == [NSObject class] || c == [NSManagedObject class]) return YES; 19 | 20 | static NSSet *foundationClasses; 21 | static dispatch_once_t onceToken; 22 | dispatch_once(&onceToken, ^{ 23 | // 集合中没有NSObject,因为几乎所有的类都是继承自NSObject,具体是不是NSObject需要特殊判断 24 | foundationClasses = [NSSet setWithObjects: 25 | [NSURL class], 26 | [NSDate class], 27 | [NSValue class], 28 | [NSData class], 29 | [NSError class], 30 | [NSArray class], 31 | [NSDictionary class], 32 | [NSString class], 33 | [NSAttributedString class], nil]; 34 | }); 35 | 36 | __block BOOL result = NO; 37 | [foundationClasses enumerateObjectsUsingBlock:^(Class foundationClass, BOOL *stop) { 38 | if ([c isSubclassOfClass:foundationClass]) { 39 | result = YES; 40 | *stop = YES; 41 | } 42 | }]; 43 | return result; 44 | } 45 | 46 | + (BOOL)isFromNSObjectProtocolProperty:(NSString *)propertyName 47 | { 48 | if (!propertyName) return NO; 49 | 50 | static NSSet *objectProtocolPropertyNames; 51 | static dispatch_once_t onceToken; 52 | dispatch_once(&onceToken, ^{ 53 | unsigned int count = 0; 54 | objc_property_t *propertyList = protocol_copyPropertyList(@protocol(NSObject), &count); 55 | NSMutableSet *propertyNames = [NSMutableSet setWithCapacity:count]; 56 | for (int i = 0; i < count; i++) { 57 | objc_property_t property = propertyList[i]; 58 | NSString *propertyName = [NSString stringWithCString:property_getName(property) encoding:NSUTF8StringEncoding]; 59 | if (propertyName) { 60 | [propertyNames addObject:propertyName]; 61 | } 62 | } 63 | objectProtocolPropertyNames = [propertyNames copy]; 64 | free(propertyList); 65 | }); 66 | 67 | return [objectProtocolPropertyNames containsObject:propertyName]; 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/MJProperty.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJProperty.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/4/17. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 包装一个成员属性 8 | 9 | #import 10 | #import 11 | #import "MJPropertyType.h" 12 | #import "MJPropertyKey.h" 13 | 14 | /** 15 | * 包装一个成员 16 | */ 17 | @interface MJProperty : NSObject 18 | /** 成员属性 */ 19 | @property (nonatomic, assign) objc_property_t property; 20 | /** 成员属性的名字 */ 21 | @property (nonatomic, readonly) NSString *name; 22 | 23 | /** 成员属性的类型 */ 24 | @property (nonatomic, readonly) MJPropertyType *type; 25 | /** 成员属性来源于哪个类(可能是父类) */ 26 | @property (nonatomic, assign) Class srcClass; 27 | 28 | /**** 同一个成员属性 - 父类和子类的行为可能不一致(originKey、propertyKeys、objectClassInArray) ****/ 29 | /** 设置最原始的key */ 30 | - (void)setOriginKey:(id)originKey forClass:(Class)c; 31 | /** 对应着字典中的多级key(里面存放的数组,数组里面都是MJPropertyKey对象) */ 32 | - (NSArray *)propertyKeysForClass:(Class)c; 33 | 34 | /** 模型数组中的模型类型 */ 35 | - (void)setObjectClassInArray:(Class)objectClass forClass:(Class)c; 36 | - (Class)objectClassInArrayForClass:(Class)c; 37 | /**** 同一个成员变量 - 父类和子类的行为可能不一致(key、keys、objectClassInArray) ****/ 38 | 39 | /** 40 | * 设置object的成员变量值 41 | */ 42 | - (void)setValue:(id)value forObject:(id)object; 43 | /** 44 | * 得到object的成员属性值 45 | */ 46 | - (id)valueForObject:(id)object; 47 | 48 | /** 49 | * 初始化 50 | */ 51 | + (instancetype)cachedPropertyWithProperty:(objc_property_t)property; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/MJPropertyKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyKey.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum { 12 | MJPropertyKeyTypeDictionary = 0, // 字典的key 13 | MJPropertyKeyTypeArray // 数组的key 14 | } MJPropertyKeyType; 15 | 16 | /** 17 | * 属性的key 18 | */ 19 | @interface MJPropertyKey : NSObject 20 | /** key的名字 */ 21 | @property (copy, nonatomic) NSString *name; 22 | /** key的种类,可能是@"10",可能是@"age" */ 23 | @property (assign, nonatomic) MJPropertyKeyType type; 24 | 25 | /** 26 | * 根据当前的key,也就是name,从object(字典或者数组)中取值 27 | */ 28 | - (id)valueInObject:(id)object; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/MJPropertyKey.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyKey.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJPropertyKey.h" 10 | 11 | @implementation MJPropertyKey 12 | 13 | - (id)valueInObject:(id)object 14 | { 15 | if ([object isKindOfClass:[NSDictionary class]] && self.type == MJPropertyKeyTypeDictionary) { 16 | return object[self.name]; 17 | } else if ([object isKindOfClass:[NSArray class]] && self.type == MJPropertyKeyTypeArray) { 18 | NSArray *array = object; 19 | NSUInteger index = self.name.intValue; 20 | if (index < array.count) return array[index]; 21 | return nil; 22 | } 23 | return nil; 24 | } 25 | @end 26 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/MJPropertyType.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyType.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 包装一种类型 8 | 9 | #import 10 | 11 | /** 12 | * 包装一种类型 13 | */ 14 | @interface MJPropertyType : NSObject 15 | /** 类型标识符 */ 16 | @property (nonatomic, copy) NSString *code; 17 | 18 | /** 是否为id类型 */ 19 | @property (nonatomic, readonly, getter=isIdType) BOOL idType; 20 | 21 | /** 是否为基本数字类型:int、float等 */ 22 | @property (nonatomic, readonly, getter=isNumberType) BOOL numberType; 23 | 24 | /** 是否为BOOL类型 */ 25 | @property (nonatomic, readonly, getter=isBoolType) BOOL boolType; 26 | 27 | /** 对象类型(如果是基本数据类型,此值为nil) */ 28 | @property (nonatomic, readonly) Class typeClass; 29 | 30 | /** 类型是否来自于Foundation框架,比如NSString、NSArray */ 31 | @property (nonatomic, readonly, getter = isFromFoundation) BOOL fromFoundation; 32 | /** 类型是否不支持KVC */ 33 | @property (nonatomic, readonly, getter = isKVCDisabled) BOOL KVCDisabled; 34 | 35 | /** 36 | * 获得缓存的类型对象 37 | */ 38 | + (instancetype)cachedTypeWithCode:(NSString *)code; 39 | @end -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/MJPropertyType.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyType.m 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJPropertyType.h" 10 | #import "MJExtension.h" 11 | #import "MJFoundation.h" 12 | #import "MJExtensionConst.h" 13 | 14 | @implementation MJPropertyType 15 | 16 | + (instancetype)cachedTypeWithCode:(NSString *)code 17 | { 18 | MJExtensionAssertParamNotNil2(code, nil); 19 | 20 | static NSMutableDictionary *types; 21 | static dispatch_once_t onceToken; 22 | dispatch_once(&onceToken, ^{ 23 | types = [NSMutableDictionary dictionary]; 24 | }); 25 | 26 | MJPropertyType *type = types[code]; 27 | if (type == nil) { 28 | type = [[self alloc] init]; 29 | type.code = code; 30 | types[code] = type; 31 | } 32 | return type; 33 | } 34 | 35 | #pragma mark - 公共方法 36 | - (void)setCode:(NSString *)code 37 | { 38 | _code = code; 39 | 40 | MJExtensionAssertParamNotNil(code); 41 | 42 | if ([code isEqualToString:MJPropertyTypeId]) { 43 | _idType = YES; 44 | } else if (code.length == 0) { 45 | _KVCDisabled = YES; 46 | } else if (code.length > 3 && [code hasPrefix:@"@\""]) { 47 | // 去掉@"和",截取中间的类型名称 48 | _code = [code substringWithRange:NSMakeRange(2, code.length - 3)]; 49 | _typeClass = NSClassFromString(_code); 50 | _fromFoundation = [MJFoundation isClassFromFoundation:_typeClass]; 51 | _numberType = [_typeClass isSubclassOfClass:[NSNumber class]]; 52 | 53 | } else if ([code isEqualToString:MJPropertyTypeSEL] || 54 | [code isEqualToString:MJPropertyTypeIvar] || 55 | [code isEqualToString:MJPropertyTypeMethod]) { 56 | _KVCDisabled = YES; 57 | } 58 | 59 | // 是否为数字类型 60 | NSString *lowerCode = _code.lowercaseString; 61 | NSArray *numberTypes = @[MJPropertyTypeInt, MJPropertyTypeShort, MJPropertyTypeBOOL1, MJPropertyTypeBOOL2, MJPropertyTypeFloat, MJPropertyTypeDouble, MJPropertyTypeLong, MJPropertyTypeLongLong, MJPropertyTypeChar]; 62 | if ([numberTypes containsObject:lowerCode]) { 63 | _numberType = YES; 64 | 65 | if ([lowerCode isEqualToString:MJPropertyTypeBOOL1] 66 | || [lowerCode isEqualToString:MJPropertyTypeBOOL2]) { 67 | _boolType = YES; 68 | } 69 | } 70 | } 71 | @end 72 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/NSObject+MJClass.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJClass.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 遍历所有类的block(父类) 13 | */ 14 | typedef void (^MJClassesEnumeration)(Class c, BOOL *stop); 15 | 16 | /** 这个数组中的属性名才会进行字典和模型的转换 */ 17 | typedef NSArray * (^MJAllowedPropertyNames)(void); 18 | /** 这个数组中的属性名才会进行归档 */ 19 | typedef NSArray * (^MJAllowedCodingPropertyNames)(void); 20 | 21 | /** 这个数组中的属性名将会被忽略:不进行字典和模型的转换 */ 22 | typedef NSArray * (^MJIgnoredPropertyNames)(void); 23 | /** 这个数组中的属性名将会被忽略:不进行归档 */ 24 | typedef NSArray * (^MJIgnoredCodingPropertyNames)(void); 25 | 26 | /** 27 | * 类相关的扩展 28 | */ 29 | @interface NSObject (MJClass) 30 | /** 31 | * 遍历所有的类 32 | */ 33 | + (void)mj_enumerateClasses:(MJClassesEnumeration)enumeration; 34 | + (void)mj_enumerateAllClasses:(MJClassesEnumeration)enumeration; 35 | 36 | #pragma mark - 属性白名单配置 37 | /** 38 | * 这个数组中的属性名才会进行字典和模型的转换 39 | * 40 | * @param allowedPropertyNames 这个数组中的属性名才会进行字典和模型的转换 41 | */ 42 | + (void)mj_setupAllowedPropertyNames:(MJAllowedPropertyNames)allowedPropertyNames; 43 | 44 | /** 45 | * 这个数组中的属性名才会进行字典和模型的转换 46 | */ 47 | + (NSMutableArray *)mj_totalAllowedPropertyNames; 48 | 49 | #pragma mark - 属性黑名单配置 50 | /** 51 | * 这个数组中的属性名将会被忽略:不进行字典和模型的转换 52 | * 53 | * @param ignoredPropertyNames 这个数组中的属性名将会被忽略:不进行字典和模型的转换 54 | */ 55 | + (void)mj_setupIgnoredPropertyNames:(MJIgnoredPropertyNames)ignoredPropertyNames; 56 | 57 | /** 58 | * 这个数组中的属性名将会被忽略:不进行字典和模型的转换 59 | */ 60 | + (NSMutableArray *)mj_totalIgnoredPropertyNames; 61 | 62 | #pragma mark - 归档属性白名单配置 63 | /** 64 | * 这个数组中的属性名才会进行归档 65 | * 66 | * @param allowedCodingPropertyNames 这个数组中的属性名才会进行归档 67 | */ 68 | + (void)mj_setupAllowedCodingPropertyNames:(MJAllowedCodingPropertyNames)allowedCodingPropertyNames; 69 | 70 | /** 71 | * 这个数组中的属性名才会进行字典和模型的转换 72 | */ 73 | + (NSMutableArray *)mj_totalAllowedCodingPropertyNames; 74 | 75 | #pragma mark - 归档属性黑名单配置 76 | /** 77 | * 这个数组中的属性名将会被忽略:不进行归档 78 | * 79 | * @param ignoredCodingPropertyNames 这个数组中的属性名将会被忽略:不进行归档 80 | */ 81 | + (void)mj_setupIgnoredCodingPropertyNames:(MJIgnoredCodingPropertyNames)ignoredCodingPropertyNames; 82 | 83 | /** 84 | * 这个数组中的属性名将会被忽略:不进行归档 85 | */ 86 | + (NSMutableArray *)mj_totalIgnoredCodingPropertyNames; 87 | 88 | #pragma mark - 内部使用 89 | + (void)mj_setupBlockReturnValue:(id (^)(void))block key:(const char *)key; 90 | @end 91 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/NSObject+MJCoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJCoding.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | /** 13 | * Codeing协议 14 | */ 15 | @protocol MJCoding 16 | @optional 17 | /** 18 | * 这个数组中的属性名才会进行归档 19 | */ 20 | + (NSArray *)mj_allowedCodingPropertyNames; 21 | /** 22 | * 这个数组中的属性名将会被忽略:不进行归档 23 | */ 24 | + (NSArray *)mj_ignoredCodingPropertyNames; 25 | @end 26 | 27 | @interface NSObject (MJCoding) 28 | /** 29 | * 解码(从文件中解析对象) 30 | */ 31 | - (void)mj_decode:(NSCoder *)decoder; 32 | /** 33 | * 编码(将对象写入文件中) 34 | */ 35 | - (void)mj_encode:(NSCoder *)encoder; 36 | @end 37 | 38 | /** 39 | 归档的实现 40 | */ 41 | #define MJCodingImplementation \ 42 | - (id)initWithCoder:(NSCoder *)decoder \ 43 | { \ 44 | if (self = [super init]) { \ 45 | [self mj_decode:decoder]; \ 46 | } \ 47 | return self; \ 48 | } \ 49 | \ 50 | - (void)encodeWithCoder:(NSCoder *)encoder \ 51 | { \ 52 | [self mj_encode:encoder]; \ 53 | }\ 54 | 55 | #define MJExtensionCodingImplementation MJCodingImplementation 56 | 57 | #define MJSecureCodingImplementation(CLASS, FLAG) \ 58 | @interface CLASS (MJSecureCoding) \ 59 | @end \ 60 | @implementation CLASS (MJSecureCoding) \ 61 | MJCodingImplementation \ 62 | + (BOOL)supportsSecureCoding { \ 63 | return FLAG; \ 64 | } \ 65 | @end \ 66 | 67 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/NSObject+MJCoding.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJCoding.m 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSObject+MJCoding.h" 10 | #import "NSObject+MJClass.h" 11 | #import "NSObject+MJProperty.h" 12 | #import "MJProperty.h" 13 | 14 | @implementation NSObject (MJCoding) 15 | 16 | - (void)mj_encode:(NSCoder *)encoder 17 | { 18 | Class clazz = [self class]; 19 | 20 | NSArray *allowedCodingPropertyNames = [clazz mj_totalAllowedCodingPropertyNames]; 21 | NSArray *ignoredCodingPropertyNames = [clazz mj_totalIgnoredCodingPropertyNames]; 22 | 23 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 24 | // 检测是否被忽略 25 | if (allowedCodingPropertyNames.count && ![allowedCodingPropertyNames containsObject:property.name]) return; 26 | if ([ignoredCodingPropertyNames containsObject:property.name]) return; 27 | 28 | id value = [property valueForObject:self]; 29 | if (value == nil) return; 30 | [encoder encodeObject:value forKey:property.name]; 31 | }]; 32 | } 33 | 34 | - (void)mj_decode:(NSCoder *)decoder 35 | { 36 | Class clazz = [self class]; 37 | 38 | NSArray *allowedCodingPropertyNames = [clazz mj_totalAllowedCodingPropertyNames]; 39 | NSArray *ignoredCodingPropertyNames = [clazz mj_totalIgnoredCodingPropertyNames]; 40 | 41 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 42 | // 检测是否被忽略 43 | if (allowedCodingPropertyNames.count && ![allowedCodingPropertyNames containsObject:property.name]) return; 44 | if ([ignoredCodingPropertyNames containsObject:property.name]) return; 45 | 46 | // fixed `-[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSNumber'(This will be disallowed in the future.)` warning. 47 | Class genericClass = [property objectClassInArrayForClass:property.srcClass]; 48 | // If genericClass exists, property.type.typeClass would be a collection type(Array, Set, Dictionary). This scenario([obj, nil, obj, nil]) would not happened. 49 | NSSet *classes = [NSSet setWithObjects:NSNumber.class, 50 | property.type.typeClass, genericClass, nil]; 51 | id value = [decoder decodeObjectOfClasses:classes forKey:property.name]; 52 | if (value == nil) { // 兼容以前的MJExtension版本 53 | value = [decoder decodeObjectForKey:[@"_" stringByAppendingString:property.name]]; 54 | } 55 | if (value == nil) return; 56 | [property setValue:value forObject:self]; 57 | }]; 58 | } 59 | @end 60 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/NSObject+MJProperty.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJProperty.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/4/17. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | @class MJProperty; 13 | 14 | /** 15 | * 遍历成员变量用的block 16 | * 17 | * @param property 成员的包装对象 18 | * @param stop YES代表停止遍历,NO代表继续遍历 19 | */ 20 | typedef void (^MJPropertiesEnumeration)(MJProperty *property, BOOL *stop); 21 | 22 | /** 将属性名换为其他key去字典中取值 */ 23 | typedef NSDictionary * (^MJReplacedKeyFromPropertyName)(void); 24 | typedef id (^MJReplacedKeyFromPropertyName121)(NSString *propertyName); 25 | /** 数组中需要转换的模型类 */ 26 | typedef NSDictionary * (^MJObjectClassInArray)(void); 27 | /** 用于过滤字典中的值 */ 28 | typedef id (^MJNewValueFromOldValue)(id object, id oldValue, MJProperty *property); 29 | 30 | /** 31 | * 成员属性相关的扩展 32 | */ 33 | @interface NSObject (MJProperty) 34 | #pragma mark - 遍历 35 | /** 36 | * 遍历所有的成员 37 | */ 38 | + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration; 39 | 40 | #pragma mark - 新值配置 41 | /** 42 | * 用于过滤字典中的值 43 | * 44 | * @param newValueFormOldValue 用于过滤字典中的值 45 | */ 46 | + (void)mj_setupNewValueFromOldValue:(MJNewValueFromOldValue)newValueFormOldValue; 47 | + (id)mj_getNewValueFromObject:(__unsafe_unretained id)object oldValue:(__unsafe_unretained id)oldValue property:(__unsafe_unretained MJProperty *)property; 48 | 49 | #pragma mark - key配置 50 | /** 51 | * 将属性名换为其他key去字典中取值 52 | * 53 | * @param replacedKeyFromPropertyName 将属性名换为其他key去字典中取值 54 | */ 55 | + (void)mj_setupReplacedKeyFromPropertyName:(MJReplacedKeyFromPropertyName)replacedKeyFromPropertyName; 56 | /** 57 | * 将属性名换为其他key去字典中取值 58 | * 59 | * @param replacedKeyFromPropertyName121 将属性名换为其他key去字典中取值 60 | */ 61 | + (void)mj_setupReplacedKeyFromPropertyName121:(MJReplacedKeyFromPropertyName121)replacedKeyFromPropertyName121; 62 | 63 | #pragma mark - array model class配置 64 | /** 65 | * 数组中需要转换的模型类 66 | * 67 | * @param objectClassInArray 数组中需要转换的模型类 68 | */ 69 | + (void)mj_setupObjectClassInArray:(MJObjectClassInArray)objectClassInArray; 70 | @end 71 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/NSString+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MJExtension.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/6/7. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | @interface NSString (MJExtension) 13 | /** 14 | * 驼峰转下划线(loveYou -> love_you) 15 | */ 16 | - (NSString *)mj_underlineFromCamel; 17 | /** 18 | * 下划线转驼峰(love_you -> loveYou) 19 | */ 20 | - (NSString *)mj_camelFromUnderline; 21 | /** 22 | * 首字母变大写 23 | */ 24 | - (NSString *)mj_firstCharUpper; 25 | /** 26 | * 首字母变小写 27 | */ 28 | - (NSString *)mj_firstCharLower; 29 | 30 | - (BOOL)mj_isPureInt; 31 | 32 | - (NSURL *)mj_url; 33 | @end 34 | -------------------------------------------------------------------------------- /Example/Pods/MJExtension/MJExtension/NSString+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MJExtension.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/6/7. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSString+MJExtension.h" 10 | 11 | @implementation NSString (MJExtension) 12 | - (NSString *)mj_underlineFromCamel 13 | { 14 | if (self.length == 0) return self; 15 | NSMutableString *string = [NSMutableString string]; 16 | for (NSUInteger i = 0; i= 2) [string appendString:[cmp substringFromIndex:1]]; 40 | } else { 41 | [string appendString:cmp]; 42 | } 43 | } 44 | return string; 45 | } 46 | 47 | - (NSString *)mj_firstCharLower 48 | { 49 | if (self.length == 0) return self; 50 | NSMutableString *string = [NSMutableString string]; 51 | [string appendString:[NSString stringWithFormat:@"%c", [self characterAtIndex:0]].lowercaseString]; 52 | if (self.length >= 2) [string appendString:[self substringFromIndex:1]]; 53 | return string; 54 | } 55 | 56 | - (NSString *)mj_firstCharUpper 57 | { 58 | if (self.length == 0) return self; 59 | NSMutableString *string = [NSMutableString string]; 60 | [string appendString:[NSString stringWithFormat:@"%c", [self characterAtIndex:0]].uppercaseString]; 61 | if (self.length >= 2) [string appendString:[self substringFromIndex:1]]; 62 | return string; 63 | } 64 | 65 | - (BOOL)mj_isPureInt 66 | { 67 | NSScanner *scan = [NSScanner scannerWithString:self]; 68 | int val; 69 | return [scan scanInt:&val] && [scan isAtEnd]; 70 | } 71 | 72 | - (NSURL *)mj_url 73 | { 74 | // [self stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"!$&'()*+,-./:;=?@_~%#[]"]]; 75 | #pragma clang diagnostic push 76 | #pragma clang diagnostic ignored"-Wdeprecated-declarations" 77 | return [NSURL URLWithString:(NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)self, (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]", NULL,kCFStringEncodingUTF8))]; 78 | #pragma clang diagnostic pop 79 | } 80 | @end 81 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MJExtension (3.4.1) 3 | - SDWebImage (5.13.2): 4 | - SDWebImage/Core (= 5.13.2) 5 | - SDWebImage/Core (5.13.2) 6 | - XMultiTabModule-iOS (0.1.0): 7 | - SDWebImage 8 | 9 | DEPENDENCIES: 10 | - MJExtension 11 | - XMultiTabModule-iOS (from `../`) 12 | 13 | SPEC REPOS: 14 | trunk: 15 | - MJExtension 16 | - SDWebImage 17 | 18 | EXTERNAL SOURCES: 19 | XMultiTabModule-iOS: 20 | :path: "../" 21 | 22 | SPEC CHECKSUMS: 23 | MJExtension: 21c5f6f8c4d5d8844b7ae8fbae08fed0b501f961 24 | SDWebImage: 72f86271a6f3139cc7e4a89220946489d4b9a866 25 | XMultiTabModule-iOS: 4199cb26b13c23393d4f80a4a2523d0140a360ea 26 | 27 | PODFILE CHECKSUM: c35da12977f8aca0c076af81b308b7306a0b45e2 28 | 29 | COCOAPODS: 1.8.3 30 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2020 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 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/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 | /** 14 | You can use switch case like normal enum. It's also recommended to add a default case. You should not assume anything about the raw value. 15 | For custom coder plugin, it can also extern the enum for supported format. See `SDImageCoder` for more detailed information. 16 | */ 17 | typedef NSInteger SDImageFormat NS_TYPED_EXTENSIBLE_ENUM; 18 | static const SDImageFormat SDImageFormatUndefined = -1; 19 | static const SDImageFormat SDImageFormatJPEG = 0; 20 | static const SDImageFormat SDImageFormatPNG = 1; 21 | static const SDImageFormat SDImageFormatGIF = 2; 22 | static const SDImageFormat SDImageFormatTIFF = 3; 23 | static const SDImageFormat SDImageFormatWebP = 4; 24 | static const SDImageFormat SDImageFormatHEIC = 5; 25 | static const SDImageFormat SDImageFormatHEIF = 6; 26 | static const SDImageFormat SDImageFormatPDF = 7; 27 | static const SDImageFormat SDImageFormatSVG = 8; 28 | 29 | /** 30 | NSData category about the image content type and UTI. 31 | */ 32 | @interface NSData (ImageContentType) 33 | 34 | /** 35 | * Return image format 36 | * 37 | * @param data the input image data 38 | * 39 | * @return the image format as `SDImageFormat` (enum) 40 | */ 41 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data; 42 | 43 | /** 44 | * Convert SDImageFormat to UTType 45 | * 46 | * @param format Format as SDImageFormat 47 | * @return The UTType as CFStringRef 48 | * @note For unknown format, `kSDUTTypeImage` abstract type will return 49 | */ 50 | + (nonnull CFStringRef)sd_UTTypeFromImageFormat:(SDImageFormat)format CF_RETURNS_NOT_RETAINED NS_SWIFT_NAME(sd_UTType(from:)); 51 | 52 | /** 53 | * Convert UTType to SDImageFormat 54 | * 55 | * @param uttype The UTType as CFStringRef 56 | * @return The Format as SDImageFormat 57 | * @note For unknown type, `SDImageFormatUndefined` will return 58 | */ 59 | + (SDImageFormat)sd_imageFormatFromUTType:(nonnull CFStringRef)uttype; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/NSImage+Compatibility.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 | /** 14 | This category is provided to easily write cross-platform(AppKit/UIKit) code. For common usage, see `UIImage+Metadata.h`. 15 | */ 16 | @interface NSImage (Compatibility) 17 | 18 | /** 19 | The underlying Core Graphics image object. This will actually use `CGImageForProposedRect` with the image size. 20 | */ 21 | @property (nonatomic, readonly, nullable) CGImageRef CGImage; 22 | /** 23 | The underlying Core Image data. This will actually use `bestRepresentationForRect` with the image size to find the `NSCIImageRep`. 24 | */ 25 | @property (nonatomic, readonly, nullable) CIImage *CIImage; 26 | /** 27 | The scale factor of the image. This wil actually use `bestRepresentationForRect` with image size and pixel size to calculate the scale factor. If failed, use the default value 1.0. Should be greater than or equal to 1.0. 28 | */ 29 | @property (nonatomic, readonly) CGFloat scale; 30 | 31 | // These are convenience methods to make AppKit's `NSImage` match UIKit's `UIImage` behavior. The scale factor should be greater than or equal to 1.0. 32 | 33 | /** 34 | Returns an image object with the scale factor and orientation. The representation is created from the Core Graphics image object. 35 | @note The difference between this and `initWithCGImage:size` is that `initWithCGImage:size` will actually create a `NSCGImageSnapshotRep` representation and always use `backingScaleFactor` as scale factor. So we should avoid it and use `NSBitmapImageRep` with `initWithCGImage:` instead. 36 | @note The difference between this and UIKit's `UIImage` equivalent method is the way to process orientation. If the provided image orientation is not equal to Up orientation, this method will firstly rotate the CGImage to the correct orientation to work compatible with `NSImageView`. However, UIKit will not actually rotate CGImage and just store it as `imageOrientation` property. 37 | 38 | @param cgImage A Core Graphics image object 39 | @param scale The image scale factor 40 | @param orientation The orientation of the image data 41 | @return The image object 42 | */ 43 | - (nonnull instancetype)initWithCGImage:(nonnull CGImageRef)cgImage scale:(CGFloat)scale orientation:(CGImagePropertyOrientation)orientation; 44 | 45 | /** 46 | Initializes and returns an image object with the specified Core Image object. The representation is `NSCIImageRep`. 47 | 48 | @param ciImage A Core Image image object 49 | @param scale The image scale factor 50 | @param orientation The orientation of the image data 51 | @return The image object 52 | */ 53 | - (nonnull instancetype)initWithCIImage:(nonnull CIImage *)ciImage scale:(CGFloat)scale orientation:(CGImagePropertyOrientation)orientation; 54 | 55 | /** 56 | Returns an image object with the scale factor. The representation is created from the image data. 57 | @note The difference between these this and `initWithData:` is that `initWithData:` will always use `backingScaleFactor` as scale factor. 58 | 59 | @param data The image data 60 | @param scale The image scale factor 61 | @return The image object 62 | */ 63 | - (nullable instancetype)initWithData:(nonnull NSData *)data scale:(CGFloat)scale; 64 | 65 | @end 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | /** 14 | A subclass of `NSBitmapImageRep` to fix that GIF duration issue because `NSBitmapImageRep` will reset `NSImageCurrentFrameDuration` by using `kCGImagePropertyGIFDelayTime` but not `kCGImagePropertyGIFUnclampedDelayTime`. 15 | This also fix the GIF loop count issue, which will use the Netscape standard (See http://www6.uniovi.es/gifanim/gifabout.htm) to only place once when the `kCGImagePropertyGIFLoopCount` is nil. This is what modern browser's behavior. 16 | Built in GIF coder use this instead of `NSBitmapImageRep` for better GIF rendering. If you do not want this, only enable `SDImageIOCoder`, which just call `NSImage` API and actually use `NSBitmapImageRep` for GIF image. 17 | This also support APNG format using `SDImageAPNGCoder`. Which provide full alpha-channel support and the correct duration match the `kCGImagePropertyAPNGUnclampedDelayTime`. 18 | */ 19 | @interface SDAnimatedImageRep : NSBitmapImageRep 20 | 21 | @end 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageAPNGCoder.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 "SDImageIOAnimatedCoder.h" 11 | 12 | /** 13 | Built in coder using ImageIO that supports APNG encoding/decoding 14 | */ 15 | @interface SDImageAPNGCoder : SDImageIOAnimatedCoder 16 | 17 | @property (nonatomic, class, readonly, nonnull) SDImageAPNGCoder *sharedCoder; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageAPNGCoder.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 "SDImageAPNGCoder.h" 10 | #import "SDImageIOAnimatedCoderInternal.h" 11 | #if SD_MAC 12 | #import 13 | #else 14 | #import 15 | #endif 16 | 17 | @implementation SDImageAPNGCoder 18 | 19 | + (instancetype)sharedCoder { 20 | static SDImageAPNGCoder *coder; 21 | static dispatch_once_t onceToken; 22 | dispatch_once(&onceToken, ^{ 23 | coder = [[SDImageAPNGCoder alloc] init]; 24 | }); 25 | return coder; 26 | } 27 | 28 | #pragma mark - Subclass Override 29 | 30 | + (SDImageFormat)imageFormat { 31 | return SDImageFormatPNG; 32 | } 33 | 34 | + (NSString *)imageUTType { 35 | return (__bridge NSString *)kSDUTTypePNG; 36 | } 37 | 38 | + (NSString *)dictionaryProperty { 39 | return (__bridge NSString *)kCGImagePropertyPNGDictionary; 40 | } 41 | 42 | + (NSString *)unclampedDelayTimeProperty { 43 | return (__bridge NSString *)kCGImagePropertyAPNGUnclampedDelayTime; 44 | } 45 | 46 | + (NSString *)delayTimeProperty { 47 | return (__bridge NSString *)kCGImagePropertyAPNGDelayTime; 48 | } 49 | 50 | + (NSString *)loopCountProperty { 51 | return (__bridge NSString *)kCGImagePropertyAPNGLoopCount; 52 | } 53 | 54 | + (NSUInteger)defaultLoopCount { 55 | return 0; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageAWebPCoder.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 "SDImageIOAnimatedCoder.h" 11 | 12 | /** 13 | This coder is used for Google WebP and Animated WebP(AWebP) image format. 14 | Image/IO provide the WebP decoding support in iOS 14/macOS 11/tvOS 14/watchOS 7+. 15 | @note Currently Image/IO seems does not supports WebP encoding, if you need WebP encoding, use the custom codec below. 16 | @note If you need to support lower firmware version for WebP, you can have a try at https://github.com/SDWebImage/SDWebImageWebPCoder 17 | */ 18 | API_AVAILABLE(ios(14.0), tvos(14.0), macos(11.0), watchos(7.0)) 19 | @interface SDImageAWebPCoder : SDImageIOAnimatedCoder 20 | 21 | @property (nonatomic, class, readonly, nonnull) SDImageAWebPCoder *sharedCoder; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageAWebPCoder.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 "SDImageAWebPCoder.h" 10 | #import "SDImageIOAnimatedCoderInternal.h" 11 | 12 | // These constants are available from iOS 14+ and Xcode 12. This raw value is used for toolchain and firmware compatibility 13 | static NSString * kSDCGImagePropertyWebPDictionary = @"{WebP}"; 14 | static NSString * kSDCGImagePropertyWebPLoopCount = @"LoopCount"; 15 | static NSString * kSDCGImagePropertyWebPDelayTime = @"DelayTime"; 16 | static NSString * kSDCGImagePropertyWebPUnclampedDelayTime = @"UnclampedDelayTime"; 17 | 18 | @implementation SDImageAWebPCoder 19 | 20 | + (void)initialize { 21 | #if __IPHONE_14_0 || __TVOS_14_0 || __MAC_11_0 || __WATCHOS_7_0 22 | // Xcode 12 23 | if (@available(iOS 14, tvOS 14, macOS 11, watchOS 7, *)) { 24 | // Use SDK instead of raw value 25 | kSDCGImagePropertyWebPDictionary = (__bridge NSString *)kCGImagePropertyWebPDictionary; 26 | kSDCGImagePropertyWebPLoopCount = (__bridge NSString *)kCGImagePropertyWebPLoopCount; 27 | kSDCGImagePropertyWebPDelayTime = (__bridge NSString *)kCGImagePropertyWebPDelayTime; 28 | kSDCGImagePropertyWebPUnclampedDelayTime = (__bridge NSString *)kCGImagePropertyWebPUnclampedDelayTime; 29 | } 30 | #endif 31 | } 32 | 33 | + (instancetype)sharedCoder { 34 | static SDImageAWebPCoder *coder; 35 | static dispatch_once_t onceToken; 36 | dispatch_once(&onceToken, ^{ 37 | coder = [[SDImageAWebPCoder alloc] init]; 38 | }); 39 | return coder; 40 | } 41 | 42 | #pragma mark - SDImageCoder 43 | 44 | - (BOOL)canDecodeFromData:(nullable NSData *)data { 45 | switch ([NSData sd_imageFormatForImageData:data]) { 46 | case SDImageFormatWebP: 47 | // Check WebP decoding compatibility 48 | return [self.class canDecodeFromFormat:SDImageFormatWebP]; 49 | default: 50 | return NO; 51 | } 52 | } 53 | 54 | - (BOOL)canIncrementalDecodeFromData:(NSData *)data { 55 | return [self canDecodeFromData:data]; 56 | } 57 | 58 | - (BOOL)canEncodeToFormat:(SDImageFormat)format { 59 | switch (format) { 60 | case SDImageFormatWebP: 61 | // Check WebP encoding compatibility 62 | return [self.class canEncodeToFormat:SDImageFormatWebP]; 63 | default: 64 | return NO; 65 | } 66 | } 67 | 68 | #pragma mark - Subclass Override 69 | 70 | + (SDImageFormat)imageFormat { 71 | return SDImageFormatWebP; 72 | } 73 | 74 | + (NSString *)imageUTType { 75 | return (__bridge NSString *)kSDUTTypeWebP; 76 | } 77 | 78 | + (NSString *)dictionaryProperty { 79 | return kSDCGImagePropertyWebPDictionary; 80 | } 81 | 82 | + (NSString *)unclampedDelayTimeProperty { 83 | return kSDCGImagePropertyWebPUnclampedDelayTime; 84 | } 85 | 86 | + (NSString *)delayTimeProperty { 87 | return kSDCGImagePropertyWebPDelayTime; 88 | } 89 | 90 | + (NSString *)loopCountProperty { 91 | return kSDCGImagePropertyWebPLoopCount; 92 | } 93 | 94 | + (NSUInteger)defaultLoopCount { 95 | return 0; 96 | } 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageCacheConfig.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageCacheConfig.h" 10 | #import "SDMemoryCache.h" 11 | #import "SDDiskCache.h" 12 | 13 | static SDImageCacheConfig *_defaultCacheConfig; 14 | static const NSInteger kDefaultCacheMaxDiskAge = 60 * 60 * 24 * 7; // 1 week 15 | 16 | @implementation SDImageCacheConfig 17 | 18 | + (SDImageCacheConfig *)defaultCacheConfig { 19 | static dispatch_once_t onceToken; 20 | dispatch_once(&onceToken, ^{ 21 | _defaultCacheConfig = [SDImageCacheConfig new]; 22 | }); 23 | return _defaultCacheConfig; 24 | } 25 | 26 | - (instancetype)init { 27 | if (self = [super init]) { 28 | _shouldDisableiCloud = YES; 29 | _shouldCacheImagesInMemory = YES; 30 | _shouldUseWeakMemoryCache = NO; 31 | _shouldRemoveExpiredDataWhenEnterBackground = YES; 32 | _shouldRemoveExpiredDataWhenTerminate = YES; 33 | _diskCacheReadingOptions = 0; 34 | _diskCacheWritingOptions = NSDataWritingAtomic; 35 | _maxDiskAge = kDefaultCacheMaxDiskAge; 36 | _maxDiskSize = 0; 37 | _diskCacheExpireType = SDImageCacheConfigExpireTypeModificationDate; 38 | _memoryCacheClass = [SDMemoryCache class]; 39 | _diskCacheClass = [SDDiskCache class]; 40 | } 41 | return self; 42 | } 43 | 44 | - (id)copyWithZone:(NSZone *)zone { 45 | SDImageCacheConfig *config = [[[self class] allocWithZone:zone] init]; 46 | config.shouldDisableiCloud = self.shouldDisableiCloud; 47 | config.shouldCacheImagesInMemory = self.shouldCacheImagesInMemory; 48 | config.shouldUseWeakMemoryCache = self.shouldUseWeakMemoryCache; 49 | config.shouldRemoveExpiredDataWhenEnterBackground = self.shouldRemoveExpiredDataWhenEnterBackground; 50 | config.shouldRemoveExpiredDataWhenTerminate = self.shouldRemoveExpiredDataWhenTerminate; 51 | config.diskCacheReadingOptions = self.diskCacheReadingOptions; 52 | config.diskCacheWritingOptions = self.diskCacheWritingOptions; 53 | config.maxDiskAge = self.maxDiskAge; 54 | config.maxDiskSize = self.maxDiskSize; 55 | config.maxMemoryCost = self.maxMemoryCost; 56 | config.maxMemoryCount = self.maxMemoryCount; 57 | config.diskCacheExpireType = self.diskCacheExpireType; 58 | config.fileManager = self.fileManager; // NSFileManager does not conform to NSCopying, just pass the reference 59 | config.memoryCacheClass = self.memoryCacheClass; 60 | config.diskCacheClass = self.diskCacheClass; 61 | 62 | return config; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageCachesManager.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 "SDImageCacheDefine.h" 11 | 12 | /// Policy for cache operation 13 | typedef NS_ENUM(NSUInteger, SDImageCachesManagerOperationPolicy) { 14 | SDImageCachesManagerOperationPolicySerial, // process all caches serially (from the highest priority to the lowest priority cache by order) 15 | SDImageCachesManagerOperationPolicyConcurrent, // process all caches concurrently 16 | SDImageCachesManagerOperationPolicyHighestOnly, // process the highest priority cache only 17 | SDImageCachesManagerOperationPolicyLowestOnly // process the lowest priority cache only 18 | }; 19 | 20 | /** 21 | A caches manager to manage multiple caches. 22 | */ 23 | @interface SDImageCachesManager : NSObject 24 | 25 | /** 26 | Returns the global shared caches manager instance. By default we will set [`SDImageCache.sharedImageCache`] into the caches array. 27 | */ 28 | @property (nonatomic, class, readonly, nonnull) SDImageCachesManager *sharedManager; 29 | 30 | // These are op policy for cache manager. 31 | 32 | /** 33 | Operation policy for query op. 34 | Defaults to `Serial`, means query all caches serially (one completion called then next begin) until one cache query success (`image` != nil). 35 | */ 36 | @property (nonatomic, assign) SDImageCachesManagerOperationPolicy queryOperationPolicy; 37 | 38 | /** 39 | Operation policy for store op. 40 | Defaults to `HighestOnly`, means store to the highest priority cache only. 41 | */ 42 | @property (nonatomic, assign) SDImageCachesManagerOperationPolicy storeOperationPolicy; 43 | 44 | /** 45 | Operation policy for remove op. 46 | Defaults to `Concurrent`, means remove all caches concurrently. 47 | */ 48 | @property (nonatomic, assign) SDImageCachesManagerOperationPolicy removeOperationPolicy; 49 | 50 | /** 51 | Operation policy for contains op. 52 | Defaults to `Serial`, means check all caches serially (one completion called then next begin) until one cache check success (`containsCacheType` != None). 53 | */ 54 | @property (nonatomic, assign) SDImageCachesManagerOperationPolicy containsOperationPolicy; 55 | 56 | /** 57 | Operation policy for clear op. 58 | Defaults to `Concurrent`, means clear all caches concurrently. 59 | */ 60 | @property (nonatomic, assign) SDImageCachesManagerOperationPolicy clearOperationPolicy; 61 | 62 | /** 63 | All caches in caches manager. The caches array is a priority queue, which means the later added cache will have the highest priority 64 | */ 65 | @property (nonatomic, copy, nullable) NSArray> *caches; 66 | 67 | /** 68 | Add a new cache to the end of caches array. Which has the highest priority. 69 | 70 | @param cache cache 71 | */ 72 | - (void)addCache:(nonnull id)cache; 73 | 74 | /** 75 | Remove a cache in the caches array. 76 | 77 | @param cache cache 78 | */ 79 | - (void)removeCache:(nonnull id)cache; 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageCoder.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 "SDImageCoder.h" 10 | 11 | SDImageCoderOption const SDImageCoderDecodeFirstFrameOnly = @"decodeFirstFrameOnly"; 12 | SDImageCoderOption const SDImageCoderDecodeScaleFactor = @"decodeScaleFactor"; 13 | SDImageCoderOption const SDImageCoderDecodePreserveAspectRatio = @"decodePreserveAspectRatio"; 14 | SDImageCoderOption const SDImageCoderDecodeThumbnailPixelSize = @"decodeThumbnailPixelSize"; 15 | 16 | SDImageCoderOption const SDImageCoderEncodeFirstFrameOnly = @"encodeFirstFrameOnly"; 17 | SDImageCoderOption const SDImageCoderEncodeCompressionQuality = @"encodeCompressionQuality"; 18 | SDImageCoderOption const SDImageCoderEncodeBackgroundColor = @"encodeBackgroundColor"; 19 | SDImageCoderOption const SDImageCoderEncodeMaxPixelSize = @"encodeMaxPixelSize"; 20 | SDImageCoderOption const SDImageCoderEncodeMaxFileSize = @"encodeMaxFileSize"; 21 | SDImageCoderOption const SDImageCoderEncodeEmbedThumbnail = @"encodeEmbedThumbnail"; 22 | 23 | SDImageCoderOption const SDImageCoderWebImageContext = @"webImageContext"; 24 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageCodersManager.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 "SDImageCoder.h" 11 | 12 | /** 13 | Global object holding the array of coders, so that we avoid passing them from object to object. 14 | Uses a priority queue behind scenes, which means the latest added coders have the highest priority. 15 | This is done so when encoding/decoding something, we go through the list and ask each coder if they can handle the current data. 16 | That way, users can add their custom coders while preserving our existing prebuilt ones 17 | 18 | Note: the `coders` getter will return the coders in their reversed order 19 | Example: 20 | - by default we internally set coders = `IOCoder`, `GIFCoder`, `APNGCoder` 21 | - calling `coders` will return `@[IOCoder, GIFCoder, APNGCoder]` 22 | - call `[addCoder:[MyCrazyCoder new]]` 23 | - calling `coders` now returns `@[IOCoder, GIFCoder, APNGCoder, MyCrazyCoder]` 24 | 25 | Coders 26 | ------ 27 | A coder must conform to the `SDImageCoder` protocol or even to `SDProgressiveImageCoder` if it supports progressive decoding 28 | Conformance is important because that way, they will implement `canDecodeFromData` or `canEncodeToFormat` 29 | Those methods are called on each coder in the array (using the priority order) until one of them returns YES. 30 | That means that coder can decode that data / encode to that format 31 | */ 32 | @interface SDImageCodersManager : NSObject 33 | 34 | /** 35 | Returns the global shared coders manager instance. 36 | */ 37 | @property (nonatomic, class, readonly, nonnull) SDImageCodersManager *sharedManager; 38 | 39 | /** 40 | All coders in coders manager. The coders array is a priority queue, which means the later added coder will have the highest priority 41 | */ 42 | @property (nonatomic, copy, nullable) NSArray> *coders; 43 | 44 | /** 45 | Add a new coder to the end of coders array. Which has the highest priority. 46 | 47 | @param coder coder 48 | */ 49 | - (void)addCoder:(nonnull id)coder; 50 | 51 | /** 52 | Remove a coder in the coders array. 53 | 54 | @param coder coder 55 | */ 56 | - (void)removeCoder:(nonnull id)coder; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageFrame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | /** 13 | This class is used for creating animated images via `animatedImageWithFrames` in `SDImageCoderHelper`. 14 | @note If you need to specify animated images loop count, use `sd_imageLoopCount` property in `UIImage+Metadata.h`. 15 | */ 16 | @interface SDImageFrame : NSObject 17 | 18 | /** 19 | The image of current frame. You should not set an animated image. 20 | */ 21 | @property (nonatomic, strong, readonly, nonnull) UIImage *image; 22 | /** 23 | The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero. 24 | */ 25 | @property (nonatomic, readonly, assign) NSTimeInterval duration; 26 | 27 | /** 28 | Create a frame instance with specify image and duration 29 | 30 | @param image current frame's image 31 | @param duration current frame's duration 32 | @return frame instance 33 | */ 34 | + (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageFrame.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 "SDImageFrame.h" 10 | 11 | @interface SDImageFrame () 12 | 13 | @property (nonatomic, strong, readwrite, nonnull) UIImage *image; 14 | @property (nonatomic, readwrite, assign) NSTimeInterval duration; 15 | 16 | @end 17 | 18 | @implementation SDImageFrame 19 | 20 | + (instancetype)frameWithImage:(UIImage *)image duration:(NSTimeInterval)duration { 21 | SDImageFrame *frame = [[SDImageFrame alloc] init]; 22 | frame.image = image; 23 | frame.duration = duration; 24 | 25 | return frame; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageGIFCoder.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 "SDImageIOAnimatedCoder.h" 11 | 12 | /** 13 | Built in coder using ImageIO that supports animated GIF encoding/decoding 14 | @note `SDImageIOCoder` supports GIF but only as static (will use the 1st frame). 15 | @note Use `SDImageGIFCoder` for fully animated GIFs. For `UIImageView`, it will produce animated `UIImage`(`NSImage` on macOS) for rendering. For `SDAnimatedImageView`, it will use `SDAnimatedImage` for rendering. 16 | @note The recommended approach for animated GIFs is using `SDAnimatedImage` with `SDAnimatedImageView`. It's more performant than `UIImageView` for GIF displaying(especially on memory usage) 17 | */ 18 | @interface SDImageGIFCoder : SDImageIOAnimatedCoder 19 | 20 | @property (nonatomic, class, readonly, nonnull) SDImageGIFCoder *sharedCoder; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageGIFCoder.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 "SDImageGIFCoder.h" 10 | #import "SDImageIOAnimatedCoderInternal.h" 11 | #if SD_MAC 12 | #import 13 | #else 14 | #import 15 | #endif 16 | 17 | @implementation SDImageGIFCoder 18 | 19 | + (instancetype)sharedCoder { 20 | static SDImageGIFCoder *coder; 21 | static dispatch_once_t onceToken; 22 | dispatch_once(&onceToken, ^{ 23 | coder = [[SDImageGIFCoder alloc] init]; 24 | }); 25 | return coder; 26 | } 27 | 28 | #pragma mark - Subclass Override 29 | 30 | + (SDImageFormat)imageFormat { 31 | return SDImageFormatGIF; 32 | } 33 | 34 | + (NSString *)imageUTType { 35 | return (__bridge NSString *)kSDUTTypeGIF; 36 | } 37 | 38 | + (NSString *)dictionaryProperty { 39 | return (__bridge NSString *)kCGImagePropertyGIFDictionary; 40 | } 41 | 42 | + (NSString *)unclampedDelayTimeProperty { 43 | return (__bridge NSString *)kCGImagePropertyGIFUnclampedDelayTime; 44 | } 45 | 46 | + (NSString *)delayTimeProperty { 47 | return (__bridge NSString *)kCGImagePropertyGIFDelayTime; 48 | } 49 | 50 | + (NSString *)loopCountProperty { 51 | return (__bridge NSString *)kCGImagePropertyGIFLoopCount; 52 | } 53 | 54 | + (NSUInteger)defaultLoopCount { 55 | return 1; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageGraphics.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 11 | 12 | /** 13 | These following graphics context method are provided to easily write cross-platform(AppKit/UIKit) code. 14 | For UIKit, these methods just call the same method in `UIGraphics.h`. See the documentation for usage. 15 | For AppKit, these methods use `NSGraphicsContext` to create image context and match the behavior like UIKit. 16 | @note If you don't care bitmap format (ARGB8888) and just draw image, use `SDGraphicsImageRenderer` instead. It's more performant on RAM usage.` 17 | */ 18 | 19 | /// Returns the current graphics context. 20 | FOUNDATION_EXPORT CGContextRef __nullable SDGraphicsGetCurrentContext(void) CF_RETURNS_NOT_RETAINED; 21 | /// Creates a bitmap-based graphics context and makes it the current context. 22 | FOUNDATION_EXPORT void SDGraphicsBeginImageContext(CGSize size); 23 | /// Creates a bitmap-based graphics context with the specified options. 24 | FOUNDATION_EXPORT void SDGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale); 25 | /// Removes the current bitmap-based graphics context from the top of the stack. 26 | FOUNDATION_EXPORT void SDGraphicsEndImageContext(void); 27 | /// Returns an image based on the contents of the current bitmap-based graphics context. 28 | FOUNDATION_EXPORT UIImage * __nullable SDGraphicsGetImageFromCurrentImageContext(void); 29 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageHEICCoder.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 "SDImageIOAnimatedCoder.h" 11 | 12 | /** 13 | This coder is used for HEIC (HEIF with HEVC container codec) image format. 14 | Image/IO provide the static HEIC (.heic) support in iOS 11/macOS 10.13/tvOS 11/watchOS 4+. 15 | Image/IO provide the animated HEIC (.heics) support in iOS 13/macOS 10.15/tvOS 13/watchOS 6+. 16 | See https://nokiatech.github.io/heif/technical.html for the standard. 17 | @note This coder is not in the default coder list for now, since HEIC animated image is really rare, and Apple's implementation still contains performance issues. You can enable if you need this. 18 | @note If you need to support lower firmware version for HEIF, you can have a try at https://github.com/SDWebImage/SDWebImageHEIFCoder 19 | */ 20 | API_AVAILABLE(ios(13.0), tvos(13.0), macos(10.15), watchos(6.0)) 21 | @interface SDImageHEICCoder : SDImageIOAnimatedCoder 22 | 23 | @property (nonatomic, class, readonly, nonnull) SDImageHEICCoder *sharedCoder; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageIOAnimatedCoder.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 11 | #import "SDImageCoder.h" 12 | 13 | /** 14 | This is the abstract class for all animated coder, which use the Image/IO API. You can not use this directly as real coders. A exception will be raised if you use this class. 15 | All of the properties need the subclass to implement and works as expected. 16 | For Image/IO, See Apple's documentation: https://developer.apple.com/documentation/imageio 17 | */ 18 | @interface SDImageIOAnimatedCoder : NSObject 19 | 20 | #pragma mark - Subclass Override 21 | /** 22 | The supported animated image format. Such as `SDImageFormatGIF`. 23 | @note Subclass override. 24 | */ 25 | @property (class, readonly) SDImageFormat imageFormat; 26 | /** 27 | The supported image format UTI Type. Such as `kSDUTTypeGIF`. 28 | This can be used for cases when we can not detect `SDImageFormat. Such as progressive decoding's hint format `kCGImageSourceTypeIdentifierHint`. 29 | @note Subclass override. 30 | */ 31 | @property (class, readonly, nonnull) NSString *imageUTType; 32 | /** 33 | The image container property key used in Image/IO API. Such as `kCGImagePropertyGIFDictionary`. 34 | @note Subclass override. 35 | */ 36 | @property (class, readonly, nonnull) NSString *dictionaryProperty; 37 | /** 38 | The image unclamped delay time property key used in Image/IO API. Such as `kCGImagePropertyGIFUnclampedDelayTime` 39 | @note Subclass override. 40 | */ 41 | @property (class, readonly, nonnull) NSString *unclampedDelayTimeProperty; 42 | /** 43 | The image delay time property key used in Image/IO API. Such as `kCGImagePropertyGIFDelayTime`. 44 | @note Subclass override. 45 | */ 46 | @property (class, readonly, nonnull) NSString *delayTimeProperty; 47 | /** 48 | The image loop count property key used in Image/IO API. Such as `kCGImagePropertyGIFLoopCount`. 49 | @note Subclass override. 50 | */ 51 | @property (class, readonly, nonnull) NSString *loopCountProperty; 52 | /** 53 | The default loop count when there are no any loop count information inside image container metadata. 54 | For example, for GIF format, the standard use 1 (play once). For APNG format, the standard use 0 (infinity loop). 55 | @note Subclass override. 56 | */ 57 | @property (class, readonly) NSUInteger defaultLoopCount; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageIOCoder.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 "SDImageCoder.h" 11 | 12 | /** 13 | Built in coder that supports PNG, JPEG, TIFF, includes support for progressive decoding. 14 | 15 | GIF 16 | Also supports static GIF (meaning will only handle the 1st frame). 17 | For a full GIF support, we recommend `SDAnimatedImageView` to keep both CPU and memory balanced. 18 | 19 | HEIC 20 | This coder also supports HEIC format because ImageIO supports it natively. But it depends on the system capabilities, so it won't work on all devices, see: https://devstreaming-cdn.apple.com/videos/wwdc/2017/511tj33587vdhds/511/511_working_with_heif_and_hevc.pdf 21 | Decode(Software): !Simulator && (iOS 11 || tvOS 11 || macOS 10.13) 22 | Decode(Hardware): !Simulator && ((iOS 11 && A9Chip) || (macOS 10.13 && 6thGenerationIntelCPU)) 23 | Encode(Software): macOS 10.13 24 | Encode(Hardware): !Simulator && ((iOS 11 && A10FusionChip) || (macOS 10.13 && 6thGenerationIntelCPU)) 25 | */ 26 | @interface SDImageIOCoder : NSObject 27 | 28 | @property (nonatomic, class, readonly, nonnull) SDImageIOCoder *sharedCoder; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDImageLoadersManager.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 "SDImageLoader.h" 10 | 11 | /** 12 | A loaders manager to manage multiple loaders 13 | */ 14 | @interface SDImageLoadersManager : NSObject 15 | 16 | /** 17 | Returns the global shared loaders manager instance. By default we will set [`SDWebImageDownloader.sharedDownloader`] into the loaders array. 18 | */ 19 | @property (nonatomic, class, readonly, nonnull) SDImageLoadersManager *sharedManager; 20 | 21 | /** 22 | All image loaders in manager. The loaders array is a priority queue, which means the later added loader will have the highest priority 23 | */ 24 | @property (nonatomic, copy, nullable) NSArray>* loaders; 25 | 26 | /** 27 | Add a new image loader to the end of loaders array. Which has the highest priority. 28 | 29 | @param loader loader 30 | */ 31 | - (void)addLoader:(nonnull id)loader; 32 | 33 | /** 34 | Remove an image loader in the loaders array. 35 | 36 | @param loader loader 37 | */ 38 | - (void)removeLoader:(nonnull id)loader; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDMemoryCache.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 | @class SDImageCacheConfig; 12 | /** 13 | A protocol to allow custom memory cache used in SDImageCache. 14 | */ 15 | @protocol SDMemoryCache 16 | 17 | @required 18 | 19 | /** 20 | Create a new memory cache instance with the specify cache config. You can check `maxMemoryCost` and `maxMemoryCount` used for memory cache. 21 | 22 | @param config The cache config to be used to create the cache. 23 | @return The new memory cache instance. 24 | */ 25 | - (nonnull instancetype)initWithConfig:(nonnull SDImageCacheConfig *)config; 26 | 27 | /** 28 | Returns the value associated with a given key. 29 | 30 | @param key An object identifying the value. If nil, just return nil. 31 | @return The value associated with key, or nil if no value is associated with key. 32 | */ 33 | - (nullable id)objectForKey:(nonnull id)key; 34 | 35 | /** 36 | Sets the value of the specified key in the cache (0 cost). 37 | 38 | @param object The object to be stored in the cache. If nil, it calls `removeObjectForKey:`. 39 | @param key The key with which to associate the value. If nil, this method has no effect. 40 | @discussion Unlike an NSMutableDictionary object, a cache does not copy the key 41 | objects that are put into it. 42 | */ 43 | - (void)setObject:(nullable id)object forKey:(nonnull id)key; 44 | 45 | /** 46 | Sets the value of the specified key in the cache, and associates the key-value 47 | pair with the specified cost. 48 | 49 | @param object The object to store in the cache. If nil, it calls `removeObjectForKey`. 50 | @param key The key with which to associate the value. If nil, this method has no effect. 51 | @param cost The cost with which to associate the key-value pair. 52 | @discussion Unlike an NSMutableDictionary object, a cache does not copy the key 53 | objects that are put into it. 54 | */ 55 | - (void)setObject:(nullable id)object forKey:(nonnull id)key cost:(NSUInteger)cost; 56 | 57 | /** 58 | Removes the value of the specified key in the cache. 59 | 60 | @param key The key identifying the value to be removed. If nil, this method has no effect. 61 | */ 62 | - (void)removeObjectForKey:(nonnull id)key; 63 | 64 | /** 65 | Empties the cache immediately. 66 | */ 67 | - (void)removeAllObjects; 68 | 69 | @end 70 | 71 | /** 72 | A memory cache which auto purge the cache on memory warning and support weak cache. 73 | */ 74 | @interface SDMemoryCache : NSCache 75 | 76 | @property (nonatomic, strong, nonnull, readonly) SDImageCacheConfig *config; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheKeyFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSString * _Nullable(^SDWebImageCacheKeyFilterBlock)(NSURL * _Nonnull url); 13 | 14 | /** 15 | This is the protocol for cache key filter. 16 | We can use a block to specify the cache key filter. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageCacheKeyFilter 19 | 20 | - (nullable NSString *)cacheKeyForURL:(nonnull NSURL *)url; 21 | 22 | @end 23 | 24 | /** 25 | A cache key filter class with block. 26 | */ 27 | @interface SDWebImageCacheKeyFilter : NSObject 28 | 29 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageCacheKeyFilterBlock)block; 30 | + (nonnull instancetype)cacheKeyFilterWithBlock:(nonnull SDWebImageCacheKeyFilterBlock)block; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheKeyFilter.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 "SDWebImageCacheKeyFilter.h" 10 | 11 | @interface SDWebImageCacheKeyFilter () 12 | 13 | @property (nonatomic, copy, nonnull) SDWebImageCacheKeyFilterBlock block; 14 | 15 | @end 16 | 17 | @implementation SDWebImageCacheKeyFilter 18 | 19 | - (instancetype)initWithBlock:(SDWebImageCacheKeyFilterBlock)block { 20 | self = [super init]; 21 | if (self) { 22 | self.block = block; 23 | } 24 | return self; 25 | } 26 | 27 | + (instancetype)cacheKeyFilterWithBlock:(SDWebImageCacheKeyFilterBlock)block { 28 | SDWebImageCacheKeyFilter *cacheKeyFilter = [[SDWebImageCacheKeyFilter alloc] initWithBlock:block]; 29 | return cacheKeyFilter; 30 | } 31 | 32 | - (NSString *)cacheKeyForURL:(NSURL *)url { 33 | if (!self.block) { 34 | return nil; 35 | } 36 | return self.block(url); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheSerializer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSData * _Nullable(^SDWebImageCacheSerializerBlock)(UIImage * _Nonnull image, NSData * _Nullable data, NSURL * _Nullable imageURL); 13 | 14 | /** 15 | This is the protocol for cache serializer. 16 | We can use a block to specify the cache serializer. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageCacheSerializer 19 | 20 | /// Provide the image data associated to the image and store to disk cache 21 | /// @param image The loaded image 22 | /// @param data The original loaded image data 23 | /// @param imageURL The image URL 24 | - (nullable NSData *)cacheDataWithImage:(nonnull UIImage *)image originalData:(nullable NSData *)data imageURL:(nullable NSURL *)imageURL; 25 | 26 | @end 27 | 28 | /** 29 | A cache serializer class with block. 30 | */ 31 | @interface SDWebImageCacheSerializer : NSObject 32 | 33 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageCacheSerializerBlock)block; 34 | + (nonnull instancetype)cacheSerializerWithBlock:(nonnull SDWebImageCacheSerializerBlock)block; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheSerializer.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 "SDWebImageCacheSerializer.h" 10 | 11 | @interface SDWebImageCacheSerializer () 12 | 13 | @property (nonatomic, copy, nonnull) SDWebImageCacheSerializerBlock block; 14 | 15 | @end 16 | 17 | @implementation SDWebImageCacheSerializer 18 | 19 | - (instancetype)initWithBlock:(SDWebImageCacheSerializerBlock)block { 20 | self = [super init]; 21 | if (self) { 22 | self.block = block; 23 | } 24 | return self; 25 | } 26 | 27 | + (instancetype)cacheSerializerWithBlock:(SDWebImageCacheSerializerBlock)block { 28 | SDWebImageCacheSerializer *cacheSerializer = [[SDWebImageCacheSerializer alloc] initWithBlock:block]; 29 | return cacheSerializer; 30 | } 31 | 32 | - (NSData *)cacheDataWithImage:(UIImage *)image originalData:(NSData *)data imageURL:(nullable NSURL *)imageURL { 33 | if (!self.block) { 34 | return nil; 35 | } 36 | return self.block(image, data, imageURL); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/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 | // Seems like TARGET_OS_MAC is always defined (on all platforms). 17 | // To determine if we are running on macOS, use TARGET_OS_OSX in Xcode 8 18 | #if TARGET_OS_OSX 19 | #define SD_MAC 1 20 | #else 21 | #define SD_MAC 0 22 | #endif 23 | 24 | // iOS and tvOS are very similar, UIKit exists on both platforms 25 | // Note: watchOS also has UIKit, but it's very limited 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | #define SD_UIKIT 1 28 | #else 29 | #define SD_UIKIT 0 30 | #endif 31 | 32 | #if TARGET_OS_IOS 33 | #define SD_IOS 1 34 | #else 35 | #define SD_IOS 0 36 | #endif 37 | 38 | #if TARGET_OS_TV 39 | #define SD_TV 1 40 | #else 41 | #define SD_TV 0 42 | #endif 43 | 44 | #if TARGET_OS_WATCH 45 | #define SD_WATCH 1 46 | #else 47 | #define SD_WATCH 0 48 | #endif 49 | 50 | 51 | #if SD_MAC 52 | #import 53 | #ifndef UIImage 54 | #define UIImage NSImage 55 | #endif 56 | #ifndef UIImageView 57 | #define UIImageView NSImageView 58 | #endif 59 | #ifndef UIView 60 | #define UIView NSView 61 | #endif 62 | #ifndef UIColor 63 | #define UIColor NSColor 64 | #endif 65 | #else 66 | #if SD_UIKIT 67 | #import 68 | #endif 69 | #if SD_WATCH 70 | #import 71 | #ifndef UIView 72 | #define UIView WKInterfaceObject 73 | #endif 74 | #ifndef UIImageView 75 | #define UIImageView WKInterfaceImage 76 | #endif 77 | #endif 78 | #endif 79 | 80 | #ifndef NS_ENUM 81 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 82 | #endif 83 | 84 | #ifndef NS_OPTIONS 85 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 86 | #endif 87 | 88 | #ifndef dispatch_main_async_safe 89 | #define dispatch_main_async_safe(block)\ 90 | if (dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL) == dispatch_queue_get_label(dispatch_get_main_queue())) {\ 91 | block();\ 92 | } else {\ 93 | dispatch_async(dispatch_get_main_queue(), block);\ 94 | } 95 | #endif 96 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/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 | #if !OS_OBJECT_USE_OBJC 16 | #error SDWebImage need ARC for dispatch object 17 | #endif 18 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderConfig.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 "SDWebImageDownloaderConfig.h" 10 | 11 | static SDWebImageDownloaderConfig * _defaultDownloaderConfig; 12 | 13 | @implementation SDWebImageDownloaderConfig 14 | 15 | + (SDWebImageDownloaderConfig *)defaultDownloaderConfig { 16 | static dispatch_once_t onceToken; 17 | dispatch_once(&onceToken, ^{ 18 | _defaultDownloaderConfig = [SDWebImageDownloaderConfig new]; 19 | }); 20 | return _defaultDownloaderConfig; 21 | } 22 | 23 | - (instancetype)init { 24 | self = [super init]; 25 | if (self) { 26 | _maxConcurrentDownloads = 6; 27 | _downloadTimeout = 15.0; 28 | _executionOrder = SDWebImageDownloaderFIFOExecutionOrder; 29 | _acceptableStatusCodes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 100)]; 30 | } 31 | return self; 32 | } 33 | 34 | - (id)copyWithZone:(NSZone *)zone { 35 | SDWebImageDownloaderConfig *config = [[[self class] allocWithZone:zone] init]; 36 | config.maxConcurrentDownloads = self.maxConcurrentDownloads; 37 | config.downloadTimeout = self.downloadTimeout; 38 | config.minimumProgressInterval = self.minimumProgressInterval; 39 | config.sessionConfiguration = [self.sessionConfiguration copyWithZone:zone]; 40 | config.operationClass = self.operationClass; 41 | config.executionOrder = self.executionOrder; 42 | config.urlCredential = self.urlCredential; 43 | config.username = self.username; 44 | config.password = self.password; 45 | config.acceptableStatusCodes = self.acceptableStatusCodes; 46 | config.acceptableContentTypes = self.acceptableContentTypes; 47 | 48 | return config; 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderDecryptor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSData * _Nullable (^SDWebImageDownloaderDecryptorBlock)(NSData * _Nonnull data, NSURLResponse * _Nullable response); 13 | 14 | /** 15 | This is the protocol for downloader decryptor. Which decrypt the original encrypted data before decoding. Note progressive decoding is not compatible for decryptor. 16 | We can use a block to specify the downloader decryptor. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageDownloaderDecryptor 19 | 20 | /// Decrypt the original download data and return a new data. You can use this to decrypt the data using your preferred algorithm. 21 | /// @param data The original download data 22 | /// @param response The URL response for data. If you modify the original URL response via response modifier, the modified version will be here. This arg is nullable. 23 | /// @note If nil is returned, the image download will be marked as failed with error `SDWebImageErrorBadImageData` 24 | - (nullable NSData *)decryptedDataWithData:(nonnull NSData *)data response:(nullable NSURLResponse *)response; 25 | 26 | @end 27 | 28 | /** 29 | A downloader response modifier class with block. 30 | */ 31 | @interface SDWebImageDownloaderDecryptor : NSObject 32 | 33 | /// Create the data decryptor with block 34 | /// @param block A block to control decrypt logic 35 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageDownloaderDecryptorBlock)block; 36 | 37 | /// Create the data decryptor with block 38 | /// @param block A block to control decrypt logic 39 | + (nonnull instancetype)decryptorWithBlock:(nonnull SDWebImageDownloaderDecryptorBlock)block; 40 | 41 | @end 42 | 43 | /// Convenience way to create decryptor for common data encryption. 44 | @interface SDWebImageDownloaderDecryptor (Conveniences) 45 | 46 | /// Base64 Encoded image data decryptor 47 | @property (class, readonly, nonnull) SDWebImageDownloaderDecryptor *base64Decryptor; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderDecryptor.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 "SDWebImageDownloaderDecryptor.h" 10 | 11 | @interface SDWebImageDownloaderDecryptor () 12 | 13 | @property (nonatomic, copy, nonnull) SDWebImageDownloaderDecryptorBlock block; 14 | 15 | @end 16 | 17 | @implementation SDWebImageDownloaderDecryptor 18 | 19 | - (instancetype)initWithBlock:(SDWebImageDownloaderDecryptorBlock)block { 20 | self = [super init]; 21 | if (self) { 22 | self.block = block; 23 | } 24 | return self; 25 | } 26 | 27 | + (instancetype)decryptorWithBlock:(SDWebImageDownloaderDecryptorBlock)block { 28 | SDWebImageDownloaderDecryptor *decryptor = [[SDWebImageDownloaderDecryptor alloc] initWithBlock:block]; 29 | return decryptor; 30 | } 31 | 32 | - (nullable NSData *)decryptedDataWithData:(nonnull NSData *)data response:(nullable NSURLResponse *)response { 33 | if (!self.block) { 34 | return nil; 35 | } 36 | return self.block(data, response); 37 | } 38 | 39 | @end 40 | 41 | @implementation SDWebImageDownloaderDecryptor (Conveniences) 42 | 43 | + (SDWebImageDownloaderDecryptor *)base64Decryptor { 44 | static SDWebImageDownloaderDecryptor *decryptor; 45 | static dispatch_once_t onceToken; 46 | dispatch_once(&onceToken, ^{ 47 | decryptor = [SDWebImageDownloaderDecryptor decryptorWithBlock:^NSData * _Nullable(NSData * _Nonnull data, NSURLResponse * _Nullable response) { 48 | NSData *modifiedData = [[NSData alloc] initWithBase64EncodedData:data options:NSDataBase64DecodingIgnoreUnknownCharacters]; 49 | return modifiedData; 50 | }]; 51 | }); 52 | return decryptor; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSURLRequest * _Nullable (^SDWebImageDownloaderRequestModifierBlock)(NSURLRequest * _Nonnull request); 13 | 14 | /** 15 | This is the protocol for downloader request modifier. 16 | We can use a block to specify the downloader request modifier. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageDownloaderRequestModifier 19 | 20 | /// Modify the original URL request and return a new one instead. You can modify the HTTP header, cachePolicy, etc for this URL. 21 | /// @param request The original URL request for image loading 22 | /// @note If return nil, the URL request will be cancelled. 23 | - (nullable NSURLRequest *)modifiedRequestWithRequest:(nonnull NSURLRequest *)request; 24 | 25 | @end 26 | 27 | /** 28 | A downloader request modifier class with block. 29 | */ 30 | @interface SDWebImageDownloaderRequestModifier : NSObject 31 | 32 | /// Create the request modifier with block 33 | /// @param block A block to control modifier logic 34 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageDownloaderRequestModifierBlock)block; 35 | 36 | /// Create the request modifier with block 37 | /// @param block A block to control modifier logic 38 | + (nonnull instancetype)requestModifierWithBlock:(nonnull SDWebImageDownloaderRequestModifierBlock)block; 39 | 40 | @end 41 | 42 | /** 43 | A convenient request modifier to provide the HTTP request including HTTP Method, Headers and Body. 44 | */ 45 | @interface SDWebImageDownloaderRequestModifier (Conveniences) 46 | 47 | /// Create the request modifier with HTTP Method. 48 | /// @param method HTTP Method, nil means to GET. 49 | /// @note This is for convenience, if you need code to control the logic, use block API instead. 50 | - (nonnull instancetype)initWithMethod:(nullable NSString *)method; 51 | 52 | /// Create the request modifier with HTTP Headers. 53 | /// @param headers HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will override the same fields from original request. 54 | /// @note This is for convenience, if you need code to control the logic, use block API instead. 55 | - (nonnull instancetype)initWithHeaders:(nullable NSDictionary *)headers; 56 | 57 | /// Create the request modifier with HTTP Body. 58 | /// @param body HTTP Body. 59 | /// @note This is for convenience, if you need code to control the logic, use block API instead. 60 | - (nonnull instancetype)initWithBody:(nullable NSData *)body; 61 | 62 | /// Create the request modifier with HTTP Method, Headers and Body. 63 | /// @param method HTTP Method, nil means to GET. 64 | /// @param headers HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will override the same fields from original request. 65 | /// @param body HTTP Body. 66 | /// @note This is for convenience, if you need code to control the logic, use block API instead. 67 | - (nonnull instancetype)initWithMethod:(nullable NSString *)method headers:(nullable NSDictionary *)headers body:(nullable NSData *)body; 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.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 "SDWebImageDownloaderRequestModifier.h" 10 | 11 | @interface SDWebImageDownloaderRequestModifier () 12 | 13 | @property (nonatomic, copy, nonnull) SDWebImageDownloaderRequestModifierBlock block; 14 | 15 | @end 16 | 17 | @implementation SDWebImageDownloaderRequestModifier 18 | 19 | - (instancetype)initWithBlock:(SDWebImageDownloaderRequestModifierBlock)block { 20 | self = [super init]; 21 | if (self) { 22 | self.block = block; 23 | } 24 | return self; 25 | } 26 | 27 | + (instancetype)requestModifierWithBlock:(SDWebImageDownloaderRequestModifierBlock)block { 28 | SDWebImageDownloaderRequestModifier *requestModifier = [[SDWebImageDownloaderRequestModifier alloc] initWithBlock:block]; 29 | return requestModifier; 30 | } 31 | 32 | - (NSURLRequest *)modifiedRequestWithRequest:(NSURLRequest *)request { 33 | if (!self.block) { 34 | return nil; 35 | } 36 | return self.block(request); 37 | } 38 | 39 | @end 40 | 41 | @implementation SDWebImageDownloaderRequestModifier (Conveniences) 42 | 43 | - (instancetype)initWithMethod:(NSString *)method { 44 | return [self initWithMethod:method headers:nil body:nil]; 45 | } 46 | 47 | - (instancetype)initWithHeaders:(NSDictionary *)headers { 48 | return [self initWithMethod:nil headers:headers body:nil]; 49 | } 50 | 51 | - (instancetype)initWithBody:(NSData *)body { 52 | return [self initWithMethod:nil headers:nil body:body]; 53 | } 54 | 55 | - (instancetype)initWithMethod:(NSString *)method headers:(NSDictionary *)headers body:(NSData *)body { 56 | method = method ? [method copy] : @"GET"; 57 | headers = [headers copy]; 58 | body = [body copy]; 59 | return [self initWithBlock:^NSURLRequest * _Nullable(NSURLRequest * _Nonnull request) { 60 | NSMutableURLRequest *mutableRequest = [request mutableCopy]; 61 | mutableRequest.HTTPMethod = method; 62 | mutableRequest.HTTPBody = body; 63 | for (NSString *header in headers) { 64 | NSString *value = headers[header]; 65 | [mutableRequest setValue:value forHTTPHeaderField:header]; 66 | } 67 | return [mutableRequest copy]; 68 | }]; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderResponseModifier.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 | 10 | #import "SDWebImageDownloaderResponseModifier.h" 11 | 12 | @interface SDWebImageDownloaderResponseModifier () 13 | 14 | @property (nonatomic, copy, nonnull) SDWebImageDownloaderResponseModifierBlock block; 15 | 16 | @end 17 | 18 | @implementation SDWebImageDownloaderResponseModifier 19 | 20 | - (instancetype)initWithBlock:(SDWebImageDownloaderResponseModifierBlock)block { 21 | self = [super init]; 22 | if (self) { 23 | self.block = block; 24 | } 25 | return self; 26 | } 27 | 28 | + (instancetype)responseModifierWithBlock:(SDWebImageDownloaderResponseModifierBlock)block { 29 | SDWebImageDownloaderResponseModifier *responseModifier = [[SDWebImageDownloaderResponseModifier alloc] initWithBlock:block]; 30 | return responseModifier; 31 | } 32 | 33 | - (nullable NSURLResponse *)modifiedResponseWithResponse:(nonnull NSURLResponse *)response { 34 | if (!self.block) { 35 | return nil; 36 | } 37 | return self.block(response); 38 | } 39 | 40 | @end 41 | 42 | @implementation SDWebImageDownloaderResponseModifier (Conveniences) 43 | 44 | - (instancetype)initWithStatusCode:(NSInteger)statusCode { 45 | return [self initWithStatusCode:statusCode version:nil headers:nil]; 46 | } 47 | 48 | - (instancetype)initWithVersion:(NSString *)version { 49 | return [self initWithStatusCode:200 version:version headers:nil]; 50 | } 51 | 52 | - (instancetype)initWithHeaders:(NSDictionary *)headers { 53 | return [self initWithStatusCode:200 version:nil headers:headers]; 54 | } 55 | 56 | - (instancetype)initWithStatusCode:(NSInteger)statusCode version:(NSString *)version headers:(NSDictionary *)headers { 57 | version = version ? [version copy] : @"HTTP/1.1"; 58 | headers = [headers copy]; 59 | return [self initWithBlock:^NSURLResponse * _Nullable(NSURLResponse * _Nonnull response) { 60 | if (![response isKindOfClass:NSHTTPURLResponse.class]) { 61 | return response; 62 | } 63 | NSMutableDictionary *mutableHeaders = [((NSHTTPURLResponse *)response).allHeaderFields mutableCopy]; 64 | for (NSString *header in headers) { 65 | NSString *value = headers[header]; 66 | mutableHeaders[header] = value; 67 | } 68 | NSHTTPURLResponse *httpResponse = [[NSHTTPURLResponse alloc] initWithURL:response.URL statusCode:statusCode HTTPVersion:version headerFields:[mutableHeaders copy]]; 69 | return httpResponse; 70 | }]; 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageError.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 "SDWebImageCompat.h" 11 | 12 | FOUNDATION_EXPORT NSErrorDomain const _Nonnull SDWebImageErrorDomain; 13 | 14 | /// The response instance for invalid download response (NSURLResponse *) 15 | FOUNDATION_EXPORT NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadResponseKey; 16 | /// The HTTP status code for invalid download response (NSNumber *) 17 | FOUNDATION_EXPORT NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadStatusCodeKey; 18 | /// The HTTP MIME content type for invalid download response (NSString *) 19 | FOUNDATION_EXPORT NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadContentTypeKey; 20 | 21 | /// SDWebImage error domain and codes 22 | typedef NS_ERROR_ENUM(SDWebImageErrorDomain, SDWebImageError) { 23 | SDWebImageErrorInvalidURL = 1000, // The URL is invalid, such as nil URL or corrupted URL 24 | SDWebImageErrorBadImageData = 1001, // The image data can not be decoded to image, or the image data is empty 25 | SDWebImageErrorCacheNotModified = 1002, // The remote location specify that the cached image is not modified, such as the HTTP response 304 code. It's useful for `SDWebImageRefreshCached` 26 | SDWebImageErrorBlackListed = 1003, // The URL is blacklisted because of unrecoverable failure marked by downloader (such as 404), you can use `.retryFailed` option to avoid this 27 | SDWebImageErrorInvalidDownloadOperation = 2000, // The image download operation is invalid, such as nil operation or unexpected error occur when operation initialized 28 | SDWebImageErrorInvalidDownloadStatusCode = 2001, // The image download response a invalid status code. You can check the status code in error's userInfo under `SDWebImageErrorDownloadStatusCodeKey` 29 | SDWebImageErrorCancelled = 2002, // The image loading operation is cancelled before finished, during either async disk cache query, or waiting before actual network request. For actual network request error, check `NSURLErrorDomain` error domain and code. 30 | SDWebImageErrorInvalidDownloadResponse = 2003, // When using response modifier, the modified download response is nil and marked as failed. 31 | SDWebImageErrorInvalidDownloadContentType = 2004, // The image download response a invalid content type. You can check the MIME content type in error's userInfo under `SDWebImageErrorDownloadContentTypeKey` 32 | }; 33 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageError.m: -------------------------------------------------------------------------------- 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 "SDWebImageError.h" 11 | 12 | NSErrorDomain const _Nonnull SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 13 | 14 | NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadResponseKey = @"SDWebImageErrorDownloadResponseKey"; 15 | NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadStatusCodeKey = @"SDWebImageErrorDownloadStatusCodeKey"; 16 | NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadContentTypeKey = @"SDWebImageErrorDownloadContentTypeKey"; 17 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/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 | /// A protocol represents cancelable operation. 12 | @protocol SDWebImageOperation 13 | 14 | /// Cancel the operation 15 | - (void)cancel; 16 | 17 | @optional 18 | 19 | /// Whether the operation has been cancelled. 20 | @property (nonatomic, assign, readonly, getter=isCancelled) BOOL cancelled; 21 | 22 | @end 23 | 24 | /// NSOperation conform to `SDWebImageOperation`. 25 | @interface NSOperation (SDWebImageOperation) 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageOperation.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 "SDWebImageOperation.h" 10 | 11 | /// NSOperation conform to `SDWebImageOperation`. 12 | @implementation NSOperation (SDWebImageOperation) 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageOptionsProcessor.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 "SDWebImageDefine.h" 12 | 13 | @class SDWebImageOptionsResult; 14 | 15 | typedef SDWebImageOptionsResult * _Nullable(^SDWebImageOptionsProcessorBlock)(NSURL * _Nullable url, SDWebImageOptions options, SDWebImageContext * _Nullable context); 16 | 17 | /** 18 | The options result contains both options and context. 19 | */ 20 | @interface SDWebImageOptionsResult : NSObject 21 | 22 | /** 23 | WebCache options. 24 | */ 25 | @property (nonatomic, assign, readonly) SDWebImageOptions options; 26 | 27 | /** 28 | Context options. 29 | */ 30 | @property (nonatomic, copy, readonly, nullable) SDWebImageContext *context; 31 | 32 | /** 33 | Create a new options result. 34 | 35 | @param options options 36 | @param context context 37 | @return The options result contains both options and context. 38 | */ 39 | - (nonnull instancetype)initWithOptions:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context; 40 | 41 | @end 42 | 43 | /** 44 | This is the protocol for options processor. 45 | Options processor can be used, to control the final result for individual image request's `SDWebImageOptions` and `SDWebImageContext` 46 | Implements the protocol to have a global control for each indivadual image request's option. 47 | */ 48 | @protocol SDWebImageOptionsProcessor 49 | 50 | /** 51 | Return the processed options result for specify image URL, with its options and context 52 | 53 | @param url The URL to the image 54 | @param options A mask to specify options to use for this request 55 | @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold. 56 | @return The processed result, contains both options and context 57 | */ 58 | - (nullable SDWebImageOptionsResult *)processedResultForURL:(nullable NSURL *)url 59 | options:(SDWebImageOptions)options 60 | context:(nullable SDWebImageContext *)context; 61 | 62 | @end 63 | 64 | /** 65 | A options processor class with block. 66 | */ 67 | @interface SDWebImageOptionsProcessor : NSObject 68 | 69 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageOptionsProcessorBlock)block; 70 | + (nonnull instancetype)optionsProcessorWithBlock:(nonnull SDWebImageOptionsProcessorBlock)block; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/SDWebImageOptionsProcessor.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 "SDWebImageOptionsProcessor.h" 10 | 11 | @interface SDWebImageOptionsResult () 12 | 13 | @property (nonatomic, assign) SDWebImageOptions options; 14 | @property (nonatomic, copy, nullable) SDWebImageContext *context; 15 | 16 | @end 17 | 18 | @implementation SDWebImageOptionsResult 19 | 20 | - (instancetype)initWithOptions:(SDWebImageOptions)options context:(SDWebImageContext *)context { 21 | self = [super init]; 22 | if (self) { 23 | self.options = options; 24 | self.context = context; 25 | } 26 | return self; 27 | } 28 | 29 | @end 30 | 31 | @interface SDWebImageOptionsProcessor () 32 | 33 | @property (nonatomic, copy, nonnull) SDWebImageOptionsProcessorBlock block; 34 | 35 | @end 36 | 37 | @implementation SDWebImageOptionsProcessor 38 | 39 | - (instancetype)initWithBlock:(SDWebImageOptionsProcessorBlock)block { 40 | self = [super init]; 41 | if (self) { 42 | self.block = block; 43 | } 44 | return self; 45 | } 46 | 47 | + (instancetype)optionsProcessorWithBlock:(SDWebImageOptionsProcessorBlock)block { 48 | SDWebImageOptionsProcessor *optionsProcessor = [[SDWebImageOptionsProcessor alloc] initWithBlock:block]; 49 | return optionsProcessor; 50 | } 51 | 52 | - (SDWebImageOptionsResult *)processedResultForURL:(NSURL *)url options:(SDWebImageOptions)options context:(SDWebImageContext *)context { 53 | if (!self.block) { 54 | return nil; 55 | } 56 | return self.block(url, options, context); 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/UIImage+ExtendedCacheData.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 | @interface UIImage (ExtendedCacheData) 14 | 15 | /** 16 | Read and Write the extended object and bind it to the image. Which can hold some extra metadata like Image's scale factor, URL rich link, date, etc. 17 | The extended object should conforms to NSCoding, which we use `NSKeyedArchiver` and `NSKeyedUnarchiver` to archive it to data, and write to disk cache. 18 | @note The disk cache preserve both of the data and extended data with the same cache key. For manual query, use the `SDDiskCache` protocol method `extendedDataForKey:` instead. 19 | @note You can specify arbitrary object conforms to NSCoding (NSObject protocol here is used to support object using `NS_ROOT_CLASS`, which is not NSObject subclass). If you load image from disk cache, you should check the extended object class to avoid corrupted data. 20 | @warning This object don't need to implements NSSecureCoding (but it's recommended), because we allows arbitrary class. 21 | */ 22 | @property (nonatomic, strong, nullable) id sd_extendedObject; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/UIImage+ExtendedCacheData.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 "UIImage+ExtendedCacheData.h" 11 | #import 12 | 13 | @implementation UIImage (ExtendedCacheData) 14 | 15 | - (id)sd_extendedObject { 16 | return objc_getAssociatedObject(self, @selector(sd_extendedObject)); 17 | } 18 | 19 | - (void)setSd_extendedObject:(id)sd_extendedObject { 20 | objc_setAssociatedObject(self, @selector(sd_extendedObject), sd_extendedObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | /** 12 | UIImage category about force decode feature (avoid Image/IO's lazy decoding during rendering behavior). 13 | */ 14 | @interface UIImage (ForceDecode) 15 | 16 | /** 17 | A bool value indicating whether the image has already been decoded. This can help to avoid extra force decode. 18 | */ 19 | @property (nonatomic, assign) BOOL sd_isDecoded; 20 | 21 | /** 22 | Decode the provided image. This is useful if you want to force decode the image before rendering to improve performance. 23 | 24 | @param image The image to be decoded 25 | @return The decoded image 26 | */ 27 | + (nullable UIImage *)sd_decodedImageWithImage:(nullable UIImage *)image; 28 | 29 | /** 30 | Decode and scale down the provided image 31 | 32 | @param image The image to be decoded 33 | @return The decoded and scaled down image 34 | */ 35 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image; 36 | 37 | /** 38 | Decode and scale down the provided image with limit bytes 39 | 40 | @param image The image to be decoded 41 | @param bytes The limit bytes size. Provide 0 to use the build-in limit. 42 | @return The decoded and scaled down image 43 | */ 44 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image limitBytes:(NSUInteger)bytes; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/UIImage+ForceDecode.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+ForceDecode.h" 10 | #import "SDImageCoderHelper.h" 11 | #import "objc/runtime.h" 12 | #import "NSImage+Compatibility.h" 13 | 14 | @implementation UIImage (ForceDecode) 15 | 16 | - (BOOL)sd_isDecoded { 17 | NSNumber *value = objc_getAssociatedObject(self, @selector(sd_isDecoded)); 18 | if (value != nil) { 19 | return value.boolValue; 20 | } else { 21 | // Assume only CGImage based can use lazy decoding 22 | CGImageRef cgImage = self.CGImage; 23 | if (cgImage) { 24 | CFStringRef uttype = CGImageGetUTType(self.CGImage); 25 | if (uttype) { 26 | // Only ImageIO can set `com.apple.ImageIO.imageSourceTypeIdentifier` 27 | return NO; 28 | } else { 29 | // Thumbnail or CGBitmapContext drawn image 30 | return YES; 31 | } 32 | } 33 | } 34 | // Assume others as non-decoded 35 | return NO; 36 | } 37 | 38 | - (void)setSd_isDecoded:(BOOL)sd_isDecoded { 39 | objc_setAssociatedObject(self, @selector(sd_isDecoded), @(sd_isDecoded), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 40 | } 41 | 42 | + (nullable UIImage *)sd_decodedImageWithImage:(nullable UIImage *)image { 43 | if (!image) { 44 | return nil; 45 | } 46 | return [SDImageCoderHelper decodedImageWithImage:image]; 47 | } 48 | 49 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image { 50 | return [self sd_decodedAndScaledDownImageWithImage:image limitBytes:0]; 51 | } 52 | 53 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image limitBytes:(NSUInteger)bytes { 54 | if (!image) { 55 | return nil; 56 | } 57 | return [SDImageCoderHelper decodedAndScaledDownImageWithImage:image limitBytes:bytes]; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/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 | /** 13 | This category is just use as a convenience method. For more detail control, use methods in `UIImage+MultiFormat.h` or directly use `SDImageCoder`. 14 | */ 15 | @interface UIImage (GIF) 16 | 17 | /** 18 | Creates an animated UIImage from an NSData. 19 | This will create animated image if the data is Animated GIF. And will create a static image is the data is Static GIF. 20 | 21 | @param data The GIF data 22 | @return The created image 23 | */ 24 | + (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/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 "SDImageGIFCoder.h" 12 | 13 | @implementation UIImage (GIF) 14 | 15 | + (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data { 16 | if (!data) { 17 | return nil; 18 | } 19 | return [[SDImageGIFCoder sharedCoder] decodedImageWithData:data options:0]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.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 | /** 12 | UIImage category for memory cache cost. 13 | */ 14 | @interface UIImage (MemoryCacheCost) 15 | 16 | /** 17 | The memory cache cost for specify image used by image cache. The cost function is the bytes size held in memory. 18 | If you set some associated object to `UIImage`, you can set the custom value to indicate the memory cost. 19 | 20 | For `UIImage`, this method return the single frame bytes size when `image.images` is nil for static image. Return full frame bytes size when `image.images` is not nil for animated image. 21 | For `NSImage`, this method return the single frame bytes size because `NSImage` does not store all frames in memory. 22 | @note Note that because of the limitations of category this property can get out of sync if you create another instance with CGImage or other methods. 23 | @note For custom animated class conforms to `SDAnimatedImage`, you can override this getter method in your subclass to return a more proper value instead, which representing the current frame's total bytes. 24 | */ 25 | @property (assign, nonatomic) NSUInteger sd_memoryCost; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.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+MemoryCacheCost.h" 10 | #import "objc/runtime.h" 11 | #import "NSImage+Compatibility.h" 12 | 13 | FOUNDATION_STATIC_INLINE NSUInteger SDMemoryCacheCostForImage(UIImage *image) { 14 | CGImageRef imageRef = image.CGImage; 15 | if (!imageRef) { 16 | return 0; 17 | } 18 | NSUInteger bytesPerFrame = CGImageGetBytesPerRow(imageRef) * CGImageGetHeight(imageRef); 19 | NSUInteger frameCount; 20 | #if SD_MAC 21 | frameCount = 1; 22 | #elif SD_UIKIT || SD_WATCH 23 | // Filter the same frame in `_UIAnimatedImage`. 24 | frameCount = image.images.count > 1 ? [NSSet setWithArray:image.images].count : 1; 25 | #endif 26 | NSUInteger cost = bytesPerFrame * frameCount; 27 | return cost; 28 | } 29 | 30 | @implementation UIImage (MemoryCacheCost) 31 | 32 | - (NSUInteger)sd_memoryCost { 33 | NSNumber *value = objc_getAssociatedObject(self, @selector(sd_memoryCost)); 34 | NSUInteger memoryCost; 35 | if (value != nil) { 36 | memoryCost = [value unsignedIntegerValue]; 37 | } else { 38 | memoryCost = SDMemoryCacheCostForImage(self); 39 | } 40 | return memoryCost; 41 | } 42 | 43 | - (void)setSd_memoryCost:(NSUInteger)sd_memoryCost { 44 | objc_setAssociatedObject(self, @selector(sd_memoryCost), @(sd_memoryCost), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/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 | /** 13 | UIImage category for convenient image format decoding/encoding. 14 | */ 15 | @interface UIImage (MultiFormat) 16 | #pragma mark - Decode 17 | /** 18 | Create and decode a image with the specify image data 19 | 20 | @param data The image data 21 | @return The created image 22 | */ 23 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data; 24 | 25 | /** 26 | Create and decode a image with the specify image data and scale 27 | 28 | @param data The image data 29 | @param scale The image scale factor. Should be greater than or equal to 1.0. 30 | @return The created image 31 | */ 32 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale; 33 | 34 | /** 35 | Create and decode a image with the specify image data and scale, allow specify animate/static control 36 | 37 | @param data The image data 38 | @param scale The image scale factor. Should be greater than or equal to 1.0. 39 | @param firstFrameOnly Even if the image data is animated image format, decode the first frame only as static image. 40 | @return The created image 41 | */ 42 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale firstFrameOnly:(BOOL)firstFrameOnly; 43 | 44 | #pragma mark - Encode 45 | /** 46 | Encode the current image to the data, the image format is unspecified 47 | 48 | @note If the receiver is `SDAnimatedImage`, this will return the animated image data if available. No more extra encoding process. 49 | @return The encoded data. If can't encode, return nil 50 | */ 51 | - (nullable NSData *)sd_imageData; 52 | 53 | /** 54 | Encode the current image to data with the specify image format 55 | 56 | @param imageFormat The specify image format 57 | @return The encoded data. If can't encode, return nil 58 | */ 59 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat NS_SWIFT_NAME(sd_imageData(as:)); 60 | 61 | /** 62 | Encode the current image to data with the specify image format and compression quality 63 | 64 | @param imageFormat The specify image format 65 | @param compressionQuality The quality of the resulting image data. Value between 0.0-1.0. Some coders may not support compression quality. 66 | @return The encoded data. If can't encode, return nil 67 | */ 68 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality NS_SWIFT_NAME(sd_imageData(as:compressionQuality:)); 69 | 70 | /** 71 | Encode the current image to data with the specify image format and compression quality, allow specify animate/static control 72 | 73 | @param imageFormat The specify image format 74 | @param compressionQuality The quality of the resulting image data. Value between 0.0-1.0. Some coders may not support compression quality. 75 | @param firstFrameOnly Even if the image is animated image, encode the first frame only as static image. 76 | @return The encoded data. If can't encode, return nil 77 | */ 78 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality firstFrameOnly:(BOOL)firstFrameOnly NS_SWIFT_NAME(sd_imageData(as:compressionQuality:firstFrameOnly:)); 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/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 "SDImageCodersManager.h" 11 | 12 | @implementation UIImage (MultiFormat) 13 | 14 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data { 15 | return [self sd_imageWithData:data scale:1]; 16 | } 17 | 18 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale { 19 | return [self sd_imageWithData:data scale:scale firstFrameOnly:NO]; 20 | } 21 | 22 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale firstFrameOnly:(BOOL)firstFrameOnly { 23 | if (!data) { 24 | return nil; 25 | } 26 | SDImageCoderOptions *options = @{SDImageCoderDecodeScaleFactor : @(MAX(scale, 1)), SDImageCoderDecodeFirstFrameOnly : @(firstFrameOnly)}; 27 | return [[SDImageCodersManager sharedManager] decodedImageWithData:data options:options]; 28 | } 29 | 30 | - (nullable NSData *)sd_imageData { 31 | return [self sd_imageDataAsFormat:SDImageFormatUndefined]; 32 | } 33 | 34 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat { 35 | return [self sd_imageDataAsFormat:imageFormat compressionQuality:1]; 36 | } 37 | 38 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality { 39 | return [self sd_imageDataAsFormat:imageFormat compressionQuality:compressionQuality firstFrameOnly:NO]; 40 | } 41 | 42 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality firstFrameOnly:(BOOL)firstFrameOnly { 43 | SDImageCoderOptions *options = @{SDImageCoderEncodeCompressionQuality : @(compressionQuality), SDImageCoderEncodeFirstFrameOnly : @(firstFrameOnly)}; 44 | return [[SDImageCodersManager sharedManager] encodedDataWithImage:self format:imageFormat options:options]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/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 | #import "SDWebImageOperation.h" 11 | 12 | /** 13 | These methods are used to support canceling for UIView image loading, it's designed to be used internal but not external. 14 | All the stored operations are weak, so it will be dealloced after image loading finished. If you need to store operations, use your own class to keep a strong reference for them. 15 | */ 16 | @interface UIView (WebCacheOperation) 17 | 18 | /** 19 | * Get the image load operation for key 20 | * 21 | * @param key key for identifying the operations 22 | * @return the image load operation 23 | */ 24 | - (nullable id)sd_imageLoadOperationForKey:(nullable NSString *)key; 25 | 26 | /** 27 | * Set the image load operation (storage in a UIView based weak map table) 28 | * 29 | * @param operation the operation 30 | * @param key key for storing the operation 31 | */ 32 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; 33 | 34 | /** 35 | * Cancel the operation for the current UIView and key 36 | * 37 | * @param key key for identifying the operations 38 | */ 39 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; 40 | 41 | /** 42 | * Just remove the operation corresponding to the current UIView and key without cancelling them 43 | * 44 | * @param key key for identifying the operations 45 | */ 46 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Core/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 | #import "objc/runtime.h" 11 | 12 | // key is strong, value is weak because operation instance is retained by SDWebImageManager's runningOperations property 13 | // we should use lock to keep thread-safe because these method may not be accessed from main queue 14 | typedef NSMapTable> SDOperationsDictionary; 15 | 16 | @implementation UIView (WebCacheOperation) 17 | 18 | - (SDOperationsDictionary *)sd_operationDictionary { 19 | @synchronized(self) { 20 | SDOperationsDictionary *operations = objc_getAssociatedObject(self, @selector(sd_operationDictionary)); 21 | if (operations) { 22 | return operations; 23 | } 24 | operations = [[NSMapTable alloc] initWithKeyOptions:NSPointerFunctionsStrongMemory valueOptions:NSPointerFunctionsWeakMemory capacity:0]; 25 | objc_setAssociatedObject(self, @selector(sd_operationDictionary), operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 26 | return operations; 27 | } 28 | } 29 | 30 | - (nullable id)sd_imageLoadOperationForKey:(nullable NSString *)key { 31 | id operation; 32 | if (key) { 33 | SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; 34 | @synchronized (self) { 35 | operation = [operationDictionary objectForKey:key]; 36 | } 37 | } 38 | return operation; 39 | } 40 | 41 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key { 42 | if (key) { 43 | [self sd_cancelImageLoadOperationWithKey:key]; 44 | if (operation) { 45 | SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; 46 | @synchronized (self) { 47 | [operationDictionary setObject:operation forKey:key]; 48 | } 49 | } 50 | } 51 | } 52 | 53 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key { 54 | if (key) { 55 | // Cancel in progress downloader from queue 56 | SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; 57 | id operation; 58 | 59 | @synchronized (self) { 60 | operation = [operationDictionary objectForKey:key]; 61 | } 62 | if (operation) { 63 | if ([operation conformsToProtocol:@protocol(SDWebImageOperation)]) { 64 | [operation cancel]; 65 | } 66 | @synchronized (self) { 67 | [operationDictionary removeObjectForKey:key]; 68 | } 69 | } 70 | } 71 | } 72 | 73 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key { 74 | if (key) { 75 | SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; 76 | @synchronized (self) { 77 | [operationDictionary removeObjectForKey:key]; 78 | } 79 | } 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/NSBezierPath+SDRoundedCorners.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 "UIImage+Transform.h" 14 | 15 | @interface NSBezierPath (SDRoundedCorners) 16 | 17 | /** 18 | Convenience way to create a bezier path with the specify rounding corners on macOS. Same as the one on `UIBezierPath`. 19 | */ 20 | + (nonnull instancetype)sd_bezierPathWithRoundedRect:(NSRect)rect byRoundingCorners:(SDRectCorner)corners cornerRadius:(CGFloat)cornerRadius; 21 | 22 | @end 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/NSBezierPath+SDRoundedCorners.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 "NSBezierPath+SDRoundedCorners.h" 10 | 11 | #if SD_MAC 12 | 13 | @implementation NSBezierPath (SDRoundedCorners) 14 | 15 | + (instancetype)sd_bezierPathWithRoundedRect:(NSRect)rect byRoundingCorners:(SDRectCorner)corners cornerRadius:(CGFloat)cornerRadius { 16 | NSBezierPath *path = [NSBezierPath bezierPath]; 17 | 18 | CGFloat maxCorner = MIN(NSWidth(rect), NSHeight(rect)) / 2; 19 | 20 | CGFloat topLeftRadius = MIN(maxCorner, (corners & SDRectCornerTopLeft) ? cornerRadius : 0); 21 | CGFloat topRightRadius = MIN(maxCorner, (corners & SDRectCornerTopRight) ? cornerRadius : 0); 22 | CGFloat bottomLeftRadius = MIN(maxCorner, (corners & SDRectCornerBottomLeft) ? cornerRadius : 0); 23 | CGFloat bottomRightRadius = MIN(maxCorner, (corners & SDRectCornerBottomRight) ? cornerRadius : 0); 24 | 25 | NSPoint topLeft = NSMakePoint(NSMinX(rect), NSMaxY(rect)); 26 | NSPoint topRight = NSMakePoint(NSMaxX(rect), NSMaxY(rect)); 27 | NSPoint bottomLeft = NSMakePoint(NSMinX(rect), NSMinY(rect)); 28 | NSPoint bottomRight = NSMakePoint(NSMaxX(rect), NSMinY(rect)); 29 | 30 | [path moveToPoint:NSMakePoint(NSMidX(rect), NSMaxY(rect))]; 31 | [path appendBezierPathWithArcFromPoint:topLeft toPoint:bottomLeft radius:topLeftRadius]; 32 | [path appendBezierPathWithArcFromPoint:bottomLeft toPoint:bottomRight radius:bottomLeftRadius]; 33 | [path appendBezierPathWithArcFromPoint:bottomRight toPoint:topRight radius:bottomRightRadius]; 34 | [path appendBezierPathWithArcFromPoint:topRight toPoint:topLeft radius:topRightRadius]; 35 | [path closePath]; 36 | 37 | return path; 38 | } 39 | 40 | @end 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDAssociatedObject.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 | /// Copy the associated object from source image to target image. The associated object including all the category read/write properties. 12 | /// @param source source 13 | /// @param target target 14 | FOUNDATION_EXPORT void SDImageCopyAssociatedObject(UIImage * _Nullable source, UIImage * _Nullable target); 15 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDAssociatedObject.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 "SDAssociatedObject.h" 10 | #import "UIImage+Metadata.h" 11 | #import "UIImage+ExtendedCacheData.h" 12 | #import "UIImage+MemoryCacheCost.h" 13 | #import "UIImage+ForceDecode.h" 14 | 15 | void SDImageCopyAssociatedObject(UIImage * _Nullable source, UIImage * _Nullable target) { 16 | if (!source || !target) { 17 | return; 18 | } 19 | // Image Metadata 20 | target.sd_isIncremental = source.sd_isIncremental; 21 | target.sd_decodeOptions = source.sd_decodeOptions; 22 | target.sd_imageLoopCount = source.sd_imageLoopCount; 23 | target.sd_imageFormat = source.sd_imageFormat; 24 | // Force Decode 25 | target.sd_isDecoded = source.sd_isDecoded; 26 | // Extended Cache Data 27 | target.sd_extendedObject = source.sd_extendedObject; 28 | } 29 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDAsyncBlockOperation.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 | @class SDAsyncBlockOperation; 12 | typedef void (^SDAsyncBlock)(SDAsyncBlockOperation * __nonnull asyncOperation); 13 | 14 | /// A async block operation, success after you call `completer` (not like `NSBlockOperation` which is for sync block, success on return) 15 | @interface SDAsyncBlockOperation : NSOperation 16 | 17 | - (nonnull instancetype)initWithBlock:(nonnull SDAsyncBlock)block; 18 | + (nonnull instancetype)blockOperationWithBlock:(nonnull SDAsyncBlock)block; 19 | - (void)complete; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDAsyncBlockOperation.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 "SDAsyncBlockOperation.h" 10 | 11 | @interface SDAsyncBlockOperation () 12 | 13 | @property (assign, nonatomic, getter = isExecuting) BOOL executing; 14 | @property (assign, nonatomic, getter = isFinished) BOOL finished; 15 | @property (nonatomic, copy, nonnull) SDAsyncBlock executionBlock; 16 | 17 | @end 18 | 19 | @implementation SDAsyncBlockOperation 20 | 21 | @synthesize executing = _executing; 22 | @synthesize finished = _finished; 23 | 24 | - (nonnull instancetype)initWithBlock:(nonnull SDAsyncBlock)block { 25 | self = [super init]; 26 | if (self) { 27 | self.executionBlock = block; 28 | } 29 | return self; 30 | } 31 | 32 | + (nonnull instancetype)blockOperationWithBlock:(nonnull SDAsyncBlock)block { 33 | SDAsyncBlockOperation *operation = [[SDAsyncBlockOperation alloc] initWithBlock:block]; 34 | return operation; 35 | } 36 | 37 | - (void)start { 38 | @synchronized (self) { 39 | if (self.isCancelled) { 40 | self.finished = YES; 41 | return; 42 | } 43 | 44 | self.finished = NO; 45 | self.executing = YES; 46 | 47 | if (self.executionBlock) { 48 | self.executionBlock(self); 49 | } else { 50 | self.executing = NO; 51 | self.finished = YES; 52 | } 53 | } 54 | } 55 | 56 | - (void)cancel { 57 | @synchronized (self) { 58 | [super cancel]; 59 | if (self.isExecuting) { 60 | self.executing = NO; 61 | self.finished = YES; 62 | } 63 | } 64 | } 65 | 66 | 67 | - (void)complete { 68 | @synchronized (self) { 69 | if (self.isExecuting) { 70 | self.finished = YES; 71 | self.executing = NO; 72 | } 73 | } 74 | } 75 | 76 | - (void)setFinished:(BOOL)finished { 77 | [self willChangeValueForKey:@"isFinished"]; 78 | _finished = finished; 79 | [self didChangeValueForKey:@"isFinished"]; 80 | } 81 | 82 | - (void)setExecuting:(BOOL)executing { 83 | [self willChangeValueForKey:@"isExecuting"]; 84 | _executing = executing; 85 | [self didChangeValueForKey:@"isExecuting"]; 86 | } 87 | 88 | - (BOOL)isConcurrent { 89 | return YES; 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDDeviceHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | /// Device information helper methods 13 | @interface SDDeviceHelper : NSObject 14 | 15 | + (NSUInteger)totalMemory; 16 | + (NSUInteger)freeMemory; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDDeviceHelper.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 "SDDeviceHelper.h" 10 | #import 11 | 12 | @implementation SDDeviceHelper 13 | 14 | + (NSUInteger)totalMemory { 15 | return (NSUInteger)[[NSProcessInfo processInfo] physicalMemory]; 16 | } 17 | 18 | + (NSUInteger)freeMemory { 19 | mach_port_t host_port = mach_host_self(); 20 | mach_msg_type_number_t host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t); 21 | vm_size_t page_size; 22 | vm_statistics_data_t vm_stat; 23 | kern_return_t kern; 24 | 25 | kern = host_page_size(host_port, &page_size); 26 | if (kern != KERN_SUCCESS) return 0; 27 | kern = host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size); 28 | if (kern != KERN_SUCCESS) return 0; 29 | return vm_stat.free_count * page_size; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDDisplayLink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | /// Cross-platform display link wrapper. Do not retain the target 13 | /// Use `CADisplayLink` on iOS/tvOS, `CVDisplayLink` on macOS, `NSTimer` on watchOS 14 | @interface SDDisplayLink : NSObject 15 | 16 | @property (readonly, nonatomic, weak, nullable) id target; 17 | @property (readonly, nonatomic, assign, nonnull) SEL selector; 18 | @property (readonly, nonatomic) CFTimeInterval duration; 19 | @property (readonly, nonatomic) BOOL isRunning; 20 | 21 | + (nonnull instancetype)displayLinkWithTarget:(nonnull id)target selector:(nonnull SEL)sel; 22 | 23 | - (void)addToRunLoop:(nonnull NSRunLoop *)runloop forMode:(nonnull NSRunLoopMode)mode; 24 | - (void)removeFromRunLoop:(nonnull NSRunLoop *)runloop forMode:(nonnull NSRunLoopMode)mode; 25 | 26 | - (void)start; 27 | - (void)stop; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDFileAttributeHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // This file is from https://gist.github.com/zydeco/6292773 3 | // 4 | // Created by Jesús A. Álvarez on 2008-12-17. 5 | // Copyright 2008-2009 namedfork.net. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | /// File Extended Attribute (xattr) helper methods 11 | @interface SDFileAttributeHelper : NSObject 12 | 13 | + (nullable NSArray *)extendedAttributeNamesAtPath:(nonnull NSString *)path traverseLink:(BOOL)follow error:(NSError * _Nullable * _Nullable)err; 14 | + (BOOL)hasExtendedAttribute:(nonnull NSString *)name atPath:(nonnull NSString *)path traverseLink:(BOOL)follow error:(NSError * _Nullable * _Nullable)err; 15 | + (nullable NSData *)extendedAttribute:(nonnull NSString *)name atPath:(nonnull NSString *)path traverseLink:(BOOL)follow error:(NSError * _Nullable * _Nullable)err; 16 | + (BOOL)setExtendedAttribute:(nonnull NSString *)name value:(nonnull NSData *)value atPath:(nonnull NSString *)path traverseLink:(BOOL)follow overwrite:(BOOL)overwrite error:(NSError * _Nullable * _Nullable)err; 17 | + (BOOL)removeExtendedAttribute:(nonnull NSString *)name atPath:(nonnull NSString *)path traverseLink:(BOOL)follow error:(NSError * _Nullable * _Nullable)err; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDImageAssetManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | /// A Image-Asset manager to work like UIKit/AppKit's image cache behavior 13 | /// Apple parse the Asset Catalog compiled file(`Assets.car`) by CoreUI.framework, however it's a private framework and there are no other ways to directly get the data. So we just process the normal bundle files :) 14 | @interface SDImageAssetManager : NSObject 15 | 16 | @property (nonatomic, strong, nonnull) NSMapTable *imageTable; 17 | 18 | + (nonnull instancetype)sharedAssetManager; 19 | - (nullable NSString *)getPathForName:(nonnull NSString *)name bundle:(nonnull NSBundle *)bundle preferredScale:(nonnull CGFloat *)scale; 20 | - (nullable UIImage *)imageForName:(nonnull NSString *)name; 21 | - (void)storeImage:(nonnull UIImage *)image forName:(nonnull NSString *)name; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDImageCachesManagerOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | /// This is used for operation management, but not for operation queue execute 13 | @interface SDImageCachesManagerOperation : NSOperation 14 | 15 | @property (nonatomic, assign, readonly) NSUInteger pendingCount; 16 | 17 | - (void)beginWithTotalCount:(NSUInteger)totalCount; 18 | - (void)completeOne; 19 | - (void)done; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDImageCachesManagerOperation.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 "SDImageCachesManagerOperation.h" 10 | #import "SDInternalMacros.h" 11 | 12 | @implementation SDImageCachesManagerOperation { 13 | SD_LOCK_DECLARE(_pendingCountLock); 14 | } 15 | 16 | @synthesize executing = _executing; 17 | @synthesize finished = _finished; 18 | @synthesize cancelled = _cancelled; 19 | @synthesize pendingCount = _pendingCount; 20 | 21 | - (instancetype)init { 22 | if (self = [super init]) { 23 | SD_LOCK_INIT(_pendingCountLock); 24 | _pendingCount = 0; 25 | } 26 | return self; 27 | } 28 | 29 | - (void)beginWithTotalCount:(NSUInteger)totalCount { 30 | self.executing = YES; 31 | self.finished = NO; 32 | _pendingCount = totalCount; 33 | } 34 | 35 | - (NSUInteger)pendingCount { 36 | SD_LOCK(_pendingCountLock); 37 | NSUInteger pendingCount = _pendingCount; 38 | SD_UNLOCK(_pendingCountLock); 39 | return pendingCount; 40 | } 41 | 42 | - (void)completeOne { 43 | SD_LOCK(_pendingCountLock); 44 | _pendingCount = _pendingCount > 0 ? _pendingCount - 1 : 0; 45 | SD_UNLOCK(_pendingCountLock); 46 | } 47 | 48 | - (void)cancel { 49 | self.cancelled = YES; 50 | [self reset]; 51 | } 52 | 53 | - (void)done { 54 | self.finished = YES; 55 | self.executing = NO; 56 | [self reset]; 57 | } 58 | 59 | - (void)reset { 60 | SD_LOCK(_pendingCountLock); 61 | _pendingCount = 0; 62 | SD_UNLOCK(_pendingCountLock); 63 | } 64 | 65 | - (void)setFinished:(BOOL)finished { 66 | [self willChangeValueForKey:@"isFinished"]; 67 | _finished = finished; 68 | [self didChangeValueForKey:@"isFinished"]; 69 | } 70 | 71 | - (void)setExecuting:(BOOL)executing { 72 | [self willChangeValueForKey:@"isExecuting"]; 73 | _executing = executing; 74 | [self didChangeValueForKey:@"isExecuting"]; 75 | } 76 | 77 | - (void)setCancelled:(BOOL)cancelled { 78 | [self willChangeValueForKey:@"isCancelled"]; 79 | _cancelled = cancelled; 80 | [self didChangeValueForKey:@"isCancelled"]; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDImageIOAnimatedCoderInternal.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 "SDImageIOAnimatedCoder.h" 11 | 12 | // AVFileTypeHEIC/AVFileTypeHEIF is defined in AVFoundation via iOS 11, we use this without import AVFoundation 13 | #define kSDUTTypeHEIC ((__bridge CFStringRef)@"public.heic") 14 | #define kSDUTTypeHEIF ((__bridge CFStringRef)@"public.heif") 15 | // HEIC Sequence (Animated Image) 16 | #define kSDUTTypeHEICS ((__bridge CFStringRef)@"public.heics") 17 | // kSDUTTypeWebP seems not defined in public UTI framework, Apple use the hardcode string, we define them :) 18 | #define kSDUTTypeWebP ((__bridge CFStringRef)@"org.webmproject.webp") 19 | 20 | #define kSDUTTypeImage ((__bridge CFStringRef)@"public.image") 21 | #define kSDUTTypeJPEG ((__bridge CFStringRef)@"public.jpeg") 22 | #define kSDUTTypePNG ((__bridge CFStringRef)@"public.png") 23 | #define kSDUTTypeTIFF ((__bridge CFStringRef)@"public.tiff") 24 | #define kSDUTTypeSVG ((__bridge CFStringRef)@"public.svg-image") 25 | #define kSDUTTypeGIF ((__bridge CFStringRef)@"com.compuserve.gif") 26 | #define kSDUTTypePDF ((__bridge CFStringRef)@"com.adobe.pdf") 27 | 28 | @interface SDImageIOAnimatedCoder () 29 | 30 | + (NSTimeInterval)frameDurationAtIndex:(NSUInteger)index source:(nonnull CGImageSourceRef)source; 31 | + (NSUInteger)imageLoopCountWithSource:(nonnull CGImageSourceRef)source; 32 | + (nullable UIImage *)createFrameAtIndex:(NSUInteger)index source:(nonnull CGImageSourceRef)source scale:(CGFloat)scale preserveAspectRatio:(BOOL)preserveAspectRatio thumbnailSize:(CGSize)thumbnailSize options:(nullable NSDictionary *)options; 33 | + (BOOL)canEncodeToFormat:(SDImageFormat)format; 34 | + (BOOL)canDecodeFromFormat:(SDImageFormat)format; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDInternalMacros.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 "SDInternalMacros.h" 10 | 11 | void sd_executeCleanupBlock (__strong sd_cleanupBlock_t *block) { 12 | (*block)(); 13 | } 14 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDWeakProxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | /// A weak proxy which forward all the message to the target 13 | @interface SDWeakProxy : NSProxy 14 | 15 | @property (nonatomic, weak, readonly, nullable) id target; 16 | 17 | - (nonnull instancetype)initWithTarget:(nonnull id)target; 18 | + (nonnull instancetype)proxyWithTarget:(nonnull id)target; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDWeakProxy.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 "SDWeakProxy.h" 10 | 11 | @implementation SDWeakProxy 12 | 13 | - (instancetype)initWithTarget:(id)target { 14 | _target = target; 15 | return self; 16 | } 17 | 18 | + (instancetype)proxyWithTarget:(id)target { 19 | return [[SDWeakProxy alloc] initWithTarget:target]; 20 | } 21 | 22 | - (id)forwardingTargetForSelector:(SEL)selector { 23 | return _target; 24 | } 25 | 26 | - (void)forwardInvocation:(NSInvocation *)invocation { 27 | void *null = NULL; 28 | [invocation setReturnValue:&null]; 29 | } 30 | 31 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector { 32 | return [NSObject instanceMethodSignatureForSelector:@selector(init)]; 33 | } 34 | 35 | - (BOOL)respondsToSelector:(SEL)aSelector { 36 | return [_target respondsToSelector:aSelector]; 37 | } 38 | 39 | - (BOOL)isEqual:(id)object { 40 | return [_target isEqual:object]; 41 | } 42 | 43 | - (NSUInteger)hash { 44 | return [_target hash]; 45 | } 46 | 47 | - (Class)superclass { 48 | return [_target superclass]; 49 | } 50 | 51 | - (Class)class { 52 | return [_target class]; 53 | } 54 | 55 | - (BOOL)isKindOfClass:(Class)aClass { 56 | return [_target isKindOfClass:aClass]; 57 | } 58 | 59 | - (BOOL)isMemberOfClass:(Class)aClass { 60 | return [_target isMemberOfClass:aClass]; 61 | } 62 | 63 | - (BOOL)conformsToProtocol:(Protocol *)aProtocol { 64 | return [_target conformsToProtocol:aProtocol]; 65 | } 66 | 67 | - (BOOL)isProxy { 68 | return YES; 69 | } 70 | 71 | - (NSString *)description { 72 | return [_target description]; 73 | } 74 | 75 | - (NSString *)debugDescription { 76 | return [_target debugDescription]; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/SDWebImageTransitionInternal.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 | /// Helper method for Core Animation transition 16 | FOUNDATION_EXPORT CAMediaTimingFunction * _Nullable SDTimingFunctionFromAnimationOptions(SDWebImageAnimationOptions options); 17 | FOUNDATION_EXPORT CATransition * _Nullable SDTransitionFromAnimationOptions(SDWebImageAnimationOptions options); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/UIColor+SDHexString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | @interface UIColor (SDHexString) 12 | 13 | /** 14 | Convenience way to get hex string from color. The output should always be 32-bit RGBA hex string like `#00000000`. 15 | */ 16 | @property (nonatomic, copy, readonly, nonnull) NSString *sd_hexString; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/Private/UIColor+SDHexString.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 "UIColor+SDHexString.h" 10 | 11 | @implementation UIColor (SDHexString) 12 | 13 | - (NSString *)sd_hexString { 14 | CGFloat red, green, blue, alpha; 15 | #if SD_UIKIT 16 | if (![self getRed:&red green:&green blue:&blue alpha:&alpha]) { 17 | [self getWhite:&red alpha:&alpha]; 18 | green = red; 19 | blue = red; 20 | } 21 | #else 22 | @try { 23 | [self getRed:&red green:&green blue:&blue alpha:&alpha]; 24 | } 25 | @catch (NSException *exception) { 26 | [self getWhite:&red alpha:&alpha]; 27 | green = red; 28 | blue = red; 29 | } 30 | #endif 31 | 32 | red = roundf(red * 255.f); 33 | green = roundf(green * 255.f); 34 | blue = roundf(blue * 255.f); 35 | alpha = roundf(alpha * 255.f); 36 | 37 | uint hex = ((uint)alpha << 24) | ((uint)red << 16) | ((uint)green << 8) | ((uint)blue); 38 | 39 | return [NSString stringWithFormat:@"#%08x", hex]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJExtension/MJExtension-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 | FMWK 17 | CFBundleShortVersionString 18 | 3.4.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJExtension/MJExtension-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MJExtension : NSObject 3 | @end 4 | @implementation PodsDummy_MJExtension 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJExtension/MJExtension-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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJExtension/MJExtension-umbrella.h: -------------------------------------------------------------------------------- 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 | #import "MJExtension.h" 14 | #import "MJExtensionConst.h" 15 | #import "MJFoundation.h" 16 | #import "MJProperty.h" 17 | #import "MJPropertyKey.h" 18 | #import "MJPropertyType.h" 19 | #import "NSObject+MJClass.h" 20 | #import "NSObject+MJCoding.h" 21 | #import "NSObject+MJKeyValue.h" 22 | #import "NSObject+MJProperty.h" 23 | #import "NSString+MJExtension.h" 24 | 25 | FOUNDATION_EXPORT double MJExtensionVersionNumber; 26 | FOUNDATION_EXPORT const unsigned char MJExtensionVersionString[]; 27 | 28 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJExtension/MJExtension.modulemap: -------------------------------------------------------------------------------- 1 | framework module MJExtension { 2 | umbrella header "MJExtension-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJExtension/MJExtension.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MJExtension 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_ROOT = ${SRCROOT} 6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/MJExtension 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Example/Pods-XMultiTabModule-iOS_Example-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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Example/Pods-XMultiTabModule-iOS_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_XMultiTabModule_iOS_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_XMultiTabModule_iOS_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Example/Pods-XMultiTabModule-iOS_Example-umbrella.h: -------------------------------------------------------------------------------- 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 | 14 | FOUNDATION_EXPORT double Pods_XMultiTabModule_iOS_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_XMultiTabModule_iOS_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Example/Pods-XMultiTabModule-iOS_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/XMultiTabModule-iOS" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension/MJExtension.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/XMultiTabModule-iOS/XMultiTabModule_iOS.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "MJExtension" -framework "SDWebImage" -framework "XMultiTabModule_iOS" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Example/Pods-XMultiTabModule-iOS_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_XMultiTabModule_iOS_Example { 2 | umbrella header "Pods-XMultiTabModule-iOS_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Example/Pods-XMultiTabModule-iOS_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/XMultiTabModule-iOS" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension/MJExtension.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/XMultiTabModule-iOS/XMultiTabModule_iOS.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "MJExtension" -framework "SDWebImage" -framework "XMultiTabModule_iOS" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Tests/Pods-XMultiTabModule-iOS_Tests-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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Tests/Pods-XMultiTabModule-iOS_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Tests/Pods-XMultiTabModule-iOS_Tests-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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Tests/Pods-XMultiTabModule-iOS_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_XMultiTabModule_iOS_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_XMultiTabModule_iOS_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Tests/Pods-XMultiTabModule-iOS_Tests-umbrella.h: -------------------------------------------------------------------------------- 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 | 14 | FOUNDATION_EXPORT double Pods_XMultiTabModule_iOS_TestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_XMultiTabModule_iOS_TestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Tests/Pods-XMultiTabModule-iOS_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/XMultiTabModule-iOS" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension/MJExtension.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/XMultiTabModule-iOS/XMultiTabModule_iOS.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "MJExtension" -framework "SDWebImage" -framework "XMultiTabModule_iOS" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Tests/Pods-XMultiTabModule-iOS_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_XMultiTabModule_iOS_Tests { 2 | umbrella header "Pods-XMultiTabModule-iOS_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-XMultiTabModule-iOS_Tests/Pods-XMultiTabModule-iOS_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" "${PODS_CONFIGURATION_BUILD_DIR}/XMultiTabModule-iOS" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MJExtension/MJExtension.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/XMultiTabModule-iOS/XMultiTabModule_iOS.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "ImageIO" -framework "MJExtension" -framework "SDWebImage" -framework "XMultiTabModule_iOS" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SDWebImage/SDWebImage-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 | FMWK 17 | CFBundleShortVersionString 18 | 5.13.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SDWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_SDWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /Example/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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h: -------------------------------------------------------------------------------- 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 | #import "NSButton+WebCache.h" 14 | #import "NSData+ImageContentType.h" 15 | #import "NSImage+Compatibility.h" 16 | #import "SDAnimatedImage.h" 17 | #import "SDAnimatedImagePlayer.h" 18 | #import "SDAnimatedImageRep.h" 19 | #import "SDAnimatedImageView+WebCache.h" 20 | #import "SDAnimatedImageView.h" 21 | #import "SDDiskCache.h" 22 | #import "SDGraphicsImageRenderer.h" 23 | #import "SDImageAPNGCoder.h" 24 | #import "SDImageAWebPCoder.h" 25 | #import "SDImageCache.h" 26 | #import "SDImageCacheConfig.h" 27 | #import "SDImageCacheDefine.h" 28 | #import "SDImageCachesManager.h" 29 | #import "SDImageCoder.h" 30 | #import "SDImageCoderHelper.h" 31 | #import "SDImageCodersManager.h" 32 | #import "SDImageFrame.h" 33 | #import "SDImageGIFCoder.h" 34 | #import "SDImageGraphics.h" 35 | #import "SDImageHEICCoder.h" 36 | #import "SDImageIOAnimatedCoder.h" 37 | #import "SDImageIOCoder.h" 38 | #import "SDImageLoader.h" 39 | #import "SDImageLoadersManager.h" 40 | #import "SDImageTransformer.h" 41 | #import "SDMemoryCache.h" 42 | #import "SDWebImageCacheKeyFilter.h" 43 | #import "SDWebImageCacheSerializer.h" 44 | #import "SDWebImageCompat.h" 45 | #import "SDWebImageDefine.h" 46 | #import "SDWebImageDownloader.h" 47 | #import "SDWebImageDownloaderConfig.h" 48 | #import "SDWebImageDownloaderDecryptor.h" 49 | #import "SDWebImageDownloaderOperation.h" 50 | #import "SDWebImageDownloaderRequestModifier.h" 51 | #import "SDWebImageDownloaderResponseModifier.h" 52 | #import "SDWebImageError.h" 53 | #import "SDWebImageIndicator.h" 54 | #import "SDWebImageManager.h" 55 | #import "SDWebImageOperation.h" 56 | #import "SDWebImageOptionsProcessor.h" 57 | #import "SDWebImagePrefetcher.h" 58 | #import "SDWebImageTransition.h" 59 | #import "UIButton+WebCache.h" 60 | #import "UIImage+ExtendedCacheData.h" 61 | #import "UIImage+ForceDecode.h" 62 | #import "UIImage+GIF.h" 63 | #import "UIImage+MemoryCacheCost.h" 64 | #import "UIImage+Metadata.h" 65 | #import "UIImage+MultiFormat.h" 66 | #import "UIImage+Transform.h" 67 | #import "UIImageView+HighlightedWebCache.h" 68 | #import "UIImageView+WebCache.h" 69 | #import "UIView+WebCache.h" 70 | #import "UIView+WebCacheOperation.h" 71 | #import "SDWebImage.h" 72 | 73 | FOUNDATION_EXPORT double SDWebImageVersionNumber; 74 | FOUNDATION_EXPORT const unsigned char SDWebImageVersionString[]; 75 | 76 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap: -------------------------------------------------------------------------------- 1 | framework module SDWebImage { 2 | umbrella header "SDWebImage-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage 2 | DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -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 | SUPPORTS_MACCATALYST = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/XMultiTabModule-iOS/XMultiTabModule-iOS-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 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/XMultiTabModule-iOS/XMultiTabModule-iOS-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_XMultiTabModule_iOS : NSObject 3 | @end 4 | @implementation PodsDummy_XMultiTabModule_iOS 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/XMultiTabModule-iOS/XMultiTabModule-iOS-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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/XMultiTabModule-iOS/XMultiTabModule-iOS-umbrella.h: -------------------------------------------------------------------------------- 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 | #import "NSArray+SSSSafe.h" 14 | #import "SSSMultiTabController.h" 15 | #import "SSSMutableTabContainerHelper.h" 16 | #import "SSSTabModel.h" 17 | #import "SSSUtils.h" 18 | #import "UIColor+SSS.h" 19 | 20 | FOUNDATION_EXPORT double XMultiTabModule_iOSVersionNumber; 21 | FOUNDATION_EXPORT const unsigned char XMultiTabModule_iOSVersionString[]; 22 | 23 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/XMultiTabModule-iOS/XMultiTabModule-iOS.modulemap: -------------------------------------------------------------------------------- 1 | framework module XMultiTabModule_iOS { 2 | umbrella header "XMultiTabModule-iOS-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/XMultiTabModule-iOS/XMultiTabModule-iOS.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/XMultiTabModule-iOS 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Tests/Tests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // XMultiTabModule-iOSTests.m 3 | // XMultiTabModule-iOSTests 4 | // 5 | // Created by lixianke1 on 08/31/2022. 6 | // Copyright (c) 2022 lixianke1. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/JDBAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // JDBAppDelegate.h 3 | // XMultiTabModule-iOS 4 | // 5 | // Created by lixianke1 on 08/23/2022. 6 | // Copyright (c) 2022 lixianke1. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface JDBAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/JDBMultiTabModule-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/JDBMultiTabModule-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/JDBTabLoader.h: -------------------------------------------------------------------------------- 1 | // 2 | // JDBTabLoader.h 3 | // JDBMultiTabModule_Example 4 | // 5 | // Created by lixianke1 on 2022/8/26. 6 | // Copyright © 2022 lixianke1. All rights reserved. 7 | // 8 | 9 | #import 10 | @import XMultiTabModule_iOS; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface JDBTabLoader : NSObject 15 | 16 | + (instancetype)sharedLoader; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/JDBTabLoader.m: -------------------------------------------------------------------------------- 1 | // 2 | // JDBTabLoader.m 3 | // JDBMultiTabModule_Example 4 | // 5 | // Created by lixianke1 on 2022/8/26. 6 | // Copyright © 2022 lixianke1. All rights reserved. 7 | // 8 | 9 | #import "JDBTabLoader.h" 10 | #import "JDBViewController.h" 11 | #import 12 | 13 | @implementation JDBTabLoader 14 | 15 | + (instancetype)sharedLoader { 16 | static JDBTabLoader *loader = nil; 17 | static dispatch_once_t onceToken; 18 | dispatch_once(&onceToken, ^{ 19 | loader = [[JDBTabLoader alloc] init]; 20 | }); 21 | 22 | return loader; 23 | } 24 | 25 | - (UIViewController *)loadNativeWithModule:(NSString *)module params:(NSString *)params { 26 | NSDictionary *paramsDict = [params mj_JSONObject]; 27 | return [[JDBViewController alloc] initWithTitle:[paramsDict objectForKey:@"title"]]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/JDBViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JDBViewController.h 3 | // XMultiTabModule-iOS 4 | // 5 | // Created by lixianke1 on 08/23/2022. 6 | // Copyright (c) 2022 lixianke1. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface JDBViewController : UIViewController 12 | 13 | - (instancetype)initWithTitle:(NSString *)title; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/JDBViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JDBViewController.m 3 | // XMultiTabModule-iOS 4 | // 5 | // Created by lixianke1 on 08/23/2022. 6 | // Copyright (c) 2022 lixianke1. All rights reserved. 7 | // 8 | 9 | #import "JDBViewController.h" 10 | #import 11 | 12 | @interface JDBViewController () 13 | 14 | @property (nonatomic, strong) UILabel *titleLabel; 15 | 16 | @end 17 | 18 | @implementation JDBViewController 19 | 20 | - (instancetype)initWithTitle:(NSString *)title { 21 | self = [super init]; 22 | if (self) { 23 | self.titleLabel.text = title; 24 | } 25 | return self; 26 | } 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | [self.view addSubview:self.titleLabel]; 32 | self.view.backgroundColor = [UIColor colorWithHex:@"#F2F2F2"]; 33 | [self.titleLabel sizeToFit]; 34 | self.titleLabel.center = self.view.center; 35 | // Do any additional setup after loading the view, typically from a nib. 36 | } 37 | 38 | - (void)didReceiveMemoryWarning 39 | { 40 | [super didReceiveMemoryWarning]; 41 | // Dispose of any resources that can be recreated. 42 | } 43 | 44 | - (UILabel *)titleLabel { 45 | if (!_titleLabel) { 46 | _titleLabel = [[UILabel alloc] init]; 47 | _titleLabel.textColor = [UIColor redColor]; 48 | _titleLabel.font = [UIFont systemFontOfSize:20]; 49 | } 50 | return _titleLabel; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/XMultiTabModule-iOS-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/XMultiTabModule-iOS-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // XMultiTabModule-iOS 4 | // 5 | // Created by lixianke1 on 08/23/2022. 6 | // Copyright (c) 2022 lixianke1. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "JDBAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([JDBAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/XMultiTabModule-iOS/tabs.json: -------------------------------------------------------------------------------- 1 | { 2 | "code": "0", 3 | "tabList": [ 4 | { 5 | "specialType": 0, 6 | "tabType": 1, 7 | "tabName": "秒杀", 8 | "tabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/48165/32/10279/8628/5d771d3fEc45fc5d7/1607c833d8ea730c.png.webp", 9 | "selectTabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/82108/15/9751/11238/5d771d59E3468fc43/f8d4b0e049316eab.png.webp", 10 | "module": "openappurl:native", 11 | "params": "{\"title\":\"秒杀\"}" 12 | }, 13 | { 14 | "specialType": 0, 15 | "tabType": 1, 16 | "tabName": "即将售罄", 17 | "tabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/44814/1/10333/7917/5d771df7Ed08aaa5a/dde189c14ba051cf.png.webp", 18 | "selectTabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/62956/36/9692/9892/5d771dd5Ee92f90a5/7f43f36f96fed72f.png.webp", 19 | "module": "openappurl:native", 20 | "params": "{\"title\":\"即将售罄\"}" 21 | }, 22 | { 23 | "specialType": 1, 24 | "tabType": 1, 25 | "tabName": "异型", 26 | "tabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/201428/18/16148/973396/626679faEe10cbb96/76b3f43dce6b16b9.png!q70.jpg.webp", 27 | "selectTabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/201444/23/9151/459069/61542b51Ea8eb99d3/6f8ef23bedefbc8a.jpg!q70.jpg.webp", 28 | "module": "openappurl:native", 29 | "params": "{\"title\":\"异型\"}" 30 | }, 31 | { 32 | "specialType": 0, 33 | "tabType": 0, 34 | "tabName": "试用", 35 | "tabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/133331/39/9421/20968/5f56f473Ea56eec27/6c42204e2b0c55f5.png.webp", 36 | "selectTabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/149846/17/7849/26015/5f56f46eE7b299731/c21c1588100f5fc7.png.webp", 37 | "link": "https://prodev.m.jd.com/mall/active/G7sQ92vWSBsTHzk4e953qUGWQJ4/index.html" 38 | }, 39 | { 40 | "specialType": 0, 41 | "tabType": 1, 42 | "tabName": "品类秒杀", 43 | "tabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/209124/8/14576/8527/61cef392E721d5c8d/a14d75499c085949.png!q70.jpg.webp", 44 | "selectTabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/218045/39/9722/8643/61cef38fEc4dbaffe/2713c583a730d4be.png!q70.jpg.webp", 45 | "module": "openappurl:native", 46 | "params": "{\"title\":\"品类秒杀\"}" 47 | } 48 | ], 49 | "tabConfig": { 50 | "selectIndex": 1, 51 | "tabBackground": "#FFFFFF" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 JD.com, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # XMultiTabModule-iOS 2 | 3 | [![CI Status](https://img.shields.io/travis/lixianke1/XMultiTabModule-iOS.svg?style=flat)](https://travis-ci.org/lixianke1/XMultiTabModule-iOS) 4 | [![Version](https://img.shields.io/cocoapods/v/XMultiTabModule-iOS.svg?style=flat)](https://cocoapods.org/pods/XMultiTabModule-iOS) 5 | [![License](https://img.shields.io/cocoapods/l/XMultiTabModule-iOS.svg?style=flat)](https://cocoapods.org/pods/XMultiTabModule-iOS) 6 | [![Platform](https://img.shields.io/cocoapods/p/XMultiTabModule-iOS.svg?style=flat)](https://cocoapods.org/pods/XMultiTabModule-iOS) 7 | 8 | XMultiTabModule-iOS是支持底部异型Tab的底部导航控制器。 9 | 10 | 通过实现SSSMultiTabDelagate中的两个代理方法,可以实现Native和Web页面的自定义加载。 11 | 12 | ## Example 13 | 14 | ![](https://img14.360buyimg.com/imagetools/jfs/t1/144209/12/26794/149293/63242ae7E1bfc645f/b34109edb29e43c9.gif) 15 | 16 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 17 | 18 | 19 | ## Usage 20 | 21 | 实现以下两个协议,分别是Web和Native页面的加载 22 | 23 | ``` 24 | @protocol SSSMultiTabDelagate 25 | 26 | @optional 27 | - (UIViewController *)loadWebWithURL:(NSString *)url; 28 | - (UIViewController *)loadNativeWithModule:(NSString *)module params:(NSString *)params; 29 | 30 | @end 31 | ``` 32 | 支持进入默认选中Tab,设置Tab的背景色 33 | 34 | ``` 35 | "tabConfig": { 36 | "selectIndex": 1, 37 | "tabBackground": "#FFFFFF" 38 | } 39 | ``` 40 | 41 | 这是单个Tab的配置 42 | ``` 43 | { 44 | "specialType": 0, // 是否是异形Tab,1 是,默认0非异形 45 | "tabType": 1, // tab类型 0是web,1是native 46 | "tabName": "品类秒杀", // tab描述 47 | "tabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/209124/8/14576/8527/61cef392E721d5c8d/a14d75499c085949.png!q70.jpg.webp", // tab非选中背景图片 48 | "selectTabImage": "https://m.360buyimg.com/seckillcms/jfs/t1/218045/39/9722/8643/61cef38fEc4dbaffe/2713c583a730d4be.png!q70.jpg.webp", // tab选中背景图片 49 | "module": "openappurl:native", // 路由 50 | "params": "{\"title\":\"品类秒杀\"}", // 传递原生容器参数,有多少传递多少 51 | "link": "https://prodev.m.jd.com/mall/active/G7sQ92vWSBsTHzk4e953qUGWQJ4/index.html" // H5链接 52 | } 53 | ``` 54 | ## Requirements 55 | 56 | iOS 9.0 57 | 58 | ## Installation 59 | 60 | XMultiTabModule-iOS is available through [CocoaPods](https://cocoapods.org). To install 61 | it, simply add the following line to your Podfile: 62 | 63 | ```ruby 64 | pod 'XMultiTabModule-iOS' 65 | ``` 66 | 67 | ## Author 68 | 69 | lixianke1, lixianke1@jd.com 70 | 71 | ## License 72 | 73 | XMultiTabModule-iOS is available under the MIT license. See the LICENSE file for more info. 74 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint XMultiTabModule-iOS.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'XMultiTabModule-iOS' 11 | s.version = '0.1.0' 12 | s.summary = 'A short description of XMultiTabModule-iOS.' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | TODO: Add long description of the pod here. 22 | DESC 23 | 24 | s.homepage = 'https://github.com/lixianke1/XMultiTabModule-iOS' 25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'lixianke1' => 'lixianke1@jd.com' } 28 | s.source = { :git => 'https://github.com/lixianke1/XMultiTabModule-iOS.git', :tag => s.version.to_s } 29 | # s.social_media_url = 'https://twitter.com/' 30 | 31 | s.ios.deployment_target = '9.0' 32 | 33 | s.source_files = 'XMultiTabModule-iOS/Classes/**/*' 34 | 35 | s.resources="XMultiTabModule-iOS/Assets/*.xcassets" 36 | 37 | s.public_header_files = 'Pod/Classes/**/*.h' 38 | s.dependency 'SDWebImage' 39 | end 40 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jd-opensource/XMultiTab-iOS/a064eadd545f588711b521b3bac6135a393384f4/XMultiTabModule-iOS/Assets/.gitkeep -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Assets/Media.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Assets/Media.xcassets/placeholder_100x100.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "placeholder_100x100@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Assets/Media.xcassets/placeholder_100x100.imageset/placeholder_100x100@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jd-opensource/XMultiTab-iOS/a064eadd545f588711b521b3bac6135a393384f4/XMultiTabModule-iOS/Assets/Media.xcassets/placeholder_100x100.imageset/placeholder_100x100@2x.png -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jd-opensource/XMultiTab-iOS/a064eadd545f588711b521b3bac6135a393384f4/XMultiTabModule-iOS/Classes/.gitkeep -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/NSArray+SSSSafe.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+SSSSafe.h 3 | // Pods 4 | // 5 | // Created by Corleone on 2021/1/14. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface NSArray (SSSSafe) 13 | - (id)sss_safeObjectAtIndex:(NSUInteger)index; 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/NSArray+SSSSafe.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+SSSSafe.m 3 | // Pods 4 | // 5 | // Created by Corleone on 2021/1/14. 6 | // 7 | 8 | #import "NSArray+SSSSafe.h" 9 | 10 | @implementation NSArray (SSSSafe) 11 | 12 | - (id)sss_safeObjectAtIndex:(NSUInteger)index 13 | { 14 | if (index < self.count) { 15 | return [self objectAtIndex:index]; 16 | } 17 | return nil; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/SSSMultiTabController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSSMultiTabController.h 3 | // JDBrandSeckillModule 4 | // 5 | // Created by 杨明 on 2022/3/28. 6 | // 7 | 8 | #import 9 | #import "SSSTabModel.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | 14 | @protocol SSSMultiTabDelagate 15 | 16 | @optional 17 | - (UIViewController *)loadWebWithURL:(NSString *)url; 18 | - (UIViewController *)loadNativeWithModule:(NSString *)module params:(NSString *)params; 19 | 20 | @end 21 | 22 | @interface SSSMultiTabController : UIViewController 23 | 24 | - (void)refreshWithTabModel:(SSSBaseTabWrapperModel *)tabModel; 25 | @property (nonatomic, weak) id delegate; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/SSSMutableTabContainerHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSSMutableTabContainerHelper.h 3 | // JDBrandSeckillModule 4 | // 5 | // Created by 杨明 on 2022/2/10. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | typedef enum : NSUInteger { 13 | SSSMutableTabContainerEventNoDefine, // 未定义 14 | SSSMutableTabContainerEventSwitchTab, // 切换 15 | SSSMutableTabContainerEventHidenTabs, // 隐藏 16 | } SSSMutableTabContainerEvent; 17 | 18 | @interface SSSMutableTabContainerHelper : NSObject 19 | 20 | + (SSSMutableTabContainerEvent)fetchEvent:(NSString *)str; 21 | 22 | + (UIViewController *)createWebVC:(NSString *)url; 23 | 24 | 25 | /// 创建通天塔导航VC (单独h5 使用) 26 | /// @param url 网站链接 27 | /// @param backBlock 返回事件 28 | + (UINavigationController *)createTTTNavWebVC:(NSString *)url 29 | backBlock:(void (^)(void))backBlock; 30 | 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/SSSMutableTabContainerHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSSMutableTabContainerHelper.m 3 | // JDBrandSeckillModule 4 | // 5 | // Created by 杨明 on 2022/2/10. 6 | // 7 | 8 | #import "SSSMutableTabContainerHelper.h" 9 | #import "SSSUtils.h" 10 | #import 11 | 12 | @implementation SSSMutableTabContainerHelper 13 | 14 | #pragma mark - Class Method 15 | 16 | + (SSSMutableTabContainerEvent)fetchEvent:(NSString *)str{ 17 | if ([@"switchTab" isEqualToString:str]) { 18 | return SSSMutableTabContainerEventSwitchTab; 19 | }else if ([@"hidenTabs" isEqualToString:str]) { 20 | return SSSMutableTabContainerEventHidenTabs; 21 | }else { 22 | return SSSMutableTabContainerEventNoDefine; 23 | } 24 | } 25 | 26 | 27 | + (UIViewController *)createWebVC:(NSString *)url{ 28 | 29 | if (!validateString(url)) { 30 | url = @"https://www.jd.com"; 31 | } 32 | NSURL *link = [NSURL URLWithString:url]; 33 | 34 | // 通天塔容器 35 | UIViewController *webVC = [[SFSafariViewController alloc] initWithURL:link]; 36 | 37 | return webVC; 38 | } 39 | 40 | + (UINavigationController *)createTTTNavWebVC:(NSString *)url 41 | backBlock:(void (^)(void))backBlock { 42 | 43 | if (!validateString(url)) { 44 | url = @"https://www.jd.com"; 45 | } 46 | 47 | UIViewController *webVC = [self createWebVC:url]; 48 | 49 | return [SSSUtils emberInNaviWithRootVC:webVC]; 50 | } 51 | 52 | 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/SSSTabModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSSTabModel.h 3 | // JDBrandSeckillModule 4 | // 5 | // Created by lixianke1 on 2022/4/1. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | FOUNDATION_EXTERN NSString *const SSS_JD_URL; 13 | 14 | typedef NS_ENUM(NSUInteger, SSSTabType) { 15 | SSSTabTypeWeb, // H5容器 16 | SSSTabTypeNative, // 原生容器 17 | }; 18 | 19 | @interface SSSTabConfigModel : NSObject 20 | 21 | @property (nonatomic, assign) NSInteger selectIndex; // 底部导航选中位置 22 | @property (nonatomic, copy) NSString *tabBackground; // tab背景图 23 | 24 | @end 25 | 26 | @interface SSSTabItemModel : NSObject 27 | 28 | @property (nonatomic, assign) NSInteger specialType; // 是否是异形Tab,1 是,默认0非异形 29 | @property (nonatomic, assign) SSSTabType tabType; // tab类型 30 | @property (nonatomic, copy) NSString *tabName; // tab描述 31 | @property (nonatomic, copy) NSString *tabImage; // tab非选中背景图片 32 | @property (nonatomic, copy) NSString *selectTabImage;// tab选中背景图片 33 | @property (nonatomic, copy) NSString *module; // 路由 34 | @property (nonatomic, copy) NSString *params; // 传递原生容器参数,有多少传递多少 35 | @property (nonatomic, copy) NSString *link; // H5链接 36 | 37 | @end 38 | 39 | @interface SSSBaseTabWrapperModel : NSObject 40 | 41 | @property(nonatomic, copy) NSString *code; 42 | @property(nonatomic, strong) NSArray *tabList; 43 | @property(nonatomic, strong) SSSTabConfigModel *tabConfig; 44 | 45 | + (SSSBaseTabWrapperModel *)getDefaultTabModel; // 兜底数据 46 | 47 | @end 48 | 49 | NS_ASSUME_NONNULL_END 50 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/SSSTabModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSSTabModel.m 3 | // JDBrandSeckillModule 4 | // 5 | // Created by lixianke1 on 2022/4/1. 6 | // 7 | 8 | #import "SSSTabModel.h" 9 | 10 | NSString *const SSS_JD_URL = @"https://www.jd.com"; 11 | 12 | @implementation SSSTabConfigModel 13 | 14 | 15 | 16 | @end 17 | 18 | @implementation SSSTabItemModel 19 | 20 | 21 | @end 22 | 23 | @implementation SSSBaseTabWrapperModel 24 | 25 | + (NSDictionary *)mj_objectClassInArray 26 | { 27 | return @{ 28 | @"tabList" : @"SSSTabItemModel", 29 | }; 30 | } 31 | 32 | + (SSSBaseTabWrapperModel *)getDefaultTabModel { 33 | 34 | SSSTabItemModel *tabModel = [[SSSTabItemModel alloc] init]; 35 | tabModel.tabType = 1; 36 | tabModel.link = SSS_JD_URL; 37 | 38 | SSSBaseTabWrapperModel *wrapperModel = [[SSSBaseTabWrapperModel alloc] init]; 39 | wrapperModel.tabList = @[tabModel]; 40 | 41 | return wrapperModel; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/SSSUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSSUtils.h 3 | // XMultiTabModule-iOS 4 | // 5 | // Created by lixianke1 on 2022/8/23. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | #define SCREEN_WIDTH CGRectGetWidth([UIScreen mainScreen].bounds) 13 | #define SCREEN_HEIGHT CGRectGetHeight([UIScreen mainScreen].bounds) 14 | #define kTabViewHeight (49.0) 15 | #define kTabViewiPhoneXHeight (83.0) 16 | 17 | CG_INLINE BOOL 18 | validateString(NSString *input) { 19 | if (!input) { 20 | return false; 21 | } 22 | if (![input isKindOfClass:[NSString class]]) { 23 | return false; 24 | } 25 | if (!input.length) { 26 | return false; 27 | } 28 | return true; 29 | } 30 | 31 | CG_INLINE BOOL 32 | validateArray(NSArray *input) { 33 | if (!input) { 34 | return false; 35 | } 36 | if (![input isKindOfClass:[NSArray class]]) { 37 | return false; 38 | } 39 | if (!input.count) { 40 | return false; 41 | } 42 | return true; 43 | } 44 | 45 | CG_INLINE BOOL 46 | validateDictionary(NSDictionary *input) { 47 | if (!input) { 48 | return false; 49 | } 50 | if (![input isKindOfClass:[NSDictionary class]]) { 51 | return false; 52 | } 53 | if (!input.count) { 54 | return false; 55 | } 56 | return true; 57 | } 58 | 59 | @interface SSSUtils : NSObject 60 | 61 | + (BOOL)hasNotch; 62 | + (UINavigationController *)emberInNaviWithRootVC:(UIViewController *)rootVC; 63 | 64 | @end 65 | 66 | NS_ASSUME_NONNULL_END 67 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/SSSUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // SSSUtils.m 3 | // XMultiTabModule-iOS 4 | // 5 | // Created by lixianke1 on 2022/8/23. 6 | // 7 | 8 | #import "SSSUtils.h" 9 | #import 10 | 11 | @implementation SSSUtils 12 | 13 | +(BOOL)hasNotch { 14 | if (@available(iOS 11.0, *)) { 15 | NSArray *windows = [UIApplication sharedApplication].windows; 16 | for (UIWindow *window in windows) { 17 | if (window.isKeyWindow) { 18 | if (UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation)) { 19 | return window.safeAreaInsets.top >= 44; 20 | } else { 21 | return window.safeAreaInsets.left > 0 || window.safeAreaInsets.right > 0; 22 | } 23 | } 24 | } 25 | } 26 | return false; 27 | } 28 | 29 | + (UINavigationController *)emberInNaviWithRootVC:(UIViewController *)rootVC { 30 | if (!rootVC || ![rootVC isKindOfClass:[UIViewController class]]) { 31 | return nil; 32 | } 33 | UINavigationController *nav = [[UINavigationController alloc] init]; 34 | nav.view.backgroundColor = [UIColor whiteColor]; 35 | nav.viewControllers = @[rootVC]; 36 | return nav; 37 | } 38 | 39 | @end 40 | 41 | 42 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/UIColor+SSS.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+SSS.h 3 | // XMultiTabModule-iOS 4 | // 5 | // Created by lixianke1 on 2022/8/23. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface UIColor (SSS) 13 | 14 | + (UIColor *) colorWithHex:(NSString *)hexColor; 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /XMultiTabModule-iOS/Classes/UIColor+SSS.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+SSS.m 3 | // XMultiTabModule-iOS 4 | // 5 | // Created by lixianke1 on 2022/8/23. 6 | // 7 | 8 | #import "UIColor+SSS.h" 9 | 10 | @implementation UIColor (SSS) 11 | 12 | + (UIColor *)colorWithHex:(NSString *)hexString { 13 | unsigned rgbValue = 0; 14 | NSScanner *scanner = [NSScanner scannerWithString:hexString]; 15 | [scanner setScanLocation:1]; // bypass '#' character 16 | [scanner scanHexInt:&rgbValue]; 17 | return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0]; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------