@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,58 +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 "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 <SDImageCoder>
|
|
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<id<SDImageCoder>> *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<SDImageCoder>)coder;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
Remove a coder in the coders array.
|
|
53
|
-
|
|
54
|
-
@param coder coder
|
|
55
|
-
*/
|
|
56
|
-
- (void)removeCoder:(nonnull id<SDImageCoder>)coder;
|
|
57
|
-
|
|
58
|
-
@end
|
|
@@ -1,130 +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 "SDImageCodersManager.h"
|
|
10
|
-
#import "SDImageIOCoder.h"
|
|
11
|
-
#import "SDImageGIFCoder.h"
|
|
12
|
-
#import "SDImageAPNGCoder.h"
|
|
13
|
-
#import "SDImageHEICCoder.h"
|
|
14
|
-
#import "SDInternalMacros.h"
|
|
15
|
-
|
|
16
|
-
@interface SDImageCodersManager ()
|
|
17
|
-
|
|
18
|
-
@property (nonatomic, strong, nonnull) NSMutableArray<id<SDImageCoder>> *imageCoders;
|
|
19
|
-
|
|
20
|
-
@end
|
|
21
|
-
|
|
22
|
-
@implementation SDImageCodersManager {
|
|
23
|
-
SD_LOCK_DECLARE(_codersLock);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
+ (nonnull instancetype)sharedManager {
|
|
27
|
-
static dispatch_once_t once;
|
|
28
|
-
static id instance;
|
|
29
|
-
dispatch_once(&once, ^{
|
|
30
|
-
instance = [self new];
|
|
31
|
-
});
|
|
32
|
-
return instance;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
- (instancetype)init {
|
|
36
|
-
if (self = [super init]) {
|
|
37
|
-
// initialize with default coders
|
|
38
|
-
_imageCoders = [NSMutableArray arrayWithArray:@[[SDImageIOCoder sharedCoder], [SDImageGIFCoder sharedCoder], [SDImageAPNGCoder sharedCoder]]];
|
|
39
|
-
SD_LOCK_INIT(_codersLock);
|
|
40
|
-
}
|
|
41
|
-
return self;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
- (NSArray<id<SDImageCoder>> *)coders {
|
|
45
|
-
SD_LOCK(_codersLock);
|
|
46
|
-
NSArray<id<SDImageCoder>> *coders = [_imageCoders copy];
|
|
47
|
-
SD_UNLOCK(_codersLock);
|
|
48
|
-
return coders;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
- (void)setCoders:(NSArray<id<SDImageCoder>> *)coders {
|
|
52
|
-
SD_LOCK(_codersLock);
|
|
53
|
-
[_imageCoders removeAllObjects];
|
|
54
|
-
if (coders.count) {
|
|
55
|
-
[_imageCoders addObjectsFromArray:coders];
|
|
56
|
-
}
|
|
57
|
-
SD_UNLOCK(_codersLock);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
#pragma mark - Coder IO operations
|
|
61
|
-
|
|
62
|
-
- (void)addCoder:(nonnull id<SDImageCoder>)coder {
|
|
63
|
-
if (![coder conformsToProtocol:@protocol(SDImageCoder)]) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
SD_LOCK(_codersLock);
|
|
67
|
-
[_imageCoders addObject:coder];
|
|
68
|
-
SD_UNLOCK(_codersLock);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
- (void)removeCoder:(nonnull id<SDImageCoder>)coder {
|
|
72
|
-
if (![coder conformsToProtocol:@protocol(SDImageCoder)]) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
SD_LOCK(_codersLock);
|
|
76
|
-
[_imageCoders removeObject:coder];
|
|
77
|
-
SD_UNLOCK(_codersLock);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
#pragma mark - SDImageCoder
|
|
81
|
-
- (BOOL)canDecodeFromData:(NSData *)data {
|
|
82
|
-
NSArray<id<SDImageCoder>> *coders = self.coders;
|
|
83
|
-
for (id<SDImageCoder> coder in coders.reverseObjectEnumerator) {
|
|
84
|
-
if ([coder canDecodeFromData:data]) {
|
|
85
|
-
return YES;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return NO;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
- (BOOL)canEncodeToFormat:(SDImageFormat)format {
|
|
92
|
-
NSArray<id<SDImageCoder>> *coders = self.coders;
|
|
93
|
-
for (id<SDImageCoder> coder in coders.reverseObjectEnumerator) {
|
|
94
|
-
if ([coder canEncodeToFormat:format]) {
|
|
95
|
-
return YES;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return NO;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
- (UIImage *)decodedImageWithData:(NSData *)data options:(nullable SDImageCoderOptions *)options {
|
|
102
|
-
if (!data) {
|
|
103
|
-
return nil;
|
|
104
|
-
}
|
|
105
|
-
UIImage *image;
|
|
106
|
-
NSArray<id<SDImageCoder>> *coders = self.coders;
|
|
107
|
-
for (id<SDImageCoder> coder in coders.reverseObjectEnumerator) {
|
|
108
|
-
if ([coder canDecodeFromData:data]) {
|
|
109
|
-
image = [coder decodedImageWithData:data options:options];
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return image;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
- (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format options:(nullable SDImageCoderOptions *)options {
|
|
118
|
-
if (!image) {
|
|
119
|
-
return nil;
|
|
120
|
-
}
|
|
121
|
-
NSArray<id<SDImageCoder>> *coders = self.coders;
|
|
122
|
-
for (id<SDImageCoder> coder in coders.reverseObjectEnumerator) {
|
|
123
|
-
if ([coder canEncodeToFormat:format]) {
|
|
124
|
-
return [coder encodedDataWithImage:image format:format options:options];
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return nil;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
@end
|
|
@@ -1,36 +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
|
-
/**
|
|
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
|
|
@@ -1,28 +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 "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
|
|
@@ -1,22 +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 "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 <SDProgressiveImageCoder, SDAnimatedImageCoder>
|
|
19
|
-
|
|
20
|
-
@property (nonatomic, class, readonly, nonnull) SDImageGIFCoder *sharedCoder;
|
|
21
|
-
|
|
22
|
-
@end
|
|
@@ -1,58 +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 "SDImageGIFCoder.h"
|
|
10
|
-
#import "SDImageIOAnimatedCoderInternal.h"
|
|
11
|
-
#if SD_MAC
|
|
12
|
-
#import <CoreServices/CoreServices.h>
|
|
13
|
-
#else
|
|
14
|
-
#import <MobileCoreServices/MobileCoreServices.h>
|
|
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
|
|
@@ -1,28 +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 "SDWebImageCompat.h"
|
|
10
|
-
#import <CoreGraphics/CoreGraphics.h>
|
|
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);
|
|
@@ -1,127 +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 "SDImageGraphics.h"
|
|
10
|
-
#import "NSImage+Compatibility.h"
|
|
11
|
-
#import "SDImageCoderHelper.h"
|
|
12
|
-
#import "objc/runtime.h"
|
|
13
|
-
|
|
14
|
-
#if SD_MAC
|
|
15
|
-
static void *kNSGraphicsContextScaleFactorKey;
|
|
16
|
-
|
|
17
|
-
static CGContextRef SDCGContextCreateBitmapContext(CGSize size, BOOL opaque, CGFloat scale) {
|
|
18
|
-
if (scale == 0) {
|
|
19
|
-
// Match `UIGraphicsBeginImageContextWithOptions`, reset to the scale factor of the device’s main screen if scale is 0.
|
|
20
|
-
NSScreen *mainScreen = nil;
|
|
21
|
-
if (@available(macOS 10.12, *)) {
|
|
22
|
-
mainScreen = [NSScreen mainScreen];
|
|
23
|
-
} else {
|
|
24
|
-
mainScreen = [NSScreen screens].firstObject;
|
|
25
|
-
}
|
|
26
|
-
scale = mainScreen.backingScaleFactor ?: 1.0f;
|
|
27
|
-
}
|
|
28
|
-
size_t width = ceil(size.width * scale);
|
|
29
|
-
size_t height = ceil(size.height * scale);
|
|
30
|
-
if (width < 1 || height < 1) return NULL;
|
|
31
|
-
|
|
32
|
-
CGColorSpaceRef space = [SDImageCoderHelper colorSpaceGetDeviceRGB];
|
|
33
|
-
// kCGImageAlphaNone is not supported in CGBitmapContextCreate.
|
|
34
|
-
// Check #3330 for more detail about why this bitmap is choosen.
|
|
35
|
-
CGBitmapInfo bitmapInfo;
|
|
36
|
-
if (!opaque) {
|
|
37
|
-
// iPhone GPU prefer to use BGRA8888, see: https://forums.raywenderlich.com/t/why-mtlpixelformat-bgra8unorm/53489
|
|
38
|
-
// BGRA8888
|
|
39
|
-
bitmapInfo = kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst;
|
|
40
|
-
} else {
|
|
41
|
-
// BGR888 previously works on iOS 8~iOS 14, however, iOS 15+ will result a black image. FB9958017
|
|
42
|
-
// RGB888
|
|
43
|
-
bitmapInfo = kCGBitmapByteOrderDefault | kCGImageAlphaNoneSkipLast;
|
|
44
|
-
}
|
|
45
|
-
CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, 0, space, bitmapInfo);
|
|
46
|
-
if (!context) {
|
|
47
|
-
return NULL;
|
|
48
|
-
}
|
|
49
|
-
CGContextScaleCTM(context, scale, scale);
|
|
50
|
-
|
|
51
|
-
return context;
|
|
52
|
-
}
|
|
53
|
-
#endif
|
|
54
|
-
|
|
55
|
-
CGContextRef SDGraphicsGetCurrentContext(void) {
|
|
56
|
-
#if SD_UIKIT || SD_WATCH
|
|
57
|
-
return UIGraphicsGetCurrentContext();
|
|
58
|
-
#else
|
|
59
|
-
return NSGraphicsContext.currentContext.CGContext;
|
|
60
|
-
#endif
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
void SDGraphicsBeginImageContext(CGSize size) {
|
|
64
|
-
#if SD_UIKIT || SD_WATCH
|
|
65
|
-
UIGraphicsBeginImageContext(size);
|
|
66
|
-
#else
|
|
67
|
-
SDGraphicsBeginImageContextWithOptions(size, NO, 1.0);
|
|
68
|
-
#endif
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
void SDGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale) {
|
|
72
|
-
#if SD_UIKIT || SD_WATCH
|
|
73
|
-
UIGraphicsBeginImageContextWithOptions(size, opaque, scale);
|
|
74
|
-
#else
|
|
75
|
-
CGContextRef context = SDCGContextCreateBitmapContext(size, opaque, scale);
|
|
76
|
-
if (!context) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
NSGraphicsContext *graphicsContext = [NSGraphicsContext graphicsContextWithCGContext:context flipped:NO];
|
|
80
|
-
objc_setAssociatedObject(graphicsContext, &kNSGraphicsContextScaleFactorKey, @(scale), OBJC_ASSOCIATION_RETAIN);
|
|
81
|
-
CGContextRelease(context);
|
|
82
|
-
[NSGraphicsContext saveGraphicsState];
|
|
83
|
-
NSGraphicsContext.currentContext = graphicsContext;
|
|
84
|
-
#endif
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
void SDGraphicsEndImageContext(void) {
|
|
88
|
-
#if SD_UIKIT || SD_WATCH
|
|
89
|
-
UIGraphicsEndImageContext();
|
|
90
|
-
#else
|
|
91
|
-
[NSGraphicsContext restoreGraphicsState];
|
|
92
|
-
#endif
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
UIImage * SDGraphicsGetImageFromCurrentImageContext(void) {
|
|
96
|
-
#if SD_UIKIT || SD_WATCH
|
|
97
|
-
return UIGraphicsGetImageFromCurrentImageContext();
|
|
98
|
-
#else
|
|
99
|
-
NSGraphicsContext *context = NSGraphicsContext.currentContext;
|
|
100
|
-
CGContextRef contextRef = context.CGContext;
|
|
101
|
-
if (!contextRef) {
|
|
102
|
-
return nil;
|
|
103
|
-
}
|
|
104
|
-
CGImageRef imageRef = CGBitmapContextCreateImage(contextRef);
|
|
105
|
-
if (!imageRef) {
|
|
106
|
-
return nil;
|
|
107
|
-
}
|
|
108
|
-
CGFloat scale = 0;
|
|
109
|
-
NSNumber *scaleFactor = objc_getAssociatedObject(context, &kNSGraphicsContextScaleFactorKey);
|
|
110
|
-
if ([scaleFactor isKindOfClass:[NSNumber class]]) {
|
|
111
|
-
scale = scaleFactor.doubleValue;
|
|
112
|
-
}
|
|
113
|
-
if (!scale) {
|
|
114
|
-
// reset to the scale factor of the device’s main screen if scale is 0.
|
|
115
|
-
NSScreen *mainScreen = nil;
|
|
116
|
-
if (@available(macOS 10.12, *)) {
|
|
117
|
-
mainScreen = [NSScreen mainScreen];
|
|
118
|
-
} else {
|
|
119
|
-
mainScreen = [NSScreen screens].firstObject;
|
|
120
|
-
}
|
|
121
|
-
scale = mainScreen.backingScaleFactor ?: 1.0f;
|
|
122
|
-
}
|
|
123
|
-
NSImage *image = [[NSImage alloc] initWithCGImage:imageRef scale:scale orientation:kCGImagePropertyOrientationUp];
|
|
124
|
-
CGImageRelease(imageRef);
|
|
125
|
-
return image;
|
|
126
|
-
#endif
|
|
127
|
-
}
|
|
@@ -1,25 +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 "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 <SDProgressiveImageCoder, SDAnimatedImageCoder>
|
|
22
|
-
|
|
23
|
-
@property (nonatomic, class, readonly, nonnull) SDImageHEICCoder *sharedCoder;
|
|
24
|
-
|
|
25
|
-
@end
|
|
@@ -1,101 +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 "SDImageHEICCoder.h"
|
|
10
|
-
#import "SDImageIOAnimatedCoderInternal.h"
|
|
11
|
-
|
|
12
|
-
// These constants are available from iOS 13+ and Xcode 11. This raw value is used for toolchain and firmware compatibility
|
|
13
|
-
static NSString * kSDCGImagePropertyHEICSDictionary = @"{HEICS}";
|
|
14
|
-
static NSString * kSDCGImagePropertyHEICSLoopCount = @"LoopCount";
|
|
15
|
-
static NSString * kSDCGImagePropertyHEICSDelayTime = @"DelayTime";
|
|
16
|
-
static NSString * kSDCGImagePropertyHEICSUnclampedDelayTime = @"UnclampedDelayTime";
|
|
17
|
-
|
|
18
|
-
@implementation SDImageHEICCoder
|
|
19
|
-
|
|
20
|
-
+ (void)initialize {
|
|
21
|
-
if (@available(iOS 13, tvOS 13, macOS 10.15, watchOS 6, *)) {
|
|
22
|
-
// Use SDK instead of raw value
|
|
23
|
-
kSDCGImagePropertyHEICSDictionary = (__bridge NSString *)kCGImagePropertyHEICSDictionary;
|
|
24
|
-
kSDCGImagePropertyHEICSLoopCount = (__bridge NSString *)kCGImagePropertyHEICSLoopCount;
|
|
25
|
-
kSDCGImagePropertyHEICSDelayTime = (__bridge NSString *)kCGImagePropertyHEICSDelayTime;
|
|
26
|
-
kSDCGImagePropertyHEICSUnclampedDelayTime = (__bridge NSString *)kCGImagePropertyHEICSUnclampedDelayTime;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
+ (instancetype)sharedCoder {
|
|
31
|
-
static SDImageHEICCoder *coder;
|
|
32
|
-
static dispatch_once_t onceToken;
|
|
33
|
-
dispatch_once(&onceToken, ^{
|
|
34
|
-
coder = [[SDImageHEICCoder alloc] init];
|
|
35
|
-
});
|
|
36
|
-
return coder;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
#pragma mark - SDImageCoder
|
|
40
|
-
|
|
41
|
-
- (BOOL)canDecodeFromData:(nullable NSData *)data {
|
|
42
|
-
switch ([NSData sd_imageFormatForImageData:data]) {
|
|
43
|
-
case SDImageFormatHEIC:
|
|
44
|
-
// Check HEIC decoding compatibility
|
|
45
|
-
return [self.class canDecodeFromFormat:SDImageFormatHEIC];
|
|
46
|
-
case SDImageFormatHEIF:
|
|
47
|
-
// Check HEIF decoding compatibility
|
|
48
|
-
return [self.class canDecodeFromFormat:SDImageFormatHEIF];
|
|
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 SDImageFormatHEIC:
|
|
61
|
-
// Check HEIC encoding compatibility
|
|
62
|
-
return [self.class canEncodeToFormat:SDImageFormatHEIC];
|
|
63
|
-
case SDImageFormatHEIF:
|
|
64
|
-
// Check HEIF encoding compatibility
|
|
65
|
-
return [self.class canEncodeToFormat:SDImageFormatHEIF];
|
|
66
|
-
default:
|
|
67
|
-
return NO;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
#pragma mark - Subclass Override
|
|
72
|
-
|
|
73
|
-
+ (SDImageFormat)imageFormat {
|
|
74
|
-
return SDImageFormatHEIC;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
+ (NSString *)imageUTType {
|
|
78
|
-
return (__bridge NSString *)kSDUTTypeHEIC;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
+ (NSString *)dictionaryProperty {
|
|
82
|
-
return kSDCGImagePropertyHEICSDictionary;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
+ (NSString *)unclampedDelayTimeProperty {
|
|
86
|
-
return kSDCGImagePropertyHEICSUnclampedDelayTime;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
+ (NSString *)delayTimeProperty {
|
|
90
|
-
return kSDCGImagePropertyHEICSDelayTime;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
+ (NSString *)loopCountProperty {
|
|
94
|
-
return kSDCGImagePropertyHEICSLoopCount;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
+ (NSUInteger)defaultLoopCount {
|
|
98
|
-
return 0;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@end
|
|
@@ -1,58 +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 "SDImageCoder.h"
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
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.
|
|
14
|
-
All of the properties need the subclass to implement and works as expected.
|
|
15
|
-
For Image/IO, See Apple's documentation: https://developer.apple.com/documentation/imageio
|
|
16
|
-
*/
|
|
17
|
-
@interface SDImageIOAnimatedCoder : NSObject <SDProgressiveImageCoder, SDAnimatedImageCoder>
|
|
18
|
-
|
|
19
|
-
#pragma mark - Subclass Override
|
|
20
|
-
/**
|
|
21
|
-
The supported animated image format. Such as `SDImageFormatGIF`.
|
|
22
|
-
@note Subclass override.
|
|
23
|
-
*/
|
|
24
|
-
@property (class, readonly) SDImageFormat imageFormat;
|
|
25
|
-
/**
|
|
26
|
-
The supported image format UTI Type. Such as `kSDUTTypeGIF`.
|
|
27
|
-
This can be used for cases when we can not detect `SDImageFormat. Such as progressive decoding's hint format `kCGImageSourceTypeIdentifierHint`.
|
|
28
|
-
@note Subclass override.
|
|
29
|
-
*/
|
|
30
|
-
@property (class, readonly, nonnull) NSString *imageUTType;
|
|
31
|
-
/**
|
|
32
|
-
The image container property key used in Image/IO API. Such as `kCGImagePropertyGIFDictionary`.
|
|
33
|
-
@note Subclass override.
|
|
34
|
-
*/
|
|
35
|
-
@property (class, readonly, nonnull) NSString *dictionaryProperty;
|
|
36
|
-
/**
|
|
37
|
-
The image unclamped delay time property key used in Image/IO API. Such as `kCGImagePropertyGIFUnclampedDelayTime`
|
|
38
|
-
@note Subclass override.
|
|
39
|
-
*/
|
|
40
|
-
@property (class, readonly, nonnull) NSString *unclampedDelayTimeProperty;
|
|
41
|
-
/**
|
|
42
|
-
The image delay time property key used in Image/IO API. Such as `kCGImagePropertyGIFDelayTime`.
|
|
43
|
-
@note Subclass override.
|
|
44
|
-
*/
|
|
45
|
-
@property (class, readonly, nonnull) NSString *delayTimeProperty;
|
|
46
|
-
/**
|
|
47
|
-
The image loop count property key used in Image/IO API. Such as `kCGImagePropertyGIFLoopCount`.
|
|
48
|
-
@note Subclass override.
|
|
49
|
-
*/
|
|
50
|
-
@property (class, readonly, nonnull) NSString *loopCountProperty;
|
|
51
|
-
/**
|
|
52
|
-
The default loop count when there are no any loop count information inside image container metadata.
|
|
53
|
-
For example, for GIF format, the standard use 1 (play once). For APNG format, the standard use 0 (infinity loop).
|
|
54
|
-
@note Subclass override.
|
|
55
|
-
*/
|
|
56
|
-
@property (class, readonly) NSUInteger defaultLoopCount;
|
|
57
|
-
|
|
58
|
-
@end
|