@momo-kits/native-kits 0.0.1-beta.3 → 0.0.1-beta.5
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/example/ios/Example/ComponentModel.swift +9 -2
- package/example/ios/Example/ContentView.swift +0 -14
- package/example/ios/Example/Foundation/ImageDemo.swift +43 -0
- package/example/ios/Example/Foundation/Popup/Popups.swift +2 -52
- package/example/ios/Example/Foundation/PopupDemo.swift +44 -21
- package/example/ios/Example/Foundation/TextInputDemo.swift +36 -0
- package/example/ios/Example/Library/CheckboxDemo.swift +19 -0
- package/example/ios/Example/Library/SwitchDemo.swift +19 -0
- package/example/ios/Example/Main.swift +17 -1
- package/example/ios/Example/Resource/foundation.json +2 -2
- package/example/ios/Example/Resource/library.json +10 -0
- package/example/ios/Example.xcodeproj/project.pbxproj +16 -0
- package/example/ios/Example.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +1 -1
- package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Podfile +2 -1
- package/example/ios/Podfile.lock +22 -3
- package/example/ios/Pods/Local Podspecs/MoMoUIKits.podspec.json +9 -1
- package/example/ios/Pods/Manifest.lock +22 -3
- package/example/ios/Pods/Pods.xcodeproj/project.pbxproj +1547 -161
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/SDWebImage.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/SkeletonUI.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +21 -0
- package/example/ios/Pods/SDWebImage/LICENSE +20 -0
- package/example/ios/Pods/SDWebImage/README.md +352 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSButton+WebCache.h +340 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSButton+WebCache.m +172 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSData+ImageContentType.h +63 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSData+ImageContentType.m +165 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSImage+Compatibility.h +67 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/NSImage+Compatibility.m +120 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImage.h +114 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImage.m +392 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImagePlayer.h +112 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImagePlayer.m +420 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageRep.h +23 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageRep.m +133 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageView+WebCache.h +168 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageView+WebCache.m +79 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageView.h +110 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageView.m +540 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDDiskCache.h +145 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDDiskCache.m +326 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDGraphicsImageRenderer.h +73 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDGraphicsImageRenderer.m +256 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageAPNGCoder.h +19 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageAPNGCoder.m +58 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageAWebPCoder.h +23 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageAWebPCoder.m +98 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCache.h +450 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCache.m +1030 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCacheConfig.h +153 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCacheConfig.m +68 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCacheDefine.h +156 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCacheDefine.m +138 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCachesManager.h +81 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCachesManager.m +556 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCoder.h +297 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCoder.m +26 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCoderHelper.h +153 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCoderHelper.m +822 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCodersManager.h +58 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageCodersManager.m +130 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageFrame.h +36 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageFrame.m +28 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageGIFCoder.h +22 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageGIFCoder.m +58 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageGraphics.h +28 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageGraphics.m +127 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageHEICCoder.h +25 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageHEICCoder.m +101 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageIOAnimatedCoder.h +58 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageIOAnimatedCoder.m +807 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageIOCoder.h +30 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageIOCoder.m +420 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageLoader.h +146 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageLoader.m +170 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageLoadersManager.h +40 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageLoadersManager.m +123 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageTransformer.h +241 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDImageTransformer.m +331 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDMemoryCache.h +78 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDMemoryCache.m +158 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheKeyFilter.h +32 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheKeyFilter.m +39 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheSerializer.h +36 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCacheSerializer.m +39 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCompat.h +95 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageCompat.m +17 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDefine.h +352 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDefine.m +149 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloader.h +314 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloader.m +658 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderConfig.h +113 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderConfig.m +60 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderDecryptor.h +49 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderDecryptor.m +55 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderOperation.h +191 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderOperation.m +722 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.h +69 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.m +71 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderResponseModifier.h +69 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderResponseModifier.m +73 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageError.h +32 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageError.m +16 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageIndicator.h +115 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageIndicator.m +275 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageManager.h +290 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageManager.m +775 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageOperation.h +27 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageOperation.m +14 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageOptionsProcessor.h +72 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageOptionsProcessor.m +59 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImagePrefetcher.h +143 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImagePrefetcher.m +303 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageTransition.h +131 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/SDWebImageTransition.m +194 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIButton+WebCache.h +387 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIButton+WebCache.m +234 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+ExtendedCacheData.h +24 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+ExtendedCacheData.m +23 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+ForceDecode.h +46 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+ForceDecode.m +60 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+GIF.h +26 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+GIF.m +22 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.h +27 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.m +47 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+Metadata.h +89 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+Metadata.m +221 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+MultiFormat.h +80 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+MultiFormat.m +47 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+Transform.h +146 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImage+Transform.m +824 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImageView+HighlightedWebCache.h +129 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImageView+HighlightedWebCache.m +76 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImageView+WebCache.h +194 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIImageView+WebCache.m +67 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIView+WebCache.h +110 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIView+WebCache.m +446 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIView+WebCacheOperation.h +48 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Core/UIView+WebCacheOperation.m +82 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/NSBezierPath+SDRoundedCorners.h +24 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/NSBezierPath+SDRoundedCorners.m +42 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDAssociatedObject.h +14 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDAssociatedObject.m +29 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDAsyncBlockOperation.h +21 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDAsyncBlockOperation.m +92 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDDeviceHelper.h +18 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDDeviceHelper.m +32 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDDisplayLink.h +29 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDDisplayLink.m +227 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDFileAttributeHelper.h +19 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDFileAttributeHelper.m +127 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDImageAssetManager.h +23 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDImageAssetManager.m +164 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDImageCachesManagerOperation.h +21 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDImageCachesManagerOperation.m +83 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDImageIOAnimatedCoderInternal.h +39 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDInternalMacros.h +122 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDInternalMacros.m +13 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDWeakProxy.h +20 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDWeakProxy.m +79 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDWebImageTransitionInternal.h +19 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/SDmetamacros.h +667 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/UIColor+SDHexString.h +18 -0
- package/example/ios/Pods/SDWebImage/SDWebImage/Private/UIColor+SDHexString.m +42 -0
- package/example/ios/Pods/SDWebImage/WebImage/SDWebImage.h +89 -0
- package/example/ios/Pods/SDWebImageSwiftUI/LICENSE +19 -0
- package/example/ios/Pods/SDWebImageSwiftUI/README.md +690 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/AnimatedImage.swift +870 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Backports/Backport.swift +59 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Backports/OnChange.swift +52 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Backports/Overlay.swift +124 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Backports/StateObject.swift +151 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Image.swift +78 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/ImageManager.swift +132 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/ImagePlayer.swift +122 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/ImageViewWrapper.swift +133 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Indicator/ActivityIndicator.swift +82 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Indicator/Indicator.swift +97 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Indicator/ProgressIndicator.swift +114 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/SDWebImageSwiftUI.swift +64 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/SwiftUICompatibility.swift +92 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Transition/Transition.swift +93 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/WebImage.swift +509 -0
- package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Module/SDWebImageSwiftUI.h +15 -0
- package/example/ios/Pods/SkeletonUI/LICENSE +21 -0
- package/example/ios/Pods/SkeletonUI/README.md +137 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Angle/AngleInteractor.swift +29 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Angle/AnglePresenter.swift +7 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Animation/AnimationInteractor.swift +56 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Appearance/AppearanceInteractor.swift +58 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Appearance/AppearancePresenter.swift +5 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/ClosedRange+Normalize.swift +16 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/Image+OptionalType.swift +102 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/ModifiedContent+SkeletonModifier.swift +26 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/Optional+OptionalType.swift +5 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/SecureField+OptionalType.swift +19 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/Text+OptionalType.swift +27 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/TextField+OptionalType.swift +35 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/Toggle+OptionalType.swift +29 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/UnitPoint+Angle.swift +8 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Extensions/View+SkeletonModifier.swift +8 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Modifiers/SkeletonModifier.swift +52 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Multiline/MultilineInteractor.swift +41 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Multiline/MultilinePresenter.swift +9 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Opacity/OpacityInteractor.swift +29 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Opacity/OpacityPresenter.swift +7 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Position/PositionInteractor.swift +29 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Position/PositionPresenter.swift +7 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Protocols/OptionalType.swift +4 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Radius/RadiusInteractor.swift +29 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Radius/RadiusPresenter.swift +7 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Shape/ShapeInteractor.swift +33 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Shape/ShapePresenter.swift +5 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonForEach.swift +20 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonInteractor.swift +27 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonList.swift +20 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonPresenter.swift +15 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonShape.swift +64 -0
- package/example/ios/Pods/SkeletonUI/Sources/SkeletonUI/Skeleton/SkeletonView.swift +25 -0
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.debug.xcconfig +4 -1
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.release.xcconfig +4 -1
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown +72 -0
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist +90 -0
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig +6 -5
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig +6 -5
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m +5 -0
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch +12 -0
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h +75 -0
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage.debug.xcconfig +14 -0
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap +6 -0
- package/example/ios/Pods/Target Support Files/SDWebImage/SDWebImage.release.xcconfig +14 -0
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI-dummy.m +5 -0
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI-prefix.pch +12 -0
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI-umbrella.h +17 -0
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI.debug.xcconfig +17 -0
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI.modulemap +6 -0
- package/example/ios/Pods/Target Support Files/SDWebImageSwiftUI/SDWebImageSwiftUI.release.xcconfig +17 -0
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI-dummy.m +5 -0
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI-prefix.pch +12 -0
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI-umbrella.h +16 -0
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI.debug.xcconfig +12 -0
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI.modulemap +6 -0
- package/example/ios/Pods/Target Support Files/SkeletonUI/SkeletonUI.release.xcconfig +12 -0
- package/ios/Checkbox/Checkbox.swift +38 -0
- package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Colors.swift +0 -0
- package/ios/Colors+Radius+Spacing/Radius.swift +22 -0
- package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Spacing.swift +0 -0
- package/ios/Extensions/View++.swift +9 -0
- package/ios/Image/Image.swift +60 -0
- package/ios/Input/Input.swift +148 -0
- package/ios/OTPKeyboard/OTPKeyboard.swift +3 -3
- package/ios/Popup/PopupDisplay.swift +178 -0
- package/ios/PopupView/FullscreenPopup.swift +251 -0
- package/ios/{Popup → PopupView}/Modifiers.swift +6 -20
- package/ios/{Popup → PopupView}/PopupView.swift +38 -146
- package/ios/PopupView/Utils++.swift +281 -0
- package/ios/Swipeable/SwipeCell.swift +1 -1
- package/ios/Switch/Switch.swift +44 -0
- package/ios/native-kits.podspec +2 -0
- package/package.json +1 -1
- package/ios/Colors+Spacing/Radius.swift +0 -11
- package/ios/Popup/Utils.swift +0 -186
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
|
|
11
|
+
/**
|
|
12
|
+
UIImage category about force decode feature (avoid Image/IO's lazy decoding during rendering behavior).
|
|
13
|
+
*/
|
|
14
|
+
@interface UIImage (ForceDecode)
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
A bool value indicating whether the image has already been decoded. This can help to avoid extra force decode.
|
|
18
|
+
*/
|
|
19
|
+
@property (nonatomic, assign) BOOL sd_isDecoded;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
Decode the provided image. This is useful if you want to force decode the image before rendering to improve performance.
|
|
23
|
+
|
|
24
|
+
@param image The image to be decoded
|
|
25
|
+
@return The decoded image
|
|
26
|
+
*/
|
|
27
|
+
+ (nullable UIImage *)sd_decodedImageWithImage:(nullable UIImage *)image;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
Decode and scale down the provided image
|
|
31
|
+
|
|
32
|
+
@param image The image to be decoded
|
|
33
|
+
@return The decoded and scaled down image
|
|
34
|
+
*/
|
|
35
|
+
+ (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
Decode and scale down the provided image with limit bytes
|
|
39
|
+
|
|
40
|
+
@param image The image to be decoded
|
|
41
|
+
@param bytes The limit bytes size. Provide 0 to use the build-in limit.
|
|
42
|
+
@return The decoded and scaled down image
|
|
43
|
+
*/
|
|
44
|
+
+ (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image limitBytes:(NSUInteger)bytes;
|
|
45
|
+
|
|
46
|
+
@end
|
|
@@ -0,0 +1,60 @@
|
|
|
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 "UIImage+ForceDecode.h"
|
|
10
|
+
#import "SDImageCoderHelper.h"
|
|
11
|
+
#import "objc/runtime.h"
|
|
12
|
+
#import "NSImage+Compatibility.h"
|
|
13
|
+
|
|
14
|
+
@implementation UIImage (ForceDecode)
|
|
15
|
+
|
|
16
|
+
- (BOOL)sd_isDecoded {
|
|
17
|
+
NSNumber *value = objc_getAssociatedObject(self, @selector(sd_isDecoded));
|
|
18
|
+
if (value != nil) {
|
|
19
|
+
return value.boolValue;
|
|
20
|
+
} else {
|
|
21
|
+
// Assume only CGImage based can use lazy decoding
|
|
22
|
+
CGImageRef cgImage = self.CGImage;
|
|
23
|
+
if (cgImage) {
|
|
24
|
+
CFStringRef uttype = CGImageGetUTType(self.CGImage);
|
|
25
|
+
if (uttype) {
|
|
26
|
+
// Only ImageIO can set `com.apple.ImageIO.imageSourceTypeIdentifier`
|
|
27
|
+
return NO;
|
|
28
|
+
} else {
|
|
29
|
+
// Thumbnail or CGBitmapContext drawn image
|
|
30
|
+
return YES;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// Assume others as non-decoded
|
|
35
|
+
return NO;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
- (void)setSd_isDecoded:(BOOL)sd_isDecoded {
|
|
39
|
+
objc_setAssociatedObject(self, @selector(sd_isDecoded), @(sd_isDecoded), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
+ (nullable UIImage *)sd_decodedImageWithImage:(nullable UIImage *)image {
|
|
43
|
+
if (!image) {
|
|
44
|
+
return nil;
|
|
45
|
+
}
|
|
46
|
+
return [SDImageCoderHelper decodedImageWithImage:image];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
+ (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image {
|
|
50
|
+
return [self sd_decodedAndScaledDownImageWithImage:image limitBytes:0];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
+ (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image limitBytes:(NSUInteger)bytes {
|
|
54
|
+
if (!image) {
|
|
55
|
+
return nil;
|
|
56
|
+
}
|
|
57
|
+
return [SDImageCoderHelper decodedAndScaledDownImageWithImage:image limitBytes:bytes];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
4
|
+
* (c) Laurin Brandner
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import "SDWebImageCompat.h"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
This category is just use as a convenience method. For more detail control, use methods in `UIImage+MultiFormat.h` or directly use `SDImageCoder`.
|
|
14
|
+
*/
|
|
15
|
+
@interface UIImage (GIF)
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
Creates an animated UIImage from an NSData.
|
|
19
|
+
This will create animated image if the data is Animated GIF. And will create a static image is the data is Static GIF.
|
|
20
|
+
|
|
21
|
+
@param data The GIF data
|
|
22
|
+
@return The created image
|
|
23
|
+
*/
|
|
24
|
+
+ (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data;
|
|
25
|
+
|
|
26
|
+
@end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
4
|
+
* (c) Laurin Brandner
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import "UIImage+GIF.h"
|
|
11
|
+
#import "SDImageGIFCoder.h"
|
|
12
|
+
|
|
13
|
+
@implementation UIImage (GIF)
|
|
14
|
+
|
|
15
|
+
+ (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data {
|
|
16
|
+
if (!data) {
|
|
17
|
+
return nil;
|
|
18
|
+
}
|
|
19
|
+
return [[SDImageGIFCoder sharedCoder] decodedImageWithData:data options:0];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@end
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
|
|
11
|
+
/**
|
|
12
|
+
UIImage category for memory cache cost.
|
|
13
|
+
*/
|
|
14
|
+
@interface UIImage (MemoryCacheCost)
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
The memory cache cost for specify image used by image cache. The cost function is the bytes size held in memory.
|
|
18
|
+
If you set some associated object to `UIImage`, you can set the custom value to indicate the memory cost.
|
|
19
|
+
|
|
20
|
+
For `UIImage`, this method return the single frame bytes size when `image.images` is nil for static image. Return full frame bytes size when `image.images` is not nil for animated image.
|
|
21
|
+
For `NSImage`, this method return the single frame bytes size because `NSImage` does not store all frames in memory.
|
|
22
|
+
@note Note that because of the limitations of category this property can get out of sync if you create another instance with CGImage or other methods.
|
|
23
|
+
@note For custom animated class conforms to `SDAnimatedImage`, you can override this getter method in your subclass to return a more proper value instead, which representing the current frame's total bytes.
|
|
24
|
+
*/
|
|
25
|
+
@property (assign, nonatomic) NSUInteger sd_memoryCost;
|
|
26
|
+
|
|
27
|
+
@end
|
|
@@ -0,0 +1,47 @@
|
|
|
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 "UIImage+MemoryCacheCost.h"
|
|
10
|
+
#import "objc/runtime.h"
|
|
11
|
+
#import "NSImage+Compatibility.h"
|
|
12
|
+
|
|
13
|
+
FOUNDATION_STATIC_INLINE NSUInteger SDMemoryCacheCostForImage(UIImage *image) {
|
|
14
|
+
CGImageRef imageRef = image.CGImage;
|
|
15
|
+
if (!imageRef) {
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
NSUInteger bytesPerFrame = CGImageGetBytesPerRow(imageRef) * CGImageGetHeight(imageRef);
|
|
19
|
+
NSUInteger frameCount;
|
|
20
|
+
#if SD_MAC
|
|
21
|
+
frameCount = 1;
|
|
22
|
+
#elif SD_UIKIT || SD_WATCH
|
|
23
|
+
// Filter the same frame in `_UIAnimatedImage`.
|
|
24
|
+
frameCount = image.images.count > 1 ? [NSSet setWithArray:image.images].count : 1;
|
|
25
|
+
#endif
|
|
26
|
+
NSUInteger cost = bytesPerFrame * frameCount;
|
|
27
|
+
return cost;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@implementation UIImage (MemoryCacheCost)
|
|
31
|
+
|
|
32
|
+
- (NSUInteger)sd_memoryCost {
|
|
33
|
+
NSNumber *value = objc_getAssociatedObject(self, @selector(sd_memoryCost));
|
|
34
|
+
NSUInteger memoryCost;
|
|
35
|
+
if (value != nil) {
|
|
36
|
+
memoryCost = [value unsignedIntegerValue];
|
|
37
|
+
} else {
|
|
38
|
+
memoryCost = SDMemoryCacheCostForImage(self);
|
|
39
|
+
}
|
|
40
|
+
return memoryCost;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
- (void)setSd_memoryCost:(NSUInteger)sd_memoryCost {
|
|
44
|
+
objc_setAssociatedObject(self, @selector(sd_memoryCost), @(sd_memoryCost), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@end
|
|
@@ -0,0 +1,89 @@
|
|
|
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 "NSData+ImageContentType.h"
|
|
11
|
+
#import "SDImageCoder.h"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
UIImage category for image metadata, including animation, loop count, format, incremental, etc.
|
|
15
|
+
*/
|
|
16
|
+
@interface UIImage (Metadata)
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* UIKit:
|
|
20
|
+
* For static image format, this value is always 0.
|
|
21
|
+
* For animated image format, 0 means infinite looping.
|
|
22
|
+
* Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods.
|
|
23
|
+
* AppKit:
|
|
24
|
+
* NSImage currently only support animated via `NSBitmapImageRep`(GIF) or `SDAnimatedImageRep`(APNG/GIF/WebP) unlike UIImage.
|
|
25
|
+
* The getter of this property will get the loop count from animated imageRep
|
|
26
|
+
* The setter of this property will set the loop count from animated imageRep
|
|
27
|
+
*/
|
|
28
|
+
@property (nonatomic, assign) NSUInteger sd_imageLoopCount;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* UIKit:
|
|
32
|
+
* Returns the `images`'s count by unapply the patch for the different frame durations. Which matches the real visible frame count when displaying on UIImageView.
|
|
33
|
+
* See more in `SDImageCoderHelper.animatedImageWithFrames`.
|
|
34
|
+
* Returns 1 for static image.
|
|
35
|
+
* AppKit:
|
|
36
|
+
* Returns the underlaying `NSBitmapImageRep` or `SDAnimatedImageRep` frame count.
|
|
37
|
+
* Returns 1 for static image.
|
|
38
|
+
*/
|
|
39
|
+
@property (nonatomic, assign, readonly) NSUInteger sd_imageFrameCount;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* UIKit:
|
|
43
|
+
* Check the `images` array property.
|
|
44
|
+
* AppKit:
|
|
45
|
+
* NSImage currently only support animated via GIF imageRep unlike UIImage. It will check the imageRep's frame count.
|
|
46
|
+
*/
|
|
47
|
+
@property (nonatomic, assign, readonly) BOOL sd_isAnimated;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* UIKit:
|
|
51
|
+
* Check the `isSymbolImage` property. Also check the system PDF(iOS 11+) && SVG(iOS 13+) support.
|
|
52
|
+
* AppKit:
|
|
53
|
+
* NSImage supports PDF && SVG && EPS imageRep, check the imageRep class.
|
|
54
|
+
*/
|
|
55
|
+
@property (nonatomic, assign, readonly) BOOL sd_isVector;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The image format represent the original compressed image data format.
|
|
59
|
+
* If you don't manually specify a format, this information is retrieve from CGImage using `CGImageGetUTType`, which may return nil for non-CG based image. At this time it will return `SDImageFormatUndefined` as default value.
|
|
60
|
+
* @note Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods.
|
|
61
|
+
*/
|
|
62
|
+
@property (nonatomic, assign) SDImageFormat sd_imageFormat;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
A bool value indicating whether the image is during incremental decoding and may not contains full pixels.
|
|
66
|
+
*/
|
|
67
|
+
@property (nonatomic, assign) BOOL sd_isIncremental;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
A bool value indicating that the image is transformed from original image, so the image data may not always match original download one.
|
|
71
|
+
*/
|
|
72
|
+
@property (nonatomic, assign) BOOL sd_isTransformed;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
A bool value indicating that the image is using thumbnail decode with smaller size, so the image data may not always match original download one.
|
|
76
|
+
@note This just check `sd_decodeOptions[.decodeThumbnailPixelSize] > CGSize.zero`
|
|
77
|
+
*/
|
|
78
|
+
@property (nonatomic, assign, readonly) BOOL sd_isThumbnail;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
A dictionary value contains the decode options when decoded from SDWebImage loading system (say, `SDImageCacheDecodeImageData/SDImageLoaderDecode[Progressive]ImageData`)
|
|
82
|
+
It may not always available and only image decoding related options will be saved. (including [.decodeScaleFactor, .decodeThumbnailPixelSize, .decodePreserveAspectRatio, .decodeFirstFrameOnly])
|
|
83
|
+
@note This is used to identify and check the image is from thumbnail decoding, and the callback's data **will be nil** (because this time the data saved to disk does not match the image return to you. If you need full size data, query the cache with full size url key)
|
|
84
|
+
@warning You should not store object inside which keep strong reference to image itself, which will cause retain cycle.
|
|
85
|
+
@warning This API exist only because of current SDWebImageDownloader bad design which does not callback the context we call it. There will be refactor in future (API break), use with caution.
|
|
86
|
+
*/
|
|
87
|
+
@property (nonatomic, copy) SDImageCoderOptions *sd_decodeOptions;
|
|
88
|
+
|
|
89
|
+
@end
|
|
@@ -0,0 +1,221 @@
|
|
|
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 "UIImage+Metadata.h"
|
|
10
|
+
#import "NSImage+Compatibility.h"
|
|
11
|
+
#import "SDInternalMacros.h"
|
|
12
|
+
#import "objc/runtime.h"
|
|
13
|
+
|
|
14
|
+
@implementation UIImage (Metadata)
|
|
15
|
+
|
|
16
|
+
#if SD_UIKIT || SD_WATCH
|
|
17
|
+
|
|
18
|
+
- (NSUInteger)sd_imageLoopCount {
|
|
19
|
+
NSUInteger imageLoopCount = 0;
|
|
20
|
+
NSNumber *value = objc_getAssociatedObject(self, @selector(sd_imageLoopCount));
|
|
21
|
+
if ([value isKindOfClass:[NSNumber class]]) {
|
|
22
|
+
imageLoopCount = value.unsignedIntegerValue;
|
|
23
|
+
}
|
|
24
|
+
return imageLoopCount;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
- (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount {
|
|
28
|
+
NSNumber *value = @(sd_imageLoopCount);
|
|
29
|
+
objc_setAssociatedObject(self, @selector(sd_imageLoopCount), value, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
- (NSUInteger)sd_imageFrameCount {
|
|
33
|
+
NSArray<UIImage *> *animatedImages = self.images;
|
|
34
|
+
if (!animatedImages || animatedImages.count <= 1) {
|
|
35
|
+
return 1;
|
|
36
|
+
}
|
|
37
|
+
NSNumber *value = objc_getAssociatedObject(self, @selector(sd_imageFrameCount));
|
|
38
|
+
if ([value isKindOfClass:[NSNumber class]]) {
|
|
39
|
+
return [value unsignedIntegerValue];
|
|
40
|
+
}
|
|
41
|
+
__block NSUInteger frameCount = 1;
|
|
42
|
+
__block UIImage *previousImage = animatedImages.firstObject;
|
|
43
|
+
[animatedImages enumerateObjectsUsingBlock:^(UIImage * _Nonnull image, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
44
|
+
// ignore first
|
|
45
|
+
if (idx == 0) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (![image isEqual:previousImage]) {
|
|
49
|
+
frameCount++;
|
|
50
|
+
}
|
|
51
|
+
previousImage = image;
|
|
52
|
+
}];
|
|
53
|
+
objc_setAssociatedObject(self, @selector(sd_imageFrameCount), @(frameCount), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
54
|
+
|
|
55
|
+
return frameCount;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
- (BOOL)sd_isAnimated {
|
|
59
|
+
return (self.images != nil);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#pragma clang diagnostic push
|
|
63
|
+
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
|
64
|
+
- (BOOL)sd_isVector {
|
|
65
|
+
if (@available(iOS 13.0, tvOS 13.0, watchOS 6.0, *)) {
|
|
66
|
+
// Xcode 11 supports symbol image, keep Xcode 10 compatible currently
|
|
67
|
+
SEL SymbolSelector = NSSelectorFromString(@"isSymbolImage");
|
|
68
|
+
if ([self respondsToSelector:SymbolSelector] && [self performSelector:SymbolSelector]) {
|
|
69
|
+
return YES;
|
|
70
|
+
}
|
|
71
|
+
// SVG
|
|
72
|
+
SEL SVGSelector = SD_SEL_SPI(CGSVGDocument);
|
|
73
|
+
if ([self respondsToSelector:SVGSelector] && [self performSelector:SVGSelector]) {
|
|
74
|
+
return YES;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (@available(iOS 11.0, tvOS 11.0, watchOS 4.0, *)) {
|
|
78
|
+
// PDF
|
|
79
|
+
SEL PDFSelector = SD_SEL_SPI(CGPDFPage);
|
|
80
|
+
if ([self respondsToSelector:PDFSelector] && [self performSelector:PDFSelector]) {
|
|
81
|
+
return YES;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return NO;
|
|
85
|
+
}
|
|
86
|
+
#pragma clang diagnostic pop
|
|
87
|
+
|
|
88
|
+
#else
|
|
89
|
+
|
|
90
|
+
- (NSUInteger)sd_imageLoopCount {
|
|
91
|
+
NSUInteger imageLoopCount = 0;
|
|
92
|
+
NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height);
|
|
93
|
+
NSImageRep *imageRep = [self bestRepresentationForRect:imageRect context:nil hints:nil];
|
|
94
|
+
NSBitmapImageRep *bitmapImageRep;
|
|
95
|
+
if ([imageRep isKindOfClass:[NSBitmapImageRep class]]) {
|
|
96
|
+
bitmapImageRep = (NSBitmapImageRep *)imageRep;
|
|
97
|
+
}
|
|
98
|
+
if (bitmapImageRep) {
|
|
99
|
+
imageLoopCount = [[bitmapImageRep valueForProperty:NSImageLoopCount] unsignedIntegerValue];
|
|
100
|
+
}
|
|
101
|
+
return imageLoopCount;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
- (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount {
|
|
105
|
+
NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height);
|
|
106
|
+
NSImageRep *imageRep = [self bestRepresentationForRect:imageRect context:nil hints:nil];
|
|
107
|
+
NSBitmapImageRep *bitmapImageRep;
|
|
108
|
+
if ([imageRep isKindOfClass:[NSBitmapImageRep class]]) {
|
|
109
|
+
bitmapImageRep = (NSBitmapImageRep *)imageRep;
|
|
110
|
+
}
|
|
111
|
+
if (bitmapImageRep) {
|
|
112
|
+
[bitmapImageRep setProperty:NSImageLoopCount withValue:@(sd_imageLoopCount)];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
- (NSUInteger)sd_imageFrameCount {
|
|
117
|
+
NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height);
|
|
118
|
+
NSImageRep *imageRep = [self bestRepresentationForRect:imageRect context:nil hints:nil];
|
|
119
|
+
NSBitmapImageRep *bitmapImageRep;
|
|
120
|
+
if ([imageRep isKindOfClass:[NSBitmapImageRep class]]) {
|
|
121
|
+
bitmapImageRep = (NSBitmapImageRep *)imageRep;
|
|
122
|
+
}
|
|
123
|
+
if (bitmapImageRep) {
|
|
124
|
+
return [[bitmapImageRep valueForProperty:NSImageFrameCount] unsignedIntegerValue];
|
|
125
|
+
}
|
|
126
|
+
return 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
- (BOOL)sd_isAnimated {
|
|
130
|
+
BOOL isAnimated = NO;
|
|
131
|
+
NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height);
|
|
132
|
+
NSImageRep *imageRep = [self bestRepresentationForRect:imageRect context:nil hints:nil];
|
|
133
|
+
NSBitmapImageRep *bitmapImageRep;
|
|
134
|
+
if ([imageRep isKindOfClass:[NSBitmapImageRep class]]) {
|
|
135
|
+
bitmapImageRep = (NSBitmapImageRep *)imageRep;
|
|
136
|
+
}
|
|
137
|
+
if (bitmapImageRep) {
|
|
138
|
+
NSUInteger frameCount = [[bitmapImageRep valueForProperty:NSImageFrameCount] unsignedIntegerValue];
|
|
139
|
+
isAnimated = frameCount > 1 ? YES : NO;
|
|
140
|
+
}
|
|
141
|
+
return isAnimated;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
- (BOOL)sd_isVector {
|
|
145
|
+
NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height);
|
|
146
|
+
NSImageRep *imageRep = [self bestRepresentationForRect:imageRect context:nil hints:nil];
|
|
147
|
+
if ([imageRep isKindOfClass:[NSPDFImageRep class]]) {
|
|
148
|
+
return YES;
|
|
149
|
+
}
|
|
150
|
+
if ([imageRep isKindOfClass:[NSEPSImageRep class]]) {
|
|
151
|
+
return YES;
|
|
152
|
+
}
|
|
153
|
+
if ([NSStringFromClass(imageRep.class) hasSuffix:@"NSSVGImageRep"]) {
|
|
154
|
+
return YES;
|
|
155
|
+
}
|
|
156
|
+
return NO;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
#endif
|
|
160
|
+
|
|
161
|
+
- (SDImageFormat)sd_imageFormat {
|
|
162
|
+
SDImageFormat imageFormat = SDImageFormatUndefined;
|
|
163
|
+
NSNumber *value = objc_getAssociatedObject(self, @selector(sd_imageFormat));
|
|
164
|
+
if ([value isKindOfClass:[NSNumber class]]) {
|
|
165
|
+
imageFormat = value.integerValue;
|
|
166
|
+
return imageFormat;
|
|
167
|
+
}
|
|
168
|
+
// Check CGImage's UTType, may return nil for non-Image/IO based image
|
|
169
|
+
CFStringRef uttype = CGImageGetUTType(self.CGImage);
|
|
170
|
+
imageFormat = [NSData sd_imageFormatFromUTType:uttype];
|
|
171
|
+
return imageFormat;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
- (void)setSd_imageFormat:(SDImageFormat)sd_imageFormat {
|
|
175
|
+
objc_setAssociatedObject(self, @selector(sd_imageFormat), @(sd_imageFormat), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
- (void)setSd_isIncremental:(BOOL)sd_isIncremental {
|
|
179
|
+
objc_setAssociatedObject(self, @selector(sd_isIncremental), @(sd_isIncremental), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
- (BOOL)sd_isIncremental {
|
|
183
|
+
NSNumber *value = objc_getAssociatedObject(self, @selector(sd_isIncremental));
|
|
184
|
+
return value.boolValue;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
- (void)setSd_isTransformed:(BOOL)sd_isTransformed {
|
|
188
|
+
objc_setAssociatedObject(self, @selector(sd_isTransformed), @(sd_isTransformed), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
- (BOOL)sd_isTransformed {
|
|
192
|
+
NSNumber *value = objc_getAssociatedObject(self, @selector(sd_isTransformed));
|
|
193
|
+
return value.boolValue;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
- (void)setSd_decodeOptions:(SDImageCoderOptions *)sd_decodeOptions {
|
|
197
|
+
objc_setAssociatedObject(self, @selector(sd_decodeOptions), sd_decodeOptions, OBJC_ASSOCIATION_COPY_NONATOMIC);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
-(BOOL)sd_isThumbnail {
|
|
201
|
+
CGSize thumbnailSize = CGSizeZero;
|
|
202
|
+
NSValue *thumbnailSizeValue = self.sd_decodeOptions[SDImageCoderDecodeThumbnailPixelSize];
|
|
203
|
+
if (thumbnailSizeValue != nil) {
|
|
204
|
+
#if SD_MAC
|
|
205
|
+
thumbnailSize = thumbnailSizeValue.sizeValue;
|
|
206
|
+
#else
|
|
207
|
+
thumbnailSize = thumbnailSizeValue.CGSizeValue;
|
|
208
|
+
#endif
|
|
209
|
+
}
|
|
210
|
+
return thumbnailSize.width > 0 && thumbnailSize.height > 0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
- (SDImageCoderOptions *)sd_decodeOptions {
|
|
214
|
+
SDImageCoderOptions *value = objc_getAssociatedObject(self, @selector(sd_decodeOptions));
|
|
215
|
+
if ([value isKindOfClass:NSDictionary.class]) {
|
|
216
|
+
return value;
|
|
217
|
+
}
|
|
218
|
+
return nil;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@end
|
|
@@ -0,0 +1,80 @@
|
|
|
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 "NSData+ImageContentType.h"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
UIImage category for convenient image format decoding/encoding.
|
|
14
|
+
*/
|
|
15
|
+
@interface UIImage (MultiFormat)
|
|
16
|
+
#pragma mark - Decode
|
|
17
|
+
/**
|
|
18
|
+
Create and decode a image with the specify image data
|
|
19
|
+
|
|
20
|
+
@param data The image data
|
|
21
|
+
@return The created image
|
|
22
|
+
*/
|
|
23
|
+
+ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
Create and decode a image with the specify image data and scale
|
|
27
|
+
|
|
28
|
+
@param data The image data
|
|
29
|
+
@param scale The image scale factor. Should be greater than or equal to 1.0.
|
|
30
|
+
@return The created image
|
|
31
|
+
*/
|
|
32
|
+
+ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
Create and decode a image with the specify image data and scale, allow specify animate/static control
|
|
36
|
+
|
|
37
|
+
@param data The image data
|
|
38
|
+
@param scale The image scale factor. Should be greater than or equal to 1.0.
|
|
39
|
+
@param firstFrameOnly Even if the image data is animated image format, decode the first frame only as static image.
|
|
40
|
+
@return The created image
|
|
41
|
+
*/
|
|
42
|
+
+ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale firstFrameOnly:(BOOL)firstFrameOnly;
|
|
43
|
+
|
|
44
|
+
#pragma mark - Encode
|
|
45
|
+
/**
|
|
46
|
+
Encode the current image to the data, the image format is unspecified
|
|
47
|
+
|
|
48
|
+
@note If the receiver is `SDAnimatedImage`, this will return the animated image data if available. No more extra encoding process.
|
|
49
|
+
@return The encoded data. If can't encode, return nil
|
|
50
|
+
*/
|
|
51
|
+
- (nullable NSData *)sd_imageData;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
Encode the current image to data with the specify image format
|
|
55
|
+
|
|
56
|
+
@param imageFormat The specify image format
|
|
57
|
+
@return The encoded data. If can't encode, return nil
|
|
58
|
+
*/
|
|
59
|
+
- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat NS_SWIFT_NAME(sd_imageData(as:));
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
Encode the current image to data with the specify image format and compression quality
|
|
63
|
+
|
|
64
|
+
@param imageFormat The specify image format
|
|
65
|
+
@param compressionQuality The quality of the resulting image data. Value between 0.0-1.0. Some coders may not support compression quality.
|
|
66
|
+
@return The encoded data. If can't encode, return nil
|
|
67
|
+
*/
|
|
68
|
+
- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality NS_SWIFT_NAME(sd_imageData(as:compressionQuality:));
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
Encode the current image to data with the specify image format and compression quality, allow specify animate/static control
|
|
72
|
+
|
|
73
|
+
@param imageFormat The specify image format
|
|
74
|
+
@param compressionQuality The quality of the resulting image data. Value between 0.0-1.0. Some coders may not support compression quality.
|
|
75
|
+
@param firstFrameOnly Even if the image is animated image, encode the first frame only as static image.
|
|
76
|
+
@return The encoded data. If can't encode, return nil
|
|
77
|
+
*/
|
|
78
|
+
- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality firstFrameOnly:(BOOL)firstFrameOnly NS_SWIFT_NAME(sd_imageData(as:compressionQuality:firstFrameOnly:));
|
|
79
|
+
|
|
80
|
+
@end
|
|
@@ -0,0 +1,47 @@
|
|
|
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 "UIImage+MultiFormat.h"
|
|
10
|
+
#import "SDImageCodersManager.h"
|
|
11
|
+
|
|
12
|
+
@implementation UIImage (MultiFormat)
|
|
13
|
+
|
|
14
|
+
+ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data {
|
|
15
|
+
return [self sd_imageWithData:data scale:1];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
+ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale {
|
|
19
|
+
return [self sd_imageWithData:data scale:scale firstFrameOnly:NO];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
+ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale firstFrameOnly:(BOOL)firstFrameOnly {
|
|
23
|
+
if (!data) {
|
|
24
|
+
return nil;
|
|
25
|
+
}
|
|
26
|
+
SDImageCoderOptions *options = @{SDImageCoderDecodeScaleFactor : @(MAX(scale, 1)), SDImageCoderDecodeFirstFrameOnly : @(firstFrameOnly)};
|
|
27
|
+
return [[SDImageCodersManager sharedManager] decodedImageWithData:data options:options];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
- (nullable NSData *)sd_imageData {
|
|
31
|
+
return [self sd_imageDataAsFormat:SDImageFormatUndefined];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat {
|
|
35
|
+
return [self sd_imageDataAsFormat:imageFormat compressionQuality:1];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality {
|
|
39
|
+
return [self sd_imageDataAsFormat:imageFormat compressionQuality:compressionQuality firstFrameOnly:NO];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality firstFrameOnly:(BOOL)firstFrameOnly {
|
|
43
|
+
SDImageCoderOptions *options = @{SDImageCoderEncodeCompressionQuality : @(compressionQuality), SDImageCoderEncodeFirstFrameOnly : @(firstFrameOnly)};
|
|
44
|
+
return [[SDImageCodersManager sharedManager] encodedDataWithImage:self format:imageFormat options:options];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@end
|