@momo-kits/native-kits 0.0.1-beta.5 → 0.89.1-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/android/.gradle/8.0/checksums/checksums.lock +0 -0
- package/android/.gradle/8.0/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.0/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.0/gc.properties +0 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +12 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/.idea/workspace.xml +50 -0
- package/android/build.gradle +35 -69
- package/android/local.properties +8 -0
- package/android/proguard-rules.pro +21 -0
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/java/com/momoplatform/nativekits/foundations/Button.kt +16 -0
- package/android/src/main/java/com/momoplatform/nativekits/libs/Logo.kt +63 -0
- package/android/src/main/java/com/momoplatform/nativekits/libs/TrustBanner.kt +246 -0
- package/android/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/android/src/main/res/drawable-v24/ic_launcher_foreground.xml +30 -0
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +6 -0
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +6 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/values/colors.xml +10 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/themes.xml +3 -0
- package/android/src/main/res/values-night/themes.xml +3 -0
- package/android/src/main/res/xml/backup_rules.xml +13 -0
- package/android/src/main/res/xml/data_extraction_rules.xml +19 -0
- package/build.gradle.kts +18 -0
- package/compose/build.gradle.kts +82 -0
- package/compose/src/androidMain/AndroidManifest.xml +2 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +8 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/utils/Utils.android.kt +14 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Components.kt +194 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +197 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +133 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +62 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +27 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +288 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +80 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +42 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +126 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +51 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +299 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +246 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +223 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +244 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +281 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PromotionPopup.kt +72 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +65 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +64 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +63 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +73 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +42 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +150 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +13 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +173 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +242 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +50 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1321 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +5 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +97 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +9 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/utils/Utils.ios.kt +18 -0
- package/gradle.properties +19 -0
- package/gradlew +240 -0
- package/gradlew.bat +91 -0
- package/ios/Button/Button.swift +9 -2
- package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +126 -0
- package/ios/Colors+Radius+Spacing/Colors.swift +21 -19
- package/ios/Input/Input.swift +1 -0
- package/ios/OTPKeyboard/KeyboardButton.swift +12 -4
- package/ios/Popup/PopupDisplay.swift +72 -81
- package/ios/Popup/PopupInput.swift +96 -0
- package/ios/Popup/PopupPromotion.swift +52 -0
- package/ios/ScrollIndicator/ScrollIndicator.swift +79 -0
- package/ios/Template/Logo/Logo.swift +75 -0
- package/ios/Template/TrustBanner/TrustBanner.swift +189 -0
- package/ios/native-kits.podspec +1 -1
- package/local.properties +8 -0
- package/package.json +6 -6
- package/publish.sh +1 -10
- package/settings.gradle.kts +41 -0
- package/android/gradle.properties +0 -5
- package/android/src/main/java/com/momoplatform/nativekits/NativeKitsPackage.kt +0 -17
- package/android/src/main/java/com/momoplatform/nativekits/NativeKitsViewManager.kt +0 -20
- package/example/ios/Example/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -63
- package/example/ios/Example/Assets.xcassets/Background.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Border.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Card.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Contents.json +0 -6
- package/example/ios/Example/Assets.xcassets/Error.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Primary.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/PrimaryDark.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/PrimaryLight.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Secondary.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Success.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Text.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/TextSecondary.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Warning.colorset/Contents.json +0 -38
- package/example/ios/Example/ComponentDetail.swift +0 -35
- package/example/ios/Example/ComponentItem.swift +0 -24
- package/example/ios/Example/ComponentModel.swift +0 -38
- package/example/ios/Example/ContentView.swift +0 -39
- package/example/ios/Example/Example.entitlements +0 -10
- package/example/ios/Example/Foundation/ButtonDemo.swift +0 -80
- package/example/ios/Example/Foundation/ImageDemo.swift +0 -43
- package/example/ios/Example/Foundation/Popup/ActionSheets.swift +0 -136
- package/example/ios/Example/Foundation/Popup/Floats.swift +0 -127
- package/example/ios/Example/Foundation/Popup/Popups.swift +0 -51
- package/example/ios/Example/Foundation/PopupDemo.swift +0 -389
- package/example/ios/Example/Foundation/TextInputDemo.swift +0 -36
- package/example/ios/Example/Foundation/TypographyDemo.swift +0 -53
- package/example/ios/Example/Foundation.swift +0 -26
- package/example/ios/Example/Info.plist +0 -18
- package/example/ios/Example/Library/CheckboxDemo.swift +0 -19
- package/example/ios/Example/Library/SwipeableDemo.swift +0 -105
- package/example/ios/Example/Library/SwitchDemo.swift +0 -19
- package/example/ios/Example/Library.swift +0 -26
- package/example/ios/Example/Main.swift +0 -27
- package/example/ios/Example/Overview.swift +0 -20
- package/example/ios/Example/Preview Content/Preview Assets.xcassets/Contents.json +0 -6
- package/example/ios/Example/Resource/SFProText-Black.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Bold.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Heavy.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Light.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Medium.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Regular.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Semibold.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Thin.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Ultralight.ttf +0 -0
- package/example/ios/Example/Resource/foundation.json +0 -33
- package/example/ios/Example/Resource/library.json +0 -18
- package/example/ios/Example/Utils.swift +0 -30
- package/example/ios/Example/ViewModifier/DarkViewModifier.swift +0 -22
- package/example/ios/Example.xcodeproj/project.pbxproj +0 -581
- package/example/ios/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/example/ios/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/example/ios/Example.xcodeproj/project.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/example/ios/Example.xcworkspace/contents.xcworkspacedata +0 -10
- package/example/ios/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
- package/example/ios/Podfile +0 -7
- package/example/ios/Podfile.lock +0 -35
- package/example/ios/Pods/Local Podspecs/MoMoUIKits.podspec.json +0 -37
- package/example/ios/Pods/Manifest.lock +0 -35
- package/example/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -2047
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -46
- package/example/ios/Pods/SDWebImage/LICENSE +0 -20
- package/example/ios/Pods/SDWebImage/README.md +0 -352
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSButton+WebCache.h +0 -340
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSButton+WebCache.m +0 -172
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSData+ImageContentType.h +0 -63
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSData+ImageContentType.m +0 -165
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSImage+Compatibility.h +0 -67
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSImage+Compatibility.m +0 -120
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImage.h +0 -114
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImage.m +0 -392
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImagePlayer.h +0 -112
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImagePlayer.m +0 -420
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageRep.h +0 -23
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageRep.m +0 -133
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageView+WebCache.h +0 -168
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageView+WebCache.m +0 -79
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageView.h +0 -110
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageView.m +0 -540
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDDiskCache.h +0 -145
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDDiskCache.m +0 -326
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDGraphicsImageRenderer.h +0 -73
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDGraphicsImageRenderer.m +0 -256
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageAPNGCoder.h +0 -19
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageAPNGCoder.m +0 -58
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageAWebPCoder.h +0 -23
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageAWebPCoder.m +0 -98
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCache.h +0 -450
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCache.m +0 -1030
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCacheConfig.h +0 -153
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCacheConfig.m +0 -68
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCacheDefine.h +0 -156
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCacheDefine.m +0 -138
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCachesManager.h +0 -81
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCachesManager.m +0 -556
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCoder.h +0 -297
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCoder.m +0 -26
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCoderHelper.h +0 -153
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCoderHelper.m +0 -822
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCodersManager.h +0 -58
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCodersManager.m +0 -130
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageFrame.h +0 -36
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageFrame.m +0 -28
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageGIFCoder.h +0 -22
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageGIFCoder.m +0 -58
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageGraphics.h +0 -28
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageGraphics.m +0 -127
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageHEICCoder.h +0 -25
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageHEICCoder.m +0 -101
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageIOAnimatedCoder.h +0 -58
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageIOAnimatedCoder.m +0 -807
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageIOCoder.h +0 -30
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageIOCoder.m +0 -420
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageLoader.h +0 -146
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageLoader.m +0 -170
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageLoadersManager.h +0 -40
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageLoadersManager.m +0 -123
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageTransformer.h +0 -241
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageTransformer.m +0 -331
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDMemoryCache.h +0 -78
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDMemoryCache.m +0 -158
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheKeyFilter.h +0 -32
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheKeyFilter.m +0 -39
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheSerializer.h +0 -36
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheSerializer.m +0 -39
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCompat.h +0 -95
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCompat.m +0 -17
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDefine.h +0 -352
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDefine.m +0 -149
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloader.h +0 -314
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloader.m +0 -658
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderConfig.h +0 -113
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderConfig.m +0 -60
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderDecryptor.h +0 -49
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderDecryptor.m +0 -55
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderOperation.h +0 -191
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderOperation.m +0 -722
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.h +0 -69
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.m +0 -71
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderResponseModifier.h +0 -69
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderResponseModifier.m +0 -73
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageError.h +0 -32
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageError.m +0 -16
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageIndicator.h +0 -115
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageIndicator.m +0 -275
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageManager.h +0 -290
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageManager.m +0 -775
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageOperation.h +0 -27
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageOperation.m +0 -14
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageOptionsProcessor.h +0 -72
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageOptionsProcessor.m +0 -59
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImagePrefetcher.h +0 -143
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImagePrefetcher.m +0 -303
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageTransition.h +0 -131
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageTransition.m +0 -194
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIButton+WebCache.h +0 -387
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIButton+WebCache.m +0 -234
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+ExtendedCacheData.h +0 -24
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+ExtendedCacheData.m +0 -23
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+ForceDecode.h +0 -46
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+ForceDecode.m +0 -60
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+GIF.h +0 -26
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+GIF.m +0 -22
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.h +0 -27
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.m +0 -47
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+Metadata.h +0 -89
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+Metadata.m +0 -221
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+MultiFormat.h +0 -80
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+MultiFormat.m +0 -47
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+Transform.h +0 -146
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+Transform.m +0 -824
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImageView+HighlightedWebCache.h +0 -129
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImageView+HighlightedWebCache.m +0 -76
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImageView+WebCache.h +0 -194
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImageView+WebCache.m +0 -67
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIView+WebCache.h +0 -110
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIView+WebCache.m +0 -446
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIView+WebCacheOperation.h +0 -48
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIView+WebCacheOperation.m +0 -82
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/NSBezierPath+SDRoundedCorners.h +0 -24
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/NSBezierPath+SDRoundedCorners.m +0 -42
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDAssociatedObject.h +0 -14
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDAssociatedObject.m +0 -29
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDAsyncBlockOperation.h +0 -21
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDAsyncBlockOperation.m +0 -92
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDDeviceHelper.h +0 -18
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDDeviceHelper.m +0 -32
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDDisplayLink.h +0 -29
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDDisplayLink.m +0 -227
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDFileAttributeHelper.h +0 -19
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDFileAttributeHelper.m +0 -127
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDImageAssetManager.h +0 -23
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDImageAssetManager.m +0 -164
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDImageCachesManagerOperation.h +0 -21
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDImageCachesManagerOperation.m +0 -83
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDImageIOAnimatedCoderInternal.h +0 -39
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDInternalMacros.h +0 -122
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDInternalMacros.m +0 -13
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDWeakProxy.h +0 -20
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDWeakProxy.m +0 -79
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDWebImageTransitionInternal.h +0 -19
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDmetamacros.h +0 -667
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/UIColor+SDHexString.h +0 -18
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/UIColor+SDHexString.m +0 -42
- package/example/ios/Pods/SDWebImage/WebImage/SDWebImage.h +0 -89
- package/example/ios/Pods/SDWebImageSwiftUI/LICENSE +0 -19
- package/example/ios/Pods/SDWebImageSwiftUI/README.md +0 -690
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/AnimatedImage.swift +0 -870
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Backports/Backport.swift +0 -59
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Backports/OnChange.swift +0 -52
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Backports/Overlay.swift +0 -124
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Backports/StateObject.swift +0 -151
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Image.swift +0 -78
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/ImageManager.swift +0 -132
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/ImagePlayer.swift +0 -122
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/ImageViewWrapper.swift +0 -133
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Indicator/ActivityIndicator.swift +0 -82
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Indicator/Indicator.swift +0 -97
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Indicator/ProgressIndicator.swift +0 -114
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/SDWebImageSwiftUI.swift +0 -64
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/SwiftUICompatibility.swift +0 -92
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Transition/Transition.swift +0 -93
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/WebImage.swift +0 -509
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Module/SDWebImageSwiftUI.h +0 -15
- package/example/ios/Pods/SkeletonUI/LICENSE +0 -21
- package/example/ios/Pods/SkeletonUI/README.md +0 -137
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Angle/AngleInteractor.swift +0 -29
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Angle/AnglePresenter.swift +0 -7
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Animation/AnimationInteractor.swift +0 -56
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Appearance/AppearanceInteractor.swift +0 -58
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Appearance/AppearancePresenter.swift +0 -5
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/ClosedRange+Normalize.swift +0 -16
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/Image+OptionalType.swift +0 -102
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/ModifiedContent+SkeletonModifier.swift +0 -26
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/Optional+OptionalType.swift +0 -5
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/SecureField+OptionalType.swift +0 -19
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/Text+OptionalType.swift +0 -27
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/TextField+OptionalType.swift +0 -35
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/Toggle+OptionalType.swift +0 -29
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/UnitPoint+Angle.swift +0 -8
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/View+SkeletonModifier.swift +0 -8
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Modifiers/SkeletonModifier.swift +0 -52
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Multiline/MultilineInteractor.swift +0 -41
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Multiline/MultilinePresenter.swift +0 -9
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Opacity/OpacityInteractor.swift +0 -29
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Opacity/OpacityPresenter.swift +0 -7
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Position/PositionInteractor.swift +0 -29
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Position/PositionPresenter.swift +0 -7
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Protocols/OptionalType.swift +0 -4
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Radius/RadiusInteractor.swift +0 -29
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Radius/RadiusPresenter.swift +0 -7
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Shape/ShapeInteractor.swift +0 -33
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Shape/ShapePresenter.swift +0 -5
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonForEach.swift +0 -20
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonInteractor.swift +0 -27
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonList.swift +0 -20
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonPresenter.swift +0 -15
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonShape.swift +0 -64
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonView.swift +0 -25
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-dummy.m +0 -5
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-prefix.pch +0 -12
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-umbrella.h +0 -16
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.debug.xcconfig +0 -15
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.modulemap +0 -6
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.release.xcconfig +0 -15
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown +0 -75
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist +0 -119
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m +0 -5
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h +0 -16
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig +0 -15
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap +0 -6
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig +0 -15
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m +0 -5
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch +0 -12
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h +0 -75
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage.debug.xcconfig +0 -14
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap +0 -6
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage.release.xcconfig +0 -14
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI-dummy.m +0 -5
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI-prefix.pch +0 -12
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI-umbrella.h +0 -17
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI.debug.xcconfig +0 -17
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI.modulemap +0 -6
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI.release.xcconfig +0 -17
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI-dummy.m +0 -5
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI-prefix.pch +0 -12
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI-umbrella.h +0 -16
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI.debug.xcconfig +0 -12
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI.modulemap +0 -6
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI.release.xcconfig +0 -12
- package/ios/Extensions/View++.swift +0 -9
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of the SDWebImage package.
|
|
3
|
-
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
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 <Foundation/Foundation.h>
|
|
10
|
-
#import "SDWebImageCompat.h"
|
|
11
|
-
|
|
12
|
-
/// Image Cache Expire Type
|
|
13
|
-
typedef NS_ENUM(NSUInteger, SDImageCacheConfigExpireType) {
|
|
14
|
-
/**
|
|
15
|
-
* When the image cache is accessed it will update this value
|
|
16
|
-
*/
|
|
17
|
-
SDImageCacheConfigExpireTypeAccessDate,
|
|
18
|
-
/**
|
|
19
|
-
* When the image cache is created or modified it will update this value (Default)
|
|
20
|
-
*/
|
|
21
|
-
SDImageCacheConfigExpireTypeModificationDate,
|
|
22
|
-
/**
|
|
23
|
-
* When the image cache is created it will update this value
|
|
24
|
-
*/
|
|
25
|
-
SDImageCacheConfigExpireTypeCreationDate,
|
|
26
|
-
/**
|
|
27
|
-
* When the image cache is created, modified, renamed, file attribute updated (like permission, xattr) it will update this value
|
|
28
|
-
*/
|
|
29
|
-
SDImageCacheConfigExpireTypeChangeDate,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
The class contains all the config for image cache
|
|
34
|
-
@note This class conform to NSCopying, make sure to add the property in `copyWithZone:` as well.
|
|
35
|
-
*/
|
|
36
|
-
@interface SDImageCacheConfig : NSObject <NSCopying>
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
Gets the default cache config used for shared instance or initialization when it does not provide any cache config. Such as `SDImageCache.sharedImageCache`.
|
|
40
|
-
@note You can modify the property on default cache config, which can be used for later created cache instance. The already created cache instance does not get affected.
|
|
41
|
-
*/
|
|
42
|
-
@property (nonatomic, class, readonly, nonnull) SDImageCacheConfig *defaultCacheConfig;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Whether or not to disable iCloud backup
|
|
46
|
-
* Defaults to YES.
|
|
47
|
-
*/
|
|
48
|
-
@property (assign, nonatomic) BOOL shouldDisableiCloud;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Whether or not to use memory cache
|
|
52
|
-
* @note When the memory cache is disabled, the weak memory cache will also be disabled.
|
|
53
|
-
* Defaults to YES.
|
|
54
|
-
*/
|
|
55
|
-
@property (assign, nonatomic) BOOL shouldCacheImagesInMemory;
|
|
56
|
-
|
|
57
|
-
/*
|
|
58
|
-
* The option to control weak memory cache for images. When enable, `SDImageCache`'s memory cache will use a weak maptable to store the image at the same time when it stored to memory, and get removed at the same time.
|
|
59
|
-
* However when memory warning is triggered, since the weak maptable does not hold a strong reference to image instance, even when the memory cache itself is purged, some images which are held strongly by UIImageViews or other live instances can be recovered again, to avoid later re-query from disk cache or network. This may be helpful for the case, for example, when app enter background and memory is purged, cause cell flashing after re-enter foreground.
|
|
60
|
-
* When enabling this option, we will sync back the image from weak maptable to strong cache during next time top level `sd_setImage` function call.
|
|
61
|
-
* Defaults to NO (YES before 5.12.0 version). You can change this option dynamically.
|
|
62
|
-
*/
|
|
63
|
-
@property (assign, nonatomic) BOOL shouldUseWeakMemoryCache;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Whether or not to remove the expired disk data when application entering the background. (Not works for macOS)
|
|
67
|
-
* Defaults to YES.
|
|
68
|
-
*/
|
|
69
|
-
@property (assign, nonatomic) BOOL shouldRemoveExpiredDataWhenEnterBackground;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Whether or not to remove the expired disk data when application been terminated. This operation is processed in sync to ensure clean up.
|
|
73
|
-
* Defaults to YES.
|
|
74
|
-
*/
|
|
75
|
-
@property (assign, nonatomic) BOOL shouldRemoveExpiredDataWhenTerminate;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* The reading options while reading cache from disk.
|
|
79
|
-
* Defaults to 0. You can set this to `NSDataReadingMappedIfSafe` to improve performance.
|
|
80
|
-
*/
|
|
81
|
-
@property (assign, nonatomic) NSDataReadingOptions diskCacheReadingOptions;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* The writing options while writing cache to disk.
|
|
85
|
-
* Defaults to `NSDataWritingAtomic`. You can set this to `NSDataWritingWithoutOverwriting` to prevent overwriting an existing file.
|
|
86
|
-
*/
|
|
87
|
-
@property (assign, nonatomic) NSDataWritingOptions diskCacheWritingOptions;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* The maximum length of time to keep an image in the disk cache, in seconds.
|
|
91
|
-
* Setting this to a negative value means no expiring.
|
|
92
|
-
* Setting this to zero means that all cached files would be removed when do expiration check.
|
|
93
|
-
* Defaults to 1 week.
|
|
94
|
-
*/
|
|
95
|
-
@property (assign, nonatomic) NSTimeInterval maxDiskAge;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* The maximum size of the disk cache, in bytes.
|
|
99
|
-
* Defaults to 0. Which means there is no cache size limit.
|
|
100
|
-
*/
|
|
101
|
-
@property (assign, nonatomic) NSUInteger maxDiskSize;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* The maximum "total cost" of the in-memory image cache. The cost function is the bytes size held in memory.
|
|
105
|
-
* @note The memory cost is bytes size in memory, but not simple pixels count. For common ARGB8888 image, one pixel is 4 bytes (32 bits).
|
|
106
|
-
* Defaults to 0. Which means there is no memory cost limit.
|
|
107
|
-
*/
|
|
108
|
-
@property (assign, nonatomic) NSUInteger maxMemoryCost;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* The maximum number of objects in-memory image cache should hold.
|
|
112
|
-
* Defaults to 0. Which means there is no memory count limit.
|
|
113
|
-
*/
|
|
114
|
-
@property (assign, nonatomic) NSUInteger maxMemoryCount;
|
|
115
|
-
|
|
116
|
-
/*
|
|
117
|
-
* The attribute which the clear cache will be checked against when clearing the disk cache
|
|
118
|
-
* Default is Modified Date
|
|
119
|
-
*/
|
|
120
|
-
@property (assign, nonatomic) SDImageCacheConfigExpireType diskCacheExpireType;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* The custom file manager for disk cache. Pass nil to let disk cache choose the proper file manager.
|
|
124
|
-
* Defaults to nil.
|
|
125
|
-
* @note This value does not support dynamic changes. Which means further modification on this value after cache initialized has no effect.
|
|
126
|
-
* @note Since `NSFileManager` does not support `NSCopying`. We just pass this by reference during copying. So it's not recommend to set this value on `defaultCacheConfig`.
|
|
127
|
-
*/
|
|
128
|
-
@property (strong, nonatomic, nullable) NSFileManager *fileManager;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* The dispatch queue attr for ioQueue. You can config the QoS and concurrent/serial to internal IO queue. The ioQueue is used by SDImageCache to access read/write for disk data.
|
|
132
|
-
* Defaults we use `DISPATCH_QUEUE_SERIAL`(NULL), to use serial dispatch queue to ensure single access for disk data. It's safe but may be slow.
|
|
133
|
-
* @note You can override this to use `DISPATCH_QUEUE_CONCURRENT`, use concurrent queue.
|
|
134
|
-
* @warning **MAKE SURE** to keep `diskCacheWritingOptions` to use `NSDataWritingAtomic`, or concurrent queue may cause corrupted disk data (because multiple threads read/write same file without atomic is not IO-safe).
|
|
135
|
-
* @note This value does not support dynamic changes. Which means further modification on this value after cache initialized has no effect.
|
|
136
|
-
*/
|
|
137
|
-
@property (strong, nonatomic, nullable) dispatch_queue_attr_t ioQueueAttributes;
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* The custom memory cache class. Provided class instance must conform to `SDMemoryCache` protocol to allow usage.
|
|
141
|
-
* Defaults to built-in `SDMemoryCache` class.
|
|
142
|
-
* @note This value does not support dynamic changes. Which means further modification on this value after cache initialized has no effect.
|
|
143
|
-
*/
|
|
144
|
-
@property (assign, nonatomic, nonnull) Class memoryCacheClass;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* The custom disk cache class. Provided class instance must conform to `SDDiskCache` protocol to allow usage.
|
|
148
|
-
* Defaults to built-in `SDDiskCache` class.
|
|
149
|
-
* @note This value does not support dynamic changes. Which means further modification on this value after cache initialized has no effect.
|
|
150
|
-
*/
|
|
151
|
-
@property (assign ,nonatomic, nonnull) Class diskCacheClass;
|
|
152
|
-
|
|
153
|
-
@end
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of the SDWebImage package.
|
|
3
|
-
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
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
|
-
_fileManager = nil;
|
|
39
|
-
_ioQueueAttributes = DISPATCH_QUEUE_SERIAL; // NULL
|
|
40
|
-
_memoryCacheClass = [SDMemoryCache class];
|
|
41
|
-
_diskCacheClass = [SDDiskCache class];
|
|
42
|
-
}
|
|
43
|
-
return self;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
- (id)copyWithZone:(NSZone *)zone {
|
|
47
|
-
SDImageCacheConfig *config = [[[self class] allocWithZone:zone] init];
|
|
48
|
-
config.shouldDisableiCloud = self.shouldDisableiCloud;
|
|
49
|
-
config.shouldCacheImagesInMemory = self.shouldCacheImagesInMemory;
|
|
50
|
-
config.shouldUseWeakMemoryCache = self.shouldUseWeakMemoryCache;
|
|
51
|
-
config.shouldRemoveExpiredDataWhenEnterBackground = self.shouldRemoveExpiredDataWhenEnterBackground;
|
|
52
|
-
config.shouldRemoveExpiredDataWhenTerminate = self.shouldRemoveExpiredDataWhenTerminate;
|
|
53
|
-
config.diskCacheReadingOptions = self.diskCacheReadingOptions;
|
|
54
|
-
config.diskCacheWritingOptions = self.diskCacheWritingOptions;
|
|
55
|
-
config.maxDiskAge = self.maxDiskAge;
|
|
56
|
-
config.maxDiskSize = self.maxDiskSize;
|
|
57
|
-
config.maxMemoryCost = self.maxMemoryCost;
|
|
58
|
-
config.maxMemoryCount = self.maxMemoryCount;
|
|
59
|
-
config.diskCacheExpireType = self.diskCacheExpireType;
|
|
60
|
-
config.fileManager = self.fileManager; // NSFileManager does not conform to NSCopying, just pass the reference
|
|
61
|
-
config.ioQueueAttributes = self.ioQueueAttributes; // Pass the reference
|
|
62
|
-
config.memoryCacheClass = self.memoryCacheClass;
|
|
63
|
-
config.diskCacheClass = self.diskCacheClass;
|
|
64
|
-
|
|
65
|
-
return config;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@end
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of the SDWebImage package.
|
|
3
|
-
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
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 <Foundation/Foundation.h>
|
|
10
|
-
#import "SDWebImageCompat.h"
|
|
11
|
-
#import "SDWebImageOperation.h"
|
|
12
|
-
#import "SDWebImageDefine.h"
|
|
13
|
-
#import "SDImageCoder.h"
|
|
14
|
-
|
|
15
|
-
/// Image Cache Type
|
|
16
|
-
typedef NS_ENUM(NSInteger, SDImageCacheType) {
|
|
17
|
-
/**
|
|
18
|
-
* For query and contains op in response, means the image isn't available in the image cache
|
|
19
|
-
* For op in request, this type is not available and take no effect.
|
|
20
|
-
*/
|
|
21
|
-
SDImageCacheTypeNone,
|
|
22
|
-
/**
|
|
23
|
-
* For query and contains op in response, means the image was obtained from the disk cache.
|
|
24
|
-
* For op in request, means process only disk cache.
|
|
25
|
-
*/
|
|
26
|
-
SDImageCacheTypeDisk,
|
|
27
|
-
/**
|
|
28
|
-
* For query and contains op in response, means the image was obtained from the memory cache.
|
|
29
|
-
* For op in request, means process only memory cache.
|
|
30
|
-
*/
|
|
31
|
-
SDImageCacheTypeMemory,
|
|
32
|
-
/**
|
|
33
|
-
* For query and contains op in response, this type is not available and take no effect.
|
|
34
|
-
* For op in request, means process both memory cache and disk cache.
|
|
35
|
-
*/
|
|
36
|
-
SDImageCacheTypeAll
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
typedef void(^SDImageCacheCheckCompletionBlock)(BOOL isInCache);
|
|
40
|
-
typedef void(^SDImageCacheQueryDataCompletionBlock)(NSData * _Nullable data);
|
|
41
|
-
typedef void(^SDImageCacheCalculateSizeBlock)(NSUInteger fileCount, NSUInteger totalSize);
|
|
42
|
-
typedef NSString * _Nullable (^SDImageCacheAdditionalCachePathBlock)(NSString * _Nonnull key);
|
|
43
|
-
typedef void(^SDImageCacheQueryCompletionBlock)(UIImage * _Nullable image, NSData * _Nullable data, SDImageCacheType cacheType);
|
|
44
|
-
typedef void(^SDImageCacheContainsCompletionBlock)(SDImageCacheType containsCacheType);
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
This is the built-in decoding process for image query from cache.
|
|
48
|
-
@note If you want to implement your custom loader with `queryImageForKey:options:context:completion:` API, but also want to keep compatible with SDWebImage's behavior, you'd better use this to produce image.
|
|
49
|
-
|
|
50
|
-
@param imageData The image data from the cache. Should not be nil
|
|
51
|
-
@param cacheKey The image cache key from the input. Should not be nil
|
|
52
|
-
@param options The options arg from the input
|
|
53
|
-
@param context The context arg from the input
|
|
54
|
-
@return The decoded image for current image data query from cache
|
|
55
|
-
*/
|
|
56
|
-
FOUNDATION_EXPORT UIImage * _Nullable SDImageCacheDecodeImageData(NSData * _Nonnull imageData, NSString * _Nonnull cacheKey, SDWebImageOptions options, SDWebImageContext * _Nullable context);
|
|
57
|
-
|
|
58
|
-
/// Get the decode options from the loading context options and cache key. This is the built-in translate between the web loading part to the decoding part (which does not depends on).
|
|
59
|
-
/// @param context The context arg from the input
|
|
60
|
-
/// @param options The options arg from the input
|
|
61
|
-
/// @param cacheKey The image cache key from the input. Should not be nil
|
|
62
|
-
FOUNDATION_EXPORT SDImageCoderOptions * _Nonnull SDGetDecodeOptionsFromContext(SDWebImageContext * _Nullable context, SDWebImageOptions options, NSString * _Nonnull cacheKey);
|
|
63
|
-
|
|
64
|
-
/// Set the decode options to the loading context options. This is the built-in translate between the web loading part from the decoding part (which does not depends on).
|
|
65
|
-
/// @param mutableContext The context arg to override
|
|
66
|
-
/// @param mutableOptions The options arg to override
|
|
67
|
-
/// @param decodeOptions The image decoding options
|
|
68
|
-
FOUNDATION_EXPORT void SDSetDecodeOptionsToContext(SDWebImageMutableContext * _Nonnull mutableContext, SDWebImageOptions * _Nonnull mutableOptions, SDImageCoderOptions * _Nonnull decodeOptions);
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
This is the image cache protocol to provide custom image cache for `SDWebImageManager`.
|
|
72
|
-
Though the best practice to custom image cache, is to write your own class which conform `SDMemoryCache` or `SDDiskCache` protocol for `SDImageCache` class (See more on `SDImageCacheConfig.memoryCacheClass & SDImageCacheConfig.diskCacheClass`).
|
|
73
|
-
However, if your own cache implementation contains more advanced feature beyond `SDImageCache` itself, you can consider to provide this instead. For example, you can even use a cache manager like `SDImageCachesManager` to register multiple caches.
|
|
74
|
-
*/
|
|
75
|
-
@protocol SDImageCache <NSObject>
|
|
76
|
-
|
|
77
|
-
@required
|
|
78
|
-
/**
|
|
79
|
-
Query the cached image from image cache for given key. The operation can be used to cancel the query.
|
|
80
|
-
If image is cached in memory, completion is called synchronously, else asynchronously and depends on the options arg (See `SDWebImageQueryDiskSync`)
|
|
81
|
-
|
|
82
|
-
@param key The image cache key
|
|
83
|
-
@param options A mask to specify options to use for this query
|
|
84
|
-
@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.
|
|
85
|
-
@param completionBlock The completion block. Will not get called if the operation is cancelled
|
|
86
|
-
@return The operation for this query
|
|
87
|
-
*/
|
|
88
|
-
- (nullable id<SDWebImageOperation>)queryImageForKey:(nullable NSString *)key
|
|
89
|
-
options:(SDWebImageOptions)options
|
|
90
|
-
context:(nullable SDWebImageContext *)context
|
|
91
|
-
completion:(nullable SDImageCacheQueryCompletionBlock)completionBlock;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
Query the cached image from image cache for given key. The operation can be used to cancel the query.
|
|
95
|
-
If image is cached in memory, completion is called synchronously, else asynchronously and depends on the options arg (See `SDWebImageQueryDiskSync`)
|
|
96
|
-
|
|
97
|
-
@param key The image cache key
|
|
98
|
-
@param options A mask to specify options to use for this query
|
|
99
|
-
@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.
|
|
100
|
-
@param cacheType Specify where to query the cache from. By default we use `.all`, which means both memory cache and disk cache. You can choose to query memory only or disk only as well. Pass `.none` is invalid and callback with nil immediately.
|
|
101
|
-
@param completionBlock The completion block. Will not get called if the operation is cancelled
|
|
102
|
-
@return The operation for this query
|
|
103
|
-
*/
|
|
104
|
-
- (nullable id<SDWebImageOperation>)queryImageForKey:(nullable NSString *)key
|
|
105
|
-
options:(SDWebImageOptions)options
|
|
106
|
-
context:(nullable SDWebImageContext *)context
|
|
107
|
-
cacheType:(SDImageCacheType)cacheType
|
|
108
|
-
completion:(nullable SDImageCacheQueryCompletionBlock)completionBlock;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
Store the image into image cache for the given key. If cache type is memory only, completion is called synchronously, else asynchronously.
|
|
112
|
-
|
|
113
|
-
@param image The image to store
|
|
114
|
-
@param imageData The image data to be used for disk storage
|
|
115
|
-
@param key The image cache key
|
|
116
|
-
@param cacheType The image store op cache type
|
|
117
|
-
@param completionBlock A block executed after the operation is finished
|
|
118
|
-
*/
|
|
119
|
-
- (void)storeImage:(nullable UIImage *)image
|
|
120
|
-
imageData:(nullable NSData *)imageData
|
|
121
|
-
forKey:(nullable NSString *)key
|
|
122
|
-
cacheType:(SDImageCacheType)cacheType
|
|
123
|
-
completion:(nullable SDWebImageNoParamsBlock)completionBlock;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
Remove the image from image cache for the given key. If cache type is memory only, completion is called synchronously, else asynchronously.
|
|
127
|
-
|
|
128
|
-
@param key The image cache key
|
|
129
|
-
@param cacheType The image remove op cache type
|
|
130
|
-
@param completionBlock A block executed after the operation is finished
|
|
131
|
-
*/
|
|
132
|
-
- (void)removeImageForKey:(nullable NSString *)key
|
|
133
|
-
cacheType:(SDImageCacheType)cacheType
|
|
134
|
-
completion:(nullable SDWebImageNoParamsBlock)completionBlock;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
Check if image cache contains the image for the given key (does not load the image). If image is cached in memory, completion is called synchronously, else asynchronously.
|
|
138
|
-
|
|
139
|
-
@param key The image cache key
|
|
140
|
-
@param cacheType The image contains op cache type
|
|
141
|
-
@param completionBlock A block executed after the operation is finished.
|
|
142
|
-
*/
|
|
143
|
-
- (void)containsImageForKey:(nullable NSString *)key
|
|
144
|
-
cacheType:(SDImageCacheType)cacheType
|
|
145
|
-
completion:(nullable SDImageCacheContainsCompletionBlock)completionBlock;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
Clear all the cached images for image cache. If cache type is memory only, completion is called synchronously, else asynchronously.
|
|
149
|
-
|
|
150
|
-
@param cacheType The image clear op cache type
|
|
151
|
-
@param completionBlock A block executed after the operation is finished
|
|
152
|
-
*/
|
|
153
|
-
- (void)clearWithCacheType:(SDImageCacheType)cacheType
|
|
154
|
-
completion:(nullable SDWebImageNoParamsBlock)completionBlock;
|
|
155
|
-
|
|
156
|
-
@end
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of the SDWebImage package.
|
|
3
|
-
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
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 "SDImageCacheDefine.h"
|
|
10
|
-
#import "SDImageCodersManager.h"
|
|
11
|
-
#import "SDImageCoderHelper.h"
|
|
12
|
-
#import "SDAnimatedImage.h"
|
|
13
|
-
#import "UIImage+Metadata.h"
|
|
14
|
-
#import "SDInternalMacros.h"
|
|
15
|
-
|
|
16
|
-
#import <CoreServices/CoreServices.h>
|
|
17
|
-
|
|
18
|
-
SDImageCoderOptions * _Nonnull SDGetDecodeOptionsFromContext(SDWebImageContext * _Nullable context, SDWebImageOptions options, NSString * _Nonnull cacheKey) {
|
|
19
|
-
BOOL decodeFirstFrame = SD_OPTIONS_CONTAINS(options, SDWebImageDecodeFirstFrameOnly);
|
|
20
|
-
NSNumber *scaleValue = context[SDWebImageContextImageScaleFactor];
|
|
21
|
-
CGFloat scale = scaleValue.doubleValue >= 1 ? scaleValue.doubleValue : SDImageScaleFactorForKey(cacheKey);
|
|
22
|
-
NSNumber *preserveAspectRatioValue = context[SDWebImageContextImagePreserveAspectRatio];
|
|
23
|
-
NSValue *thumbnailSizeValue;
|
|
24
|
-
BOOL shouldScaleDown = SD_OPTIONS_CONTAINS(options, SDWebImageScaleDownLargeImages);
|
|
25
|
-
if (shouldScaleDown) {
|
|
26
|
-
CGFloat thumbnailPixels = SDImageCoderHelper.defaultScaleDownLimitBytes / 4;
|
|
27
|
-
CGFloat dimension = ceil(sqrt(thumbnailPixels));
|
|
28
|
-
thumbnailSizeValue = @(CGSizeMake(dimension, dimension));
|
|
29
|
-
}
|
|
30
|
-
if (context[SDWebImageContextImageThumbnailPixelSize]) {
|
|
31
|
-
thumbnailSizeValue = context[SDWebImageContextImageThumbnailPixelSize];
|
|
32
|
-
}
|
|
33
|
-
NSString *typeIdentifierHint = context[SDWebImageContextImageTypeIdentifierHint];
|
|
34
|
-
NSString *fileExtensionHint;
|
|
35
|
-
if (!typeIdentifierHint) {
|
|
36
|
-
// UTI has high priority
|
|
37
|
-
fileExtensionHint = cacheKey.pathExtension; // without dot
|
|
38
|
-
if (fileExtensionHint.length == 0) {
|
|
39
|
-
// Ignore file extension which is empty
|
|
40
|
-
fileExtensionHint = nil;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// First check if user provided decode options
|
|
45
|
-
SDImageCoderMutableOptions *mutableCoderOptions;
|
|
46
|
-
if (context[SDWebImageContextImageDecodeOptions] != nil) {
|
|
47
|
-
mutableCoderOptions = [NSMutableDictionary dictionaryWithDictionary:context[SDWebImageContextImageDecodeOptions]];
|
|
48
|
-
} else {
|
|
49
|
-
mutableCoderOptions = [NSMutableDictionary dictionaryWithCapacity:6];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Override individual options
|
|
53
|
-
mutableCoderOptions[SDImageCoderDecodeFirstFrameOnly] = @(decodeFirstFrame);
|
|
54
|
-
mutableCoderOptions[SDImageCoderDecodeScaleFactor] = @(scale);
|
|
55
|
-
mutableCoderOptions[SDImageCoderDecodePreserveAspectRatio] = preserveAspectRatioValue;
|
|
56
|
-
mutableCoderOptions[SDImageCoderDecodeThumbnailPixelSize] = thumbnailSizeValue;
|
|
57
|
-
mutableCoderOptions[SDImageCoderDecodeTypeIdentifierHint] = typeIdentifierHint;
|
|
58
|
-
mutableCoderOptions[SDImageCoderDecodeFileExtensionHint] = fileExtensionHint;
|
|
59
|
-
|
|
60
|
-
return [mutableCoderOptions copy];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
void SDSetDecodeOptionsToContext(SDWebImageMutableContext * _Nonnull mutableContext, SDWebImageOptions * _Nonnull mutableOptions, SDImageCoderOptions * _Nonnull decodeOptions) {
|
|
64
|
-
if ([decodeOptions[SDImageCoderDecodeFirstFrameOnly] boolValue]) {
|
|
65
|
-
*mutableOptions |= SDWebImageDecodeFirstFrameOnly;
|
|
66
|
-
} else {
|
|
67
|
-
*mutableOptions &= ~SDWebImageDecodeFirstFrameOnly;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
mutableContext[SDWebImageContextImageScaleFactor] = decodeOptions[SDImageCoderDecodeScaleFactor];
|
|
71
|
-
mutableContext[SDWebImageContextImagePreserveAspectRatio] = decodeOptions[SDImageCoderDecodePreserveAspectRatio];
|
|
72
|
-
mutableContext[SDWebImageContextImageThumbnailPixelSize] = decodeOptions[SDImageCoderDecodeThumbnailPixelSize];
|
|
73
|
-
|
|
74
|
-
NSString *typeIdentifierHint = decodeOptions[SDImageCoderDecodeTypeIdentifierHint];
|
|
75
|
-
if (!typeIdentifierHint) {
|
|
76
|
-
NSString *fileExtensionHint = decodeOptions[SDImageCoderDecodeFileExtensionHint];
|
|
77
|
-
if (fileExtensionHint) {
|
|
78
|
-
typeIdentifierHint = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)fileExtensionHint, kUTTypeImage);
|
|
79
|
-
// Ignore dynamic UTI
|
|
80
|
-
if (UTTypeIsDynamic((__bridge CFStringRef)typeIdentifierHint)) {
|
|
81
|
-
typeIdentifierHint = nil;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
mutableContext[SDWebImageContextImageTypeIdentifierHint] = typeIdentifierHint;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
UIImage * _Nullable SDImageCacheDecodeImageData(NSData * _Nonnull imageData, NSString * _Nonnull cacheKey, SDWebImageOptions options, SDWebImageContext * _Nullable context) {
|
|
89
|
-
NSCParameterAssert(imageData);
|
|
90
|
-
NSCParameterAssert(cacheKey);
|
|
91
|
-
UIImage *image;
|
|
92
|
-
SDImageCoderOptions *coderOptions = SDGetDecodeOptionsFromContext(context, options, cacheKey);
|
|
93
|
-
BOOL decodeFirstFrame = SD_OPTIONS_CONTAINS(options, SDWebImageDecodeFirstFrameOnly);
|
|
94
|
-
CGFloat scale = [coderOptions[SDImageCoderDecodeScaleFactor] doubleValue];
|
|
95
|
-
|
|
96
|
-
// Grab the image coder
|
|
97
|
-
id<SDImageCoder> imageCoder = context[SDWebImageContextImageCoder];
|
|
98
|
-
if (!imageCoder) {
|
|
99
|
-
imageCoder = [SDImageCodersManager sharedManager];
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (!decodeFirstFrame) {
|
|
103
|
-
Class animatedImageClass = context[SDWebImageContextAnimatedImageClass];
|
|
104
|
-
// check whether we should use `SDAnimatedImage`
|
|
105
|
-
if ([animatedImageClass isSubclassOfClass:[UIImage class]] && [animatedImageClass conformsToProtocol:@protocol(SDAnimatedImage)]) {
|
|
106
|
-
image = [[animatedImageClass alloc] initWithData:imageData scale:scale options:coderOptions];
|
|
107
|
-
if (image) {
|
|
108
|
-
// Preload frames if supported
|
|
109
|
-
if (options & SDWebImagePreloadAllFrames && [image respondsToSelector:@selector(preloadAllFrames)]) {
|
|
110
|
-
[((id<SDAnimatedImage>)image) preloadAllFrames];
|
|
111
|
-
}
|
|
112
|
-
} else {
|
|
113
|
-
// Check image class matching
|
|
114
|
-
if (options & SDWebImageMatchAnimatedImageClass) {
|
|
115
|
-
return nil;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (!image) {
|
|
121
|
-
image = [imageCoder decodedImageWithData:imageData options:coderOptions];
|
|
122
|
-
}
|
|
123
|
-
if (image) {
|
|
124
|
-
BOOL shouldDecode = !SD_OPTIONS_CONTAINS(options, SDWebImageAvoidDecodeImage);
|
|
125
|
-
BOOL lazyDecode = [coderOptions[SDImageCoderDecodeUseLazyDecoding] boolValue];
|
|
126
|
-
if (lazyDecode) {
|
|
127
|
-
// lazyDecode = NO means we should not forceDecode, highest priority
|
|
128
|
-
shouldDecode = NO;
|
|
129
|
-
}
|
|
130
|
-
if (shouldDecode) {
|
|
131
|
-
image = [SDImageCoderHelper decodedImageWithImage:image];
|
|
132
|
-
}
|
|
133
|
-
// assign the decode options, to let manager check whether to re-decode if needed
|
|
134
|
-
image.sd_decodeOptions = coderOptions;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return image;
|
|
138
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of the SDWebImage package.
|
|
3
|
-
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
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 <Foundation/Foundation.h>
|
|
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 <SDImageCache>
|
|
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<id<SDImageCache>> *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<SDImageCache>)cache;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
Remove a cache in the caches array.
|
|
76
|
-
|
|
77
|
-
@param cache cache
|
|
78
|
-
*/
|
|
79
|
-
- (void)removeCache:(nonnull id<SDImageCache>)cache;
|
|
80
|
-
|
|
81
|
-
@end
|