@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,540 @@
|
|
|
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 "SDAnimatedImageView.h"
|
|
10
|
+
|
|
11
|
+
#if SD_UIKIT || SD_MAC
|
|
12
|
+
|
|
13
|
+
#import "UIImage+Metadata.h"
|
|
14
|
+
#import "NSImage+Compatibility.h"
|
|
15
|
+
#import "SDInternalMacros.h"
|
|
16
|
+
#import "objc/runtime.h"
|
|
17
|
+
|
|
18
|
+
@interface UIImageView () <CALayerDelegate>
|
|
19
|
+
@end
|
|
20
|
+
|
|
21
|
+
@interface SDAnimatedImageView () {
|
|
22
|
+
BOOL _initFinished; // Extra flag to mark the `commonInit` is called
|
|
23
|
+
NSRunLoopMode _runLoopMode;
|
|
24
|
+
NSUInteger _maxBufferSize;
|
|
25
|
+
double _playbackRate;
|
|
26
|
+
SDAnimatedImagePlaybackMode _playbackMode;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@property (nonatomic, strong, readwrite) SDAnimatedImagePlayer *player;
|
|
30
|
+
@property (nonatomic, strong, readwrite) UIImage *currentFrame;
|
|
31
|
+
@property (nonatomic, assign, readwrite) NSUInteger currentFrameIndex;
|
|
32
|
+
@property (nonatomic, assign, readwrite) NSUInteger currentLoopCount;
|
|
33
|
+
@property (nonatomic, assign) BOOL shouldAnimate;
|
|
34
|
+
@property (nonatomic, assign) BOOL isProgressive;
|
|
35
|
+
@property (nonatomic) CALayer *imageViewLayer; // The actual rendering layer.
|
|
36
|
+
|
|
37
|
+
@end
|
|
38
|
+
|
|
39
|
+
@implementation SDAnimatedImageView
|
|
40
|
+
#if SD_UIKIT
|
|
41
|
+
@dynamic animationRepeatCount; // we re-use this property from `UIImageView` super class on iOS.
|
|
42
|
+
#endif
|
|
43
|
+
|
|
44
|
+
#pragma mark - Initializers
|
|
45
|
+
|
|
46
|
+
#if SD_MAC
|
|
47
|
+
+ (instancetype)imageViewWithImage:(NSImage *)image
|
|
48
|
+
{
|
|
49
|
+
NSRect frame = NSMakeRect(0, 0, image.size.width, image.size.height);
|
|
50
|
+
SDAnimatedImageView *imageView = [[SDAnimatedImageView alloc] initWithFrame:frame];
|
|
51
|
+
[imageView setImage:image];
|
|
52
|
+
return imageView;
|
|
53
|
+
}
|
|
54
|
+
#else
|
|
55
|
+
// -initWithImage: isn't documented as a designated initializer of UIImageView, but it actually seems to be.
|
|
56
|
+
// Using -initWithImage: doesn't call any of the other designated initializers.
|
|
57
|
+
- (instancetype)initWithImage:(UIImage *)image
|
|
58
|
+
{
|
|
59
|
+
self = [super initWithImage:image];
|
|
60
|
+
if (self) {
|
|
61
|
+
[self commonInit];
|
|
62
|
+
}
|
|
63
|
+
return self;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// -initWithImage:highlightedImage: also isn't documented as a designated initializer of UIImageView, but it doesn't call any other designated initializers.
|
|
67
|
+
- (instancetype)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage
|
|
68
|
+
{
|
|
69
|
+
self = [super initWithImage:image highlightedImage:highlightedImage];
|
|
70
|
+
if (self) {
|
|
71
|
+
[self commonInit];
|
|
72
|
+
}
|
|
73
|
+
return self;
|
|
74
|
+
}
|
|
75
|
+
#endif
|
|
76
|
+
|
|
77
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
78
|
+
{
|
|
79
|
+
self = [super initWithFrame:frame];
|
|
80
|
+
if (self) {
|
|
81
|
+
[self commonInit];
|
|
82
|
+
}
|
|
83
|
+
return self;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
- (instancetype)initWithCoder:(NSCoder *)aDecoder
|
|
87
|
+
{
|
|
88
|
+
self = [super initWithCoder:aDecoder];
|
|
89
|
+
if (self) {
|
|
90
|
+
[self commonInit];
|
|
91
|
+
}
|
|
92
|
+
return self;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
- (void)commonInit
|
|
96
|
+
{
|
|
97
|
+
// Pay attention that UIKit's `initWithImage:` will trigger a `setImage:` during initialization before this `commonInit`.
|
|
98
|
+
// So the properties which rely on this order, should using lazy-evaluation or do extra check in `setImage:`.
|
|
99
|
+
self.autoPlayAnimatedImage = YES;
|
|
100
|
+
self.shouldCustomLoopCount = NO;
|
|
101
|
+
self.shouldIncrementalLoad = YES;
|
|
102
|
+
self.playbackRate = 1.0;
|
|
103
|
+
#if SD_MAC
|
|
104
|
+
self.wantsLayer = YES;
|
|
105
|
+
#endif
|
|
106
|
+
// Mark commonInit finished
|
|
107
|
+
_initFinished = YES;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
#pragma mark - Accessors
|
|
111
|
+
#pragma mark Public
|
|
112
|
+
|
|
113
|
+
- (void)setImage:(UIImage *)image
|
|
114
|
+
{
|
|
115
|
+
if (self.image == image) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Check Progressive rendering
|
|
120
|
+
[self updateIsProgressiveWithImage:image];
|
|
121
|
+
|
|
122
|
+
if (!self.isProgressive) {
|
|
123
|
+
// Stop animating
|
|
124
|
+
self.player = nil;
|
|
125
|
+
self.currentFrame = nil;
|
|
126
|
+
self.currentFrameIndex = 0;
|
|
127
|
+
self.currentLoopCount = 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// We need call super method to keep function. This will impliedly call `setNeedsDisplay`. But we have no way to avoid this when using animated image. So we call `setNeedsDisplay` again at the end.
|
|
131
|
+
super.image = image;
|
|
132
|
+
if ([image.class conformsToProtocol:@protocol(SDAnimatedImage)]) {
|
|
133
|
+
if (!self.player) {
|
|
134
|
+
id<SDAnimatedImageProvider> provider;
|
|
135
|
+
// Check progressive loading
|
|
136
|
+
if (self.isProgressive) {
|
|
137
|
+
provider = [self progressiveAnimatedCoderForImage:image];
|
|
138
|
+
} else {
|
|
139
|
+
provider = (id<SDAnimatedImage>)image;
|
|
140
|
+
}
|
|
141
|
+
// Create animated player
|
|
142
|
+
self.player = [SDAnimatedImagePlayer playerWithProvider:provider];
|
|
143
|
+
} else {
|
|
144
|
+
// Update Frame Count
|
|
145
|
+
self.player.totalFrameCount = [(id<SDAnimatedImage>)image animatedImageFrameCount];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (!self.player) {
|
|
149
|
+
// animated player nil means the image format is not supported, or frame count <= 1
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Custom Loop Count
|
|
154
|
+
if (self.shouldCustomLoopCount) {
|
|
155
|
+
self.player.totalLoopCount = self.animationRepeatCount;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// RunLoop Mode
|
|
159
|
+
self.player.runLoopMode = self.runLoopMode;
|
|
160
|
+
|
|
161
|
+
// Max Buffer Size
|
|
162
|
+
self.player.maxBufferSize = self.maxBufferSize;
|
|
163
|
+
|
|
164
|
+
// Play Rate
|
|
165
|
+
self.player.playbackRate = self.playbackRate;
|
|
166
|
+
|
|
167
|
+
// Play Mode
|
|
168
|
+
self.player.playbackMode = self.playbackMode;
|
|
169
|
+
|
|
170
|
+
// Setup handler
|
|
171
|
+
@weakify(self);
|
|
172
|
+
self.player.animationFrameHandler = ^(NSUInteger index, UIImage * frame) {
|
|
173
|
+
@strongify(self);
|
|
174
|
+
self.currentFrameIndex = index;
|
|
175
|
+
self.currentFrame = frame;
|
|
176
|
+
[self.imageViewLayer setNeedsDisplay];
|
|
177
|
+
};
|
|
178
|
+
self.player.animationLoopHandler = ^(NSUInteger loopCount) {
|
|
179
|
+
@strongify(self);
|
|
180
|
+
// Progressive image reach the current last frame index. Keep the state and pause animating. Wait for later restart
|
|
181
|
+
if (self.isProgressive) {
|
|
182
|
+
NSUInteger lastFrameIndex = self.player.totalFrameCount - 1;
|
|
183
|
+
[self.player seekToFrameAtIndex:lastFrameIndex loopCount:0];
|
|
184
|
+
[self.player pausePlaying];
|
|
185
|
+
} else {
|
|
186
|
+
self.currentLoopCount = loopCount;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
// Ensure disabled highlighting; it's not supported (see `-setHighlighted:`).
|
|
191
|
+
super.highlighted = NO;
|
|
192
|
+
|
|
193
|
+
[self stopAnimating];
|
|
194
|
+
[self checkPlay];
|
|
195
|
+
}
|
|
196
|
+
[self.imageViewLayer setNeedsDisplay];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
#pragma mark - Configuration
|
|
200
|
+
|
|
201
|
+
- (void)setRunLoopMode:(NSRunLoopMode)runLoopMode
|
|
202
|
+
{
|
|
203
|
+
_runLoopMode = [runLoopMode copy];
|
|
204
|
+
self.player.runLoopMode = runLoopMode;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
- (NSRunLoopMode)runLoopMode
|
|
208
|
+
{
|
|
209
|
+
if (!_runLoopMode) {
|
|
210
|
+
_runLoopMode = [[self class] defaultRunLoopMode];
|
|
211
|
+
}
|
|
212
|
+
return _runLoopMode;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
+ (NSString *)defaultRunLoopMode {
|
|
216
|
+
// Key off `activeProcessorCount` (as opposed to `processorCount`) since the system could shut down cores in certain situations.
|
|
217
|
+
return [NSProcessInfo processInfo].activeProcessorCount > 1 ? NSRunLoopCommonModes : NSDefaultRunLoopMode;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
- (void)setMaxBufferSize:(NSUInteger)maxBufferSize
|
|
221
|
+
{
|
|
222
|
+
_maxBufferSize = maxBufferSize;
|
|
223
|
+
self.player.maxBufferSize = maxBufferSize;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
- (NSUInteger)maxBufferSize {
|
|
227
|
+
return _maxBufferSize; // Defaults to 0
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
- (void)setPlaybackRate:(double)playbackRate
|
|
231
|
+
{
|
|
232
|
+
_playbackRate = playbackRate;
|
|
233
|
+
self.player.playbackRate = playbackRate;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
- (double)playbackRate
|
|
237
|
+
{
|
|
238
|
+
if (!_initFinished) {
|
|
239
|
+
return 1.0; // Defaults to 1.0
|
|
240
|
+
}
|
|
241
|
+
return _playbackRate;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
- (void)setPlaybackMode:(SDAnimatedImagePlaybackMode)playbackMode {
|
|
245
|
+
_playbackMode = playbackMode;
|
|
246
|
+
self.player.playbackMode = playbackMode;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
- (SDAnimatedImagePlaybackMode)playbackMode {
|
|
250
|
+
if (!_initFinished) {
|
|
251
|
+
return SDAnimatedImagePlaybackModeNormal; // Default mode is normal
|
|
252
|
+
}
|
|
253
|
+
return _playbackMode;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
- (BOOL)shouldIncrementalLoad
|
|
258
|
+
{
|
|
259
|
+
if (!_initFinished) {
|
|
260
|
+
return YES; // Defaults to YES
|
|
261
|
+
}
|
|
262
|
+
return _initFinished;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
#pragma mark - UIView Method Overrides
|
|
266
|
+
#pragma mark Observing View-Related Changes
|
|
267
|
+
|
|
268
|
+
#if SD_MAC
|
|
269
|
+
- (void)viewDidMoveToSuperview
|
|
270
|
+
#else
|
|
271
|
+
- (void)didMoveToSuperview
|
|
272
|
+
#endif
|
|
273
|
+
{
|
|
274
|
+
#if SD_MAC
|
|
275
|
+
[super viewDidMoveToSuperview];
|
|
276
|
+
#else
|
|
277
|
+
[super didMoveToSuperview];
|
|
278
|
+
#endif
|
|
279
|
+
|
|
280
|
+
[self checkPlay];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
#if SD_MAC
|
|
284
|
+
- (void)viewDidMoveToWindow
|
|
285
|
+
#else
|
|
286
|
+
- (void)didMoveToWindow
|
|
287
|
+
#endif
|
|
288
|
+
{
|
|
289
|
+
#if SD_MAC
|
|
290
|
+
[super viewDidMoveToWindow];
|
|
291
|
+
#else
|
|
292
|
+
[super didMoveToWindow];
|
|
293
|
+
#endif
|
|
294
|
+
|
|
295
|
+
[self checkPlay];
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
#if SD_MAC
|
|
299
|
+
- (void)setAlphaValue:(CGFloat)alphaValue
|
|
300
|
+
#else
|
|
301
|
+
- (void)setAlpha:(CGFloat)alpha
|
|
302
|
+
#endif
|
|
303
|
+
{
|
|
304
|
+
#if SD_MAC
|
|
305
|
+
[super setAlphaValue:alphaValue];
|
|
306
|
+
#else
|
|
307
|
+
[super setAlpha:alpha];
|
|
308
|
+
#endif
|
|
309
|
+
|
|
310
|
+
[self checkPlay];
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
- (void)setHidden:(BOOL)hidden
|
|
314
|
+
{
|
|
315
|
+
[super setHidden:hidden];
|
|
316
|
+
|
|
317
|
+
[self checkPlay];
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
#pragma mark - UIImageView Method Overrides
|
|
321
|
+
#pragma mark Image Data
|
|
322
|
+
|
|
323
|
+
- (void)setAnimationRepeatCount:(NSInteger)animationRepeatCount
|
|
324
|
+
{
|
|
325
|
+
#if SD_UIKIT
|
|
326
|
+
[super setAnimationRepeatCount:animationRepeatCount];
|
|
327
|
+
#else
|
|
328
|
+
_animationRepeatCount = animationRepeatCount;
|
|
329
|
+
#endif
|
|
330
|
+
|
|
331
|
+
if (self.shouldCustomLoopCount) {
|
|
332
|
+
self.player.totalLoopCount = animationRepeatCount;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
- (void)startAnimating
|
|
337
|
+
{
|
|
338
|
+
if (self.player) {
|
|
339
|
+
[self updateShouldAnimate];
|
|
340
|
+
if (self.shouldAnimate) {
|
|
341
|
+
[self.player startPlaying];
|
|
342
|
+
}
|
|
343
|
+
} else {
|
|
344
|
+
#if SD_UIKIT
|
|
345
|
+
[super startAnimating];
|
|
346
|
+
#else
|
|
347
|
+
[super setAnimates:YES];
|
|
348
|
+
#endif
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
- (void)stopAnimating
|
|
353
|
+
{
|
|
354
|
+
if (self.player) {
|
|
355
|
+
if (self.resetFrameIndexWhenStopped) {
|
|
356
|
+
[self.player stopPlaying];
|
|
357
|
+
} else {
|
|
358
|
+
[self.player pausePlaying];
|
|
359
|
+
}
|
|
360
|
+
if (self.clearBufferWhenStopped) {
|
|
361
|
+
[self.player clearFrameBuffer];
|
|
362
|
+
}
|
|
363
|
+
} else {
|
|
364
|
+
#if SD_UIKIT
|
|
365
|
+
[super stopAnimating];
|
|
366
|
+
#else
|
|
367
|
+
[super setAnimates:NO];
|
|
368
|
+
#endif
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
#if SD_UIKIT
|
|
373
|
+
- (BOOL)isAnimating
|
|
374
|
+
{
|
|
375
|
+
if (self.player) {
|
|
376
|
+
return self.player.isPlaying;
|
|
377
|
+
} else {
|
|
378
|
+
return [super isAnimating];
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
#endif
|
|
382
|
+
|
|
383
|
+
#if SD_MAC
|
|
384
|
+
- (BOOL)animates
|
|
385
|
+
{
|
|
386
|
+
if (self.player) {
|
|
387
|
+
return self.player.isPlaying;
|
|
388
|
+
} else {
|
|
389
|
+
return [super animates];
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
- (void)setAnimates:(BOOL)animates
|
|
394
|
+
{
|
|
395
|
+
if (animates) {
|
|
396
|
+
[self startAnimating];
|
|
397
|
+
} else {
|
|
398
|
+
[self stopAnimating];
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
#endif
|
|
402
|
+
|
|
403
|
+
#pragma mark Highlighted Image Unsupport
|
|
404
|
+
|
|
405
|
+
- (void)setHighlighted:(BOOL)highlighted
|
|
406
|
+
{
|
|
407
|
+
// Highlighted image is unsupported for animated images, but implementing it breaks the image view when embedded in a UICollectionViewCell.
|
|
408
|
+
if (!self.player) {
|
|
409
|
+
[super setHighlighted:highlighted];
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
#pragma mark - Private Methods
|
|
415
|
+
#pragma mark Animation
|
|
416
|
+
|
|
417
|
+
/// Check if it should be played
|
|
418
|
+
- (void)checkPlay
|
|
419
|
+
{
|
|
420
|
+
// Only handle for SDAnimatedImage, leave UIAnimatedImage or animationImages for super implementation control
|
|
421
|
+
if (self.player && self.autoPlayAnimatedImage) {
|
|
422
|
+
[self updateShouldAnimate];
|
|
423
|
+
if (self.shouldAnimate) {
|
|
424
|
+
[self startAnimating];
|
|
425
|
+
} else {
|
|
426
|
+
[self stopAnimating];
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// Don't repeatedly check our window & superview in `-displayDidRefresh:` for performance reasons.
|
|
432
|
+
// Just update our cached value whenever the animated image or visibility (window, superview, hidden, alpha) is changed.
|
|
433
|
+
- (void)updateShouldAnimate
|
|
434
|
+
{
|
|
435
|
+
#if SD_MAC
|
|
436
|
+
BOOL isVisible = self.window && self.superview && ![self isHidden] && self.alphaValue > 0.0;
|
|
437
|
+
#else
|
|
438
|
+
BOOL isVisible = self.window && self.superview && ![self isHidden] && self.alpha > 0.0;
|
|
439
|
+
#endif
|
|
440
|
+
self.shouldAnimate = self.player && isVisible;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// Update progressive status only after `setImage:` call.
|
|
444
|
+
- (void)updateIsProgressiveWithImage:(UIImage *)image
|
|
445
|
+
{
|
|
446
|
+
self.isProgressive = NO;
|
|
447
|
+
if (!self.shouldIncrementalLoad) {
|
|
448
|
+
// Early return
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
// We must use `image.class conformsToProtocol:` instead of `image conformsToProtocol:` here
|
|
452
|
+
// Because UIKit on macOS, using internal hard-coded override method, which returns NO
|
|
453
|
+
id<SDAnimatedImageCoder> currentAnimatedCoder = [self progressiveAnimatedCoderForImage:image];
|
|
454
|
+
if (currentAnimatedCoder) {
|
|
455
|
+
UIImage *previousImage = self.image;
|
|
456
|
+
if (!previousImage) {
|
|
457
|
+
// If current animated coder supports progressive, and no previous image to check, start progressive loading
|
|
458
|
+
self.isProgressive = YES;
|
|
459
|
+
} else {
|
|
460
|
+
id<SDAnimatedImageCoder> previousAnimatedCoder = [self progressiveAnimatedCoderForImage:previousImage];
|
|
461
|
+
if (previousAnimatedCoder == currentAnimatedCoder) {
|
|
462
|
+
// If current animated coder is the same as previous, start progressive loading
|
|
463
|
+
self.isProgressive = YES;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// Check if image can represent a `Progressive Animated Image` during loading
|
|
470
|
+
- (id<SDAnimatedImageCoder, SDProgressiveImageCoder>)progressiveAnimatedCoderForImage:(UIImage *)image
|
|
471
|
+
{
|
|
472
|
+
if ([image.class conformsToProtocol:@protocol(SDAnimatedImage)] && image.sd_isIncremental && [image respondsToSelector:@selector(animatedCoder)]) {
|
|
473
|
+
id<SDAnimatedImageCoder> animatedCoder = [(id<SDAnimatedImage>)image animatedCoder];
|
|
474
|
+
if ([animatedCoder respondsToSelector:@selector(initIncrementalWithOptions:)]) {
|
|
475
|
+
return (id<SDAnimatedImageCoder, SDProgressiveImageCoder>)animatedCoder;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
return nil;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
#pragma mark Providing the Layer's Content
|
|
483
|
+
#pragma mark - CALayerDelegate
|
|
484
|
+
|
|
485
|
+
- (void)displayLayer:(CALayer *)layer
|
|
486
|
+
{
|
|
487
|
+
UIImage *currentFrame = self.currentFrame;
|
|
488
|
+
if (currentFrame) {
|
|
489
|
+
layer.contentsScale = currentFrame.scale;
|
|
490
|
+
layer.contents = (__bridge id)currentFrame.CGImage;
|
|
491
|
+
} else {
|
|
492
|
+
// If we have no animation frames, call super implementation. iOS 14+ UIImageView use this delegate method for rendering.
|
|
493
|
+
if ([UIImageView instancesRespondToSelector:@selector(displayLayer:)]) {
|
|
494
|
+
[super displayLayer:layer];
|
|
495
|
+
} else {
|
|
496
|
+
// Fallback to implements the static image rendering by ourselves (like macOS or before iOS 14)
|
|
497
|
+
currentFrame = super.image;
|
|
498
|
+
layer.contentsScale = currentFrame.scale;
|
|
499
|
+
layer.contents = (__bridge id)currentFrame.CGImage;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
#if SD_MAC
|
|
505
|
+
// NSImageView use a subview. We need this subview's layer for actual rendering.
|
|
506
|
+
// Why using this design may because of properties like `imageAlignment` and `imageScaling`, which it's not available for UIImageView.contentMode (it's impossible to align left and keep aspect ratio at the same time)
|
|
507
|
+
- (NSView *)imageView {
|
|
508
|
+
NSImageView *imageView = objc_getAssociatedObject(self, SD_SEL_SPI(imageView));
|
|
509
|
+
if (!imageView) {
|
|
510
|
+
// macOS 10.14
|
|
511
|
+
imageView = objc_getAssociatedObject(self, SD_SEL_SPI(imageSubview));
|
|
512
|
+
}
|
|
513
|
+
return imageView;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// on macOS, it's the imageView subview's layer (we use layer-hosting view to let CALayerDelegate works)
|
|
517
|
+
- (CALayer *)imageViewLayer {
|
|
518
|
+
NSView *imageView = self.imageView;
|
|
519
|
+
if (!imageView) {
|
|
520
|
+
return nil;
|
|
521
|
+
}
|
|
522
|
+
if (!_imageViewLayer) {
|
|
523
|
+
_imageViewLayer = [CALayer new];
|
|
524
|
+
_imageViewLayer.delegate = self;
|
|
525
|
+
imageView.layer = _imageViewLayer;
|
|
526
|
+
imageView.wantsLayer = YES;
|
|
527
|
+
}
|
|
528
|
+
return _imageViewLayer;
|
|
529
|
+
}
|
|
530
|
+
#else
|
|
531
|
+
// on iOS, it's the imageView itself's layer
|
|
532
|
+
- (CALayer *)imageViewLayer {
|
|
533
|
+
return self.layer;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
#endif
|
|
537
|
+
|
|
538
|
+
@end
|
|
539
|
+
|
|
540
|
+
#endif
|
|
@@ -0,0 +1,145 @@
|
|
|
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
|
+
@class SDImageCacheConfig;
|
|
12
|
+
/**
|
|
13
|
+
A protocol to allow custom disk cache used in SDImageCache.
|
|
14
|
+
*/
|
|
15
|
+
@protocol SDDiskCache <NSObject>
|
|
16
|
+
|
|
17
|
+
// All of these method are called from the same global queue to avoid blocking on main queue and thread-safe problem. But it's also recommend to ensure thread-safe yourself using lock or other ways.
|
|
18
|
+
@required
|
|
19
|
+
/**
|
|
20
|
+
Create a new disk cache based on the specified path. You can check `maxDiskSize` and `maxDiskAge` used for disk cache.
|
|
21
|
+
|
|
22
|
+
@param cachePath Full path of a directory in which the cache will write data.
|
|
23
|
+
Once initialized you should not read and write to this directory.
|
|
24
|
+
@param config The cache config to be used to create the cache.
|
|
25
|
+
|
|
26
|
+
@return A new cache object, or nil if an error occurs.
|
|
27
|
+
*/
|
|
28
|
+
- (nullable instancetype)initWithCachePath:(nonnull NSString *)cachePath config:(nonnull SDImageCacheConfig *)config;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
Returns a boolean value that indicates whether a given key is in cache.
|
|
32
|
+
This method may blocks the calling thread until file read finished.
|
|
33
|
+
|
|
34
|
+
@param key A string identifying the data. If nil, just return NO.
|
|
35
|
+
@return Whether the key is in cache.
|
|
36
|
+
*/
|
|
37
|
+
- (BOOL)containsDataForKey:(nonnull NSString *)key;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
Returns the data associated with a given key.
|
|
41
|
+
This method may blocks the calling thread until file read finished.
|
|
42
|
+
|
|
43
|
+
@param key A string identifying the data. If nil, just return nil.
|
|
44
|
+
@return The value associated with key, or nil if no value is associated with key.
|
|
45
|
+
*/
|
|
46
|
+
- (nullable NSData *)dataForKey:(nonnull NSString *)key;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
Sets the value of the specified key in the cache.
|
|
50
|
+
This method may blocks the calling thread until file write finished.
|
|
51
|
+
|
|
52
|
+
@param data The data to be stored in the cache.
|
|
53
|
+
@param key The key with which to associate the value. If nil, this method has no effect.
|
|
54
|
+
*/
|
|
55
|
+
- (void)setData:(nullable NSData *)data forKey:(nonnull NSString *)key;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
Returns the extended data associated with a given key.
|
|
59
|
+
This method may blocks the calling thread until file read finished.
|
|
60
|
+
|
|
61
|
+
@param key A string identifying the data. If nil, just return nil.
|
|
62
|
+
@return The value associated with key, or nil if no value is associated with key.
|
|
63
|
+
*/
|
|
64
|
+
- (nullable NSData *)extendedDataForKey:(nonnull NSString *)key;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
Set extended data with a given key.
|
|
68
|
+
|
|
69
|
+
@discussion You can set any extended data to exist cache key. Without override the exist disk file data.
|
|
70
|
+
on UNIX, the common way for this is to use the Extended file attributes (xattr)
|
|
71
|
+
|
|
72
|
+
@param extendedData The extended data (pass nil to remove).
|
|
73
|
+
@param key The key with which to associate the value. If nil, this method has no effect.
|
|
74
|
+
*/
|
|
75
|
+
- (void)setExtendedData:(nullable NSData *)extendedData forKey:(nonnull NSString *)key;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
Removes the value of the specified key in the cache.
|
|
79
|
+
This method may blocks the calling thread until file delete finished.
|
|
80
|
+
|
|
81
|
+
@param key The key identifying the value to be removed. If nil, this method has no effect.
|
|
82
|
+
*/
|
|
83
|
+
- (void)removeDataForKey:(nonnull NSString *)key;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
Empties the cache.
|
|
87
|
+
This method may blocks the calling thread until file delete finished.
|
|
88
|
+
*/
|
|
89
|
+
- (void)removeAllData;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
Removes the expired data from the cache. You can choose the data to remove base on `ageLimit`, `countLimit` and `sizeLimit` options.
|
|
93
|
+
*/
|
|
94
|
+
- (void)removeExpiredData;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
The cache path for key
|
|
98
|
+
|
|
99
|
+
@param key A string identifying the value
|
|
100
|
+
@return The cache path for key. Or nil if the key can not associate to a path
|
|
101
|
+
*/
|
|
102
|
+
- (nullable NSString *)cachePathForKey:(nonnull NSString *)key;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
Returns the number of data in this cache.
|
|
106
|
+
This method may blocks the calling thread until file read finished.
|
|
107
|
+
|
|
108
|
+
@return The total data count.
|
|
109
|
+
*/
|
|
110
|
+
- (NSUInteger)totalCount;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
Returns the total size (in bytes) of data in this cache.
|
|
114
|
+
This method may blocks the calling thread until file read finished.
|
|
115
|
+
|
|
116
|
+
@return The total data size in bytes.
|
|
117
|
+
*/
|
|
118
|
+
- (NSUInteger)totalSize;
|
|
119
|
+
|
|
120
|
+
@end
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
The built-in disk cache.
|
|
124
|
+
*/
|
|
125
|
+
@interface SDDiskCache : NSObject <SDDiskCache>
|
|
126
|
+
/**
|
|
127
|
+
Cache Config object - storing all kind of settings.
|
|
128
|
+
*/
|
|
129
|
+
@property (nonatomic, strong, readonly, nonnull) SDImageCacheConfig *config;
|
|
130
|
+
|
|
131
|
+
- (nonnull instancetype)init NS_UNAVAILABLE;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
Move the cache directory from old location to new location, the old location will be removed after finish.
|
|
135
|
+
If the old location does not exist, does nothing.
|
|
136
|
+
If the new location does not exist, only do a movement of directory.
|
|
137
|
+
If the new location does exist, will move and merge the files from old location.
|
|
138
|
+
If the new location does exist, but is not a directory, will remove it and do a movement of directory.
|
|
139
|
+
|
|
140
|
+
@param srcPath old location of cache directory
|
|
141
|
+
@param dstPath new location of cache directory
|
|
142
|
+
*/
|
|
143
|
+
- (void)moveCacheDirectoryFromPath:(nonnull NSString *)srcPath toPath:(nonnull NSString *)dstPath;
|
|
144
|
+
|
|
145
|
+
@end
|