@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,446 @@
|
|
|
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 "UIView+WebCache.h"
|
|
10
|
+
#import "objc/runtime.h"
|
|
11
|
+
#import "UIView+WebCacheOperation.h"
|
|
12
|
+
#import "SDWebImageError.h"
|
|
13
|
+
#import "SDInternalMacros.h"
|
|
14
|
+
#import "SDWebImageTransitionInternal.h"
|
|
15
|
+
#import "SDImageCache.h"
|
|
16
|
+
|
|
17
|
+
const int64_t SDWebImageProgressUnitCountUnknown = 1LL;
|
|
18
|
+
|
|
19
|
+
@implementation UIView (WebCache)
|
|
20
|
+
|
|
21
|
+
- (nullable NSURL *)sd_imageURL {
|
|
22
|
+
return objc_getAssociatedObject(self, @selector(sd_imageURL));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
- (void)setSd_imageURL:(NSURL * _Nullable)sd_imageURL {
|
|
26
|
+
objc_setAssociatedObject(self, @selector(sd_imageURL), sd_imageURL, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
- (nullable NSString *)sd_latestOperationKey {
|
|
30
|
+
return objc_getAssociatedObject(self, @selector(sd_latestOperationKey));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
- (void)setSd_latestOperationKey:(NSString * _Nullable)sd_latestOperationKey {
|
|
34
|
+
objc_setAssociatedObject(self, @selector(sd_latestOperationKey), sd_latestOperationKey, OBJC_ASSOCIATION_COPY_NONATOMIC);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
- (NSProgress *)sd_imageProgress {
|
|
38
|
+
NSProgress *progress = objc_getAssociatedObject(self, @selector(sd_imageProgress));
|
|
39
|
+
if (!progress) {
|
|
40
|
+
progress = [[NSProgress alloc] initWithParent:nil userInfo:nil];
|
|
41
|
+
self.sd_imageProgress = progress;
|
|
42
|
+
}
|
|
43
|
+
return progress;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
- (void)setSd_imageProgress:(NSProgress *)sd_imageProgress {
|
|
47
|
+
objc_setAssociatedObject(self, @selector(sd_imageProgress), sd_imageProgress, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
- (nullable id<SDWebImageOperation>)sd_internalSetImageWithURL:(nullable NSURL *)url
|
|
51
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
52
|
+
options:(SDWebImageOptions)options
|
|
53
|
+
context:(nullable SDWebImageContext *)context
|
|
54
|
+
setImageBlock:(nullable SDSetImageBlock)setImageBlock
|
|
55
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
56
|
+
completed:(nullable SDInternalCompletionBlock)completedBlock {
|
|
57
|
+
if (context) {
|
|
58
|
+
// copy to avoid mutable object
|
|
59
|
+
context = [context copy];
|
|
60
|
+
} else {
|
|
61
|
+
context = [NSDictionary dictionary];
|
|
62
|
+
}
|
|
63
|
+
NSString *validOperationKey = context[SDWebImageContextSetImageOperationKey];
|
|
64
|
+
if (!validOperationKey) {
|
|
65
|
+
// pass through the operation key to downstream, which can used for tracing operation or image view class
|
|
66
|
+
validOperationKey = NSStringFromClass([self class]);
|
|
67
|
+
SDWebImageMutableContext *mutableContext = [context mutableCopy];
|
|
68
|
+
mutableContext[SDWebImageContextSetImageOperationKey] = validOperationKey;
|
|
69
|
+
context = [mutableContext copy];
|
|
70
|
+
}
|
|
71
|
+
self.sd_latestOperationKey = validOperationKey;
|
|
72
|
+
[self sd_cancelImageLoadOperationWithKey:validOperationKey];
|
|
73
|
+
self.sd_imageURL = url;
|
|
74
|
+
|
|
75
|
+
SDWebImageManager *manager = context[SDWebImageContextCustomManager];
|
|
76
|
+
if (!manager) {
|
|
77
|
+
manager = [SDWebImageManager sharedManager];
|
|
78
|
+
} else {
|
|
79
|
+
// remove this manager to avoid retain cycle (manger -> loader -> operation -> context -> manager)
|
|
80
|
+
SDWebImageMutableContext *mutableContext = [context mutableCopy];
|
|
81
|
+
mutableContext[SDWebImageContextCustomManager] = nil;
|
|
82
|
+
context = [mutableContext copy];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
BOOL shouldUseWeakCache = NO;
|
|
86
|
+
if ([manager.imageCache isKindOfClass:SDImageCache.class]) {
|
|
87
|
+
shouldUseWeakCache = ((SDImageCache *)manager.imageCache).config.shouldUseWeakMemoryCache;
|
|
88
|
+
}
|
|
89
|
+
if (!(options & SDWebImageDelayPlaceholder)) {
|
|
90
|
+
if (shouldUseWeakCache) {
|
|
91
|
+
NSString *key = [manager cacheKeyForURL:url context:context];
|
|
92
|
+
// call memory cache to trigger weak cache sync logic, ignore the return value and go on normal query
|
|
93
|
+
// this unfortunately will cause twice memory cache query, but it's fast enough
|
|
94
|
+
// in the future the weak cache feature may be re-design or removed
|
|
95
|
+
[((SDImageCache *)manager.imageCache) imageFromMemoryCacheForKey:key];
|
|
96
|
+
}
|
|
97
|
+
dispatch_main_async_safe(^{
|
|
98
|
+
[self sd_setImage:placeholder imageData:nil basedOnClassOrViaCustomSetImageBlock:setImageBlock cacheType:SDImageCacheTypeNone imageURL:url];
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
id <SDWebImageOperation> operation = nil;
|
|
103
|
+
|
|
104
|
+
if (url) {
|
|
105
|
+
// reset the progress
|
|
106
|
+
NSProgress *imageProgress = objc_getAssociatedObject(self, @selector(sd_imageProgress));
|
|
107
|
+
if (imageProgress) {
|
|
108
|
+
imageProgress.totalUnitCount = 0;
|
|
109
|
+
imageProgress.completedUnitCount = 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
#if SD_UIKIT || SD_MAC
|
|
113
|
+
// check and start image indicator
|
|
114
|
+
[self sd_startImageIndicator];
|
|
115
|
+
id<SDWebImageIndicator> imageIndicator = self.sd_imageIndicator;
|
|
116
|
+
#endif
|
|
117
|
+
|
|
118
|
+
SDImageLoaderProgressBlock combinedProgressBlock = ^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
|
|
119
|
+
if (imageProgress) {
|
|
120
|
+
imageProgress.totalUnitCount = expectedSize;
|
|
121
|
+
imageProgress.completedUnitCount = receivedSize;
|
|
122
|
+
}
|
|
123
|
+
#if SD_UIKIT || SD_MAC
|
|
124
|
+
if ([imageIndicator respondsToSelector:@selector(updateIndicatorProgress:)]) {
|
|
125
|
+
double progress = 0;
|
|
126
|
+
if (expectedSize != 0) {
|
|
127
|
+
progress = (double)receivedSize / expectedSize;
|
|
128
|
+
}
|
|
129
|
+
progress = MAX(MIN(progress, 1), 0); // 0.0 - 1.0
|
|
130
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
131
|
+
[imageIndicator updateIndicatorProgress:progress];
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
#endif
|
|
135
|
+
if (progressBlock) {
|
|
136
|
+
progressBlock(receivedSize, expectedSize, targetURL);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
@weakify(self);
|
|
140
|
+
operation = [manager loadImageWithURL:url options:options context:context progress:combinedProgressBlock completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
|
|
141
|
+
@strongify(self);
|
|
142
|
+
if (!self) { return; }
|
|
143
|
+
// if the progress not been updated, mark it to complete state
|
|
144
|
+
if (imageProgress && finished && !error && imageProgress.totalUnitCount == 0 && imageProgress.completedUnitCount == 0) {
|
|
145
|
+
imageProgress.totalUnitCount = SDWebImageProgressUnitCountUnknown;
|
|
146
|
+
imageProgress.completedUnitCount = SDWebImageProgressUnitCountUnknown;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
#if SD_UIKIT || SD_MAC
|
|
150
|
+
// check and stop image indicator
|
|
151
|
+
if (finished) {
|
|
152
|
+
[self sd_stopImageIndicator];
|
|
153
|
+
}
|
|
154
|
+
#endif
|
|
155
|
+
|
|
156
|
+
BOOL shouldCallCompletedBlock = finished || (options & SDWebImageAvoidAutoSetImage);
|
|
157
|
+
BOOL shouldNotSetImage = ((image && (options & SDWebImageAvoidAutoSetImage)) ||
|
|
158
|
+
(!image && !(options & SDWebImageDelayPlaceholder)));
|
|
159
|
+
SDWebImageNoParamsBlock callCompletedBlockClosure = ^{
|
|
160
|
+
if (!self) { return; }
|
|
161
|
+
if (!shouldNotSetImage) {
|
|
162
|
+
[self sd_setNeedsLayout];
|
|
163
|
+
}
|
|
164
|
+
if (completedBlock && shouldCallCompletedBlock) {
|
|
165
|
+
completedBlock(image, data, error, cacheType, finished, url);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
// case 1a: we got an image, but the SDWebImageAvoidAutoSetImage flag is set
|
|
170
|
+
// OR
|
|
171
|
+
// case 1b: we got no image and the SDWebImageDelayPlaceholder is not set
|
|
172
|
+
if (shouldNotSetImage) {
|
|
173
|
+
dispatch_main_async_safe(callCompletedBlockClosure);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
UIImage *targetImage = nil;
|
|
178
|
+
NSData *targetData = nil;
|
|
179
|
+
if (image) {
|
|
180
|
+
// case 2a: we got an image and the SDWebImageAvoidAutoSetImage is not set
|
|
181
|
+
targetImage = image;
|
|
182
|
+
targetData = data;
|
|
183
|
+
} else if (options & SDWebImageDelayPlaceholder) {
|
|
184
|
+
// case 2b: we got no image and the SDWebImageDelayPlaceholder flag is set
|
|
185
|
+
targetImage = placeholder;
|
|
186
|
+
targetData = nil;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
#if SD_UIKIT || SD_MAC
|
|
190
|
+
// check whether we should use the image transition
|
|
191
|
+
SDWebImageTransition *transition = nil;
|
|
192
|
+
BOOL shouldUseTransition = NO;
|
|
193
|
+
if (options & SDWebImageForceTransition) {
|
|
194
|
+
// Always
|
|
195
|
+
shouldUseTransition = YES;
|
|
196
|
+
} else if (cacheType == SDImageCacheTypeNone) {
|
|
197
|
+
// From network
|
|
198
|
+
shouldUseTransition = YES;
|
|
199
|
+
} else {
|
|
200
|
+
// From disk (and, user don't use sync query)
|
|
201
|
+
if (cacheType == SDImageCacheTypeMemory) {
|
|
202
|
+
shouldUseTransition = NO;
|
|
203
|
+
} else if (cacheType == SDImageCacheTypeDisk) {
|
|
204
|
+
if (options & SDWebImageQueryMemoryDataSync || options & SDWebImageQueryDiskDataSync) {
|
|
205
|
+
shouldUseTransition = NO;
|
|
206
|
+
} else {
|
|
207
|
+
shouldUseTransition = YES;
|
|
208
|
+
}
|
|
209
|
+
} else {
|
|
210
|
+
// Not valid cache type, fallback
|
|
211
|
+
shouldUseTransition = NO;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (finished && shouldUseTransition) {
|
|
215
|
+
transition = self.sd_imageTransition;
|
|
216
|
+
}
|
|
217
|
+
#endif
|
|
218
|
+
dispatch_main_async_safe(^{
|
|
219
|
+
#if SD_UIKIT || SD_MAC
|
|
220
|
+
[self sd_setImage:targetImage imageData:targetData basedOnClassOrViaCustomSetImageBlock:setImageBlock transition:transition cacheType:cacheType imageURL:imageURL];
|
|
221
|
+
#else
|
|
222
|
+
[self sd_setImage:targetImage imageData:targetData basedOnClassOrViaCustomSetImageBlock:setImageBlock cacheType:cacheType imageURL:imageURL];
|
|
223
|
+
#endif
|
|
224
|
+
callCompletedBlockClosure();
|
|
225
|
+
});
|
|
226
|
+
}];
|
|
227
|
+
[self sd_setImageLoadOperation:operation forKey:validOperationKey];
|
|
228
|
+
} else {
|
|
229
|
+
#if SD_UIKIT || SD_MAC
|
|
230
|
+
[self sd_stopImageIndicator];
|
|
231
|
+
#endif
|
|
232
|
+
if (completedBlock) {
|
|
233
|
+
dispatch_main_async_safe(^{
|
|
234
|
+
NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:SDWebImageErrorInvalidURL userInfo:@{NSLocalizedDescriptionKey : @"Image url is nil"}];
|
|
235
|
+
completedBlock(nil, nil, error, SDImageCacheTypeNone, YES, url);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return operation;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
- (void)sd_cancelCurrentImageLoad {
|
|
244
|
+
[self sd_cancelImageLoadOperationWithKey:self.sd_latestOperationKey];
|
|
245
|
+
self.sd_latestOperationKey = nil;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
- (void)sd_setImage:(UIImage *)image imageData:(NSData *)imageData basedOnClassOrViaCustomSetImageBlock:(SDSetImageBlock)setImageBlock cacheType:(SDImageCacheType)cacheType imageURL:(NSURL *)imageURL {
|
|
249
|
+
#if SD_UIKIT || SD_MAC
|
|
250
|
+
[self sd_setImage:image imageData:imageData basedOnClassOrViaCustomSetImageBlock:setImageBlock transition:nil cacheType:cacheType imageURL:imageURL];
|
|
251
|
+
#else
|
|
252
|
+
// watchOS does not support view transition. Simplify the logic
|
|
253
|
+
if (setImageBlock) {
|
|
254
|
+
setImageBlock(image, imageData, cacheType, imageURL);
|
|
255
|
+
} else if ([self isKindOfClass:[UIImageView class]]) {
|
|
256
|
+
UIImageView *imageView = (UIImageView *)self;
|
|
257
|
+
[imageView setImage:image];
|
|
258
|
+
}
|
|
259
|
+
#endif
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
#if SD_UIKIT || SD_MAC
|
|
263
|
+
- (void)sd_setImage:(UIImage *)image imageData:(NSData *)imageData basedOnClassOrViaCustomSetImageBlock:(SDSetImageBlock)setImageBlock transition:(SDWebImageTransition *)transition cacheType:(SDImageCacheType)cacheType imageURL:(NSURL *)imageURL {
|
|
264
|
+
UIView *view = self;
|
|
265
|
+
SDSetImageBlock finalSetImageBlock;
|
|
266
|
+
if (setImageBlock) {
|
|
267
|
+
finalSetImageBlock = setImageBlock;
|
|
268
|
+
} else if ([view isKindOfClass:[UIImageView class]]) {
|
|
269
|
+
UIImageView *imageView = (UIImageView *)view;
|
|
270
|
+
finalSetImageBlock = ^(UIImage *setImage, NSData *setImageData, SDImageCacheType setCacheType, NSURL *setImageURL) {
|
|
271
|
+
imageView.image = setImage;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
#if SD_UIKIT
|
|
275
|
+
else if ([view isKindOfClass:[UIButton class]]) {
|
|
276
|
+
UIButton *button = (UIButton *)view;
|
|
277
|
+
finalSetImageBlock = ^(UIImage *setImage, NSData *setImageData, SDImageCacheType setCacheType, NSURL *setImageURL) {
|
|
278
|
+
[button setImage:setImage forState:UIControlStateNormal];
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
#endif
|
|
282
|
+
#if SD_MAC
|
|
283
|
+
else if ([view isKindOfClass:[NSButton class]]) {
|
|
284
|
+
NSButton *button = (NSButton *)view;
|
|
285
|
+
finalSetImageBlock = ^(UIImage *setImage, NSData *setImageData, SDImageCacheType setCacheType, NSURL *setImageURL) {
|
|
286
|
+
button.image = setImage;
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
#endif
|
|
290
|
+
|
|
291
|
+
if (transition) {
|
|
292
|
+
NSString *originalOperationKey = view.sd_latestOperationKey;
|
|
293
|
+
|
|
294
|
+
#if SD_UIKIT
|
|
295
|
+
[UIView transitionWithView:view duration:0 options:0 animations:^{
|
|
296
|
+
if (!view.sd_latestOperationKey || ![originalOperationKey isEqualToString:view.sd_latestOperationKey]) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
// 0 duration to let UIKit render placeholder and prepares block
|
|
300
|
+
if (transition.prepares) {
|
|
301
|
+
transition.prepares(view, image, imageData, cacheType, imageURL);
|
|
302
|
+
}
|
|
303
|
+
} completion:^(BOOL tempFinished) {
|
|
304
|
+
[UIView transitionWithView:view duration:transition.duration options:transition.animationOptions animations:^{
|
|
305
|
+
if (!view.sd_latestOperationKey || ![originalOperationKey isEqualToString:view.sd_latestOperationKey]) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
if (finalSetImageBlock && !transition.avoidAutoSetImage) {
|
|
309
|
+
finalSetImageBlock(image, imageData, cacheType, imageURL);
|
|
310
|
+
}
|
|
311
|
+
if (transition.animations) {
|
|
312
|
+
transition.animations(view, image);
|
|
313
|
+
}
|
|
314
|
+
} completion:^(BOOL finished) {
|
|
315
|
+
if (!view.sd_latestOperationKey || ![originalOperationKey isEqualToString:view.sd_latestOperationKey]) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
if (transition.completion) {
|
|
319
|
+
transition.completion(finished);
|
|
320
|
+
}
|
|
321
|
+
}];
|
|
322
|
+
}];
|
|
323
|
+
#elif SD_MAC
|
|
324
|
+
[NSAnimationContext runAnimationGroup:^(NSAnimationContext * _Nonnull prepareContext) {
|
|
325
|
+
if (!view.sd_latestOperationKey || ![originalOperationKey isEqualToString:view.sd_latestOperationKey]) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
// 0 duration to let AppKit render placeholder and prepares block
|
|
329
|
+
prepareContext.duration = 0;
|
|
330
|
+
if (transition.prepares) {
|
|
331
|
+
transition.prepares(view, image, imageData, cacheType, imageURL);
|
|
332
|
+
}
|
|
333
|
+
} completionHandler:^{
|
|
334
|
+
[NSAnimationContext runAnimationGroup:^(NSAnimationContext * _Nonnull context) {
|
|
335
|
+
if (!view.sd_latestOperationKey || ![originalOperationKey isEqualToString:view.sd_latestOperationKey]) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
context.duration = transition.duration;
|
|
339
|
+
#pragma clang diagnostic push
|
|
340
|
+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
341
|
+
CAMediaTimingFunction *timingFunction = transition.timingFunction;
|
|
342
|
+
#pragma clang diagnostic pop
|
|
343
|
+
if (!timingFunction) {
|
|
344
|
+
timingFunction = SDTimingFunctionFromAnimationOptions(transition.animationOptions);
|
|
345
|
+
}
|
|
346
|
+
context.timingFunction = timingFunction;
|
|
347
|
+
context.allowsImplicitAnimation = SD_OPTIONS_CONTAINS(transition.animationOptions, SDWebImageAnimationOptionAllowsImplicitAnimation);
|
|
348
|
+
if (finalSetImageBlock && !transition.avoidAutoSetImage) {
|
|
349
|
+
finalSetImageBlock(image, imageData, cacheType, imageURL);
|
|
350
|
+
}
|
|
351
|
+
CATransition *trans = SDTransitionFromAnimationOptions(transition.animationOptions);
|
|
352
|
+
if (trans) {
|
|
353
|
+
[view.layer addAnimation:trans forKey:kCATransition];
|
|
354
|
+
}
|
|
355
|
+
if (transition.animations) {
|
|
356
|
+
transition.animations(view, image);
|
|
357
|
+
}
|
|
358
|
+
} completionHandler:^{
|
|
359
|
+
if (!view.sd_latestOperationKey || ![originalOperationKey isEqualToString:view.sd_latestOperationKey]) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
if (transition.completion) {
|
|
363
|
+
transition.completion(YES);
|
|
364
|
+
}
|
|
365
|
+
}];
|
|
366
|
+
}];
|
|
367
|
+
#endif
|
|
368
|
+
} else {
|
|
369
|
+
if (finalSetImageBlock) {
|
|
370
|
+
finalSetImageBlock(image, imageData, cacheType, imageURL);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
#endif
|
|
375
|
+
|
|
376
|
+
- (void)sd_setNeedsLayout {
|
|
377
|
+
#if SD_UIKIT
|
|
378
|
+
[self setNeedsLayout];
|
|
379
|
+
#elif SD_MAC
|
|
380
|
+
[self setNeedsLayout:YES];
|
|
381
|
+
#elif SD_WATCH
|
|
382
|
+
// Do nothing because WatchKit automatically layout the view after property change
|
|
383
|
+
#endif
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
#if SD_UIKIT || SD_MAC
|
|
387
|
+
|
|
388
|
+
#pragma mark - Image Transition
|
|
389
|
+
- (SDWebImageTransition *)sd_imageTransition {
|
|
390
|
+
return objc_getAssociatedObject(self, @selector(sd_imageTransition));
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
- (void)setSd_imageTransition:(SDWebImageTransition *)sd_imageTransition {
|
|
394
|
+
objc_setAssociatedObject(self, @selector(sd_imageTransition), sd_imageTransition, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
#pragma mark - Indicator
|
|
398
|
+
- (id<SDWebImageIndicator>)sd_imageIndicator {
|
|
399
|
+
return objc_getAssociatedObject(self, @selector(sd_imageIndicator));
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
- (void)setSd_imageIndicator:(id<SDWebImageIndicator>)sd_imageIndicator {
|
|
403
|
+
// Remove the old indicator view
|
|
404
|
+
id<SDWebImageIndicator> previousIndicator = self.sd_imageIndicator;
|
|
405
|
+
[previousIndicator.indicatorView removeFromSuperview];
|
|
406
|
+
|
|
407
|
+
objc_setAssociatedObject(self, @selector(sd_imageIndicator), sd_imageIndicator, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
408
|
+
|
|
409
|
+
// Add the new indicator view
|
|
410
|
+
UIView *view = sd_imageIndicator.indicatorView;
|
|
411
|
+
if (CGRectEqualToRect(view.frame, CGRectZero)) {
|
|
412
|
+
view.frame = self.bounds;
|
|
413
|
+
}
|
|
414
|
+
// Center the indicator view
|
|
415
|
+
#if SD_MAC
|
|
416
|
+
[view setFrameOrigin:CGPointMake(round((NSWidth(self.bounds) - NSWidth(view.frame)) / 2), round((NSHeight(self.bounds) - NSHeight(view.frame)) / 2))];
|
|
417
|
+
#else
|
|
418
|
+
view.center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds));
|
|
419
|
+
#endif
|
|
420
|
+
view.hidden = NO;
|
|
421
|
+
[self addSubview:view];
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
- (void)sd_startImageIndicator {
|
|
425
|
+
id<SDWebImageIndicator> imageIndicator = self.sd_imageIndicator;
|
|
426
|
+
if (!imageIndicator) {
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
dispatch_main_async_safe(^{
|
|
430
|
+
[imageIndicator startAnimatingIndicator];
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
- (void)sd_stopImageIndicator {
|
|
435
|
+
id<SDWebImageIndicator> imageIndicator = self.sd_imageIndicator;
|
|
436
|
+
if (!imageIndicator) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
dispatch_main_async_safe(^{
|
|
440
|
+
[imageIndicator stopAnimatingIndicator];
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
#endif
|
|
445
|
+
|
|
446
|
+
@end
|
|
@@ -0,0 +1,48 @@
|
|
|
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 "SDWebImageOperation.h"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
These methods are used to support canceling for UIView image loading, it's designed to be used internal but not external.
|
|
14
|
+
All the stored operations are weak, so it will be dealloced after image loading finished. If you need to store operations, use your own class to keep a strong reference for them.
|
|
15
|
+
*/
|
|
16
|
+
@interface UIView (WebCacheOperation)
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Get the image load operation for key
|
|
20
|
+
*
|
|
21
|
+
* @param key key for identifying the operations
|
|
22
|
+
* @return the image load operation
|
|
23
|
+
*/
|
|
24
|
+
- (nullable id<SDWebImageOperation>)sd_imageLoadOperationForKey:(nullable NSString *)key;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Set the image load operation (storage in a UIView based weak map table)
|
|
28
|
+
*
|
|
29
|
+
* @param operation the operation
|
|
30
|
+
* @param key key for storing the operation
|
|
31
|
+
*/
|
|
32
|
+
- (void)sd_setImageLoadOperation:(nullable id<SDWebImageOperation>)operation forKey:(nullable NSString *)key;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Cancel the operation for the current UIView and key
|
|
36
|
+
*
|
|
37
|
+
* @param key key for identifying the operations
|
|
38
|
+
*/
|
|
39
|
+
- (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Just remove the operation corresponding to the current UIView and key without cancelling them
|
|
43
|
+
*
|
|
44
|
+
* @param key key for identifying the operations
|
|
45
|
+
*/
|
|
46
|
+
- (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key;
|
|
47
|
+
|
|
48
|
+
@end
|
|
@@ -0,0 +1,82 @@
|
|
|
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 "UIView+WebCacheOperation.h"
|
|
10
|
+
#import "objc/runtime.h"
|
|
11
|
+
|
|
12
|
+
// key is strong, value is weak because operation instance is retained by SDWebImageManager's runningOperations property
|
|
13
|
+
// we should use lock to keep thread-safe because these method may not be accessed from main queue
|
|
14
|
+
typedef NSMapTable<NSString *, id<SDWebImageOperation>> SDOperationsDictionary;
|
|
15
|
+
|
|
16
|
+
@implementation UIView (WebCacheOperation)
|
|
17
|
+
|
|
18
|
+
- (SDOperationsDictionary *)sd_operationDictionary {
|
|
19
|
+
@synchronized(self) {
|
|
20
|
+
SDOperationsDictionary *operations = objc_getAssociatedObject(self, @selector(sd_operationDictionary));
|
|
21
|
+
if (operations) {
|
|
22
|
+
return operations;
|
|
23
|
+
}
|
|
24
|
+
operations = [[NSMapTable alloc] initWithKeyOptions:NSPointerFunctionsStrongMemory valueOptions:NSPointerFunctionsWeakMemory capacity:0];
|
|
25
|
+
objc_setAssociatedObject(self, @selector(sd_operationDictionary), operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
26
|
+
return operations;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
- (nullable id<SDWebImageOperation>)sd_imageLoadOperationForKey:(nullable NSString *)key {
|
|
31
|
+
id<SDWebImageOperation> operation;
|
|
32
|
+
if (key) {
|
|
33
|
+
SDOperationsDictionary *operationDictionary = [self sd_operationDictionary];
|
|
34
|
+
@synchronized (self) {
|
|
35
|
+
operation = [operationDictionary objectForKey:key];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return operation;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
- (void)sd_setImageLoadOperation:(nullable id<SDWebImageOperation>)operation forKey:(nullable NSString *)key {
|
|
42
|
+
if (key) {
|
|
43
|
+
[self sd_cancelImageLoadOperationWithKey:key];
|
|
44
|
+
if (operation) {
|
|
45
|
+
SDOperationsDictionary *operationDictionary = [self sd_operationDictionary];
|
|
46
|
+
@synchronized (self) {
|
|
47
|
+
[operationDictionary setObject:operation forKey:key];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
- (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key {
|
|
54
|
+
if (key) {
|
|
55
|
+
// Cancel in progress downloader from queue
|
|
56
|
+
SDOperationsDictionary *operationDictionary = [self sd_operationDictionary];
|
|
57
|
+
id<SDWebImageOperation> operation;
|
|
58
|
+
|
|
59
|
+
@synchronized (self) {
|
|
60
|
+
operation = [operationDictionary objectForKey:key];
|
|
61
|
+
}
|
|
62
|
+
if (operation) {
|
|
63
|
+
if ([operation respondsToSelector:@selector(cancel)]) {
|
|
64
|
+
[operation cancel];
|
|
65
|
+
}
|
|
66
|
+
@synchronized (self) {
|
|
67
|
+
[operationDictionary removeObjectForKey:key];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
- (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key {
|
|
74
|
+
if (key) {
|
|
75
|
+
SDOperationsDictionary *operationDictionary = [self sd_operationDictionary];
|
|
76
|
+
@synchronized (self) {
|
|
77
|
+
[operationDictionary removeObjectForKey:key];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@end
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
#if SD_MAC
|
|
12
|
+
|
|
13
|
+
#import "UIImage+Transform.h"
|
|
14
|
+
|
|
15
|
+
@interface NSBezierPath (SDRoundedCorners)
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
Convenience way to create a bezier path with the specify rounding corners on macOS. Same as the one on `UIBezierPath`.
|
|
19
|
+
*/
|
|
20
|
+
+ (nonnull instancetype)sd_bezierPathWithRoundedRect:(NSRect)rect byRoundingCorners:(SDRectCorner)corners cornerRadius:(CGFloat)cornerRadius;
|
|
21
|
+
|
|
22
|
+
@end
|
|
23
|
+
|
|
24
|
+
#endif
|
|
@@ -0,0 +1,42 @@
|
|
|
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 "NSBezierPath+SDRoundedCorners.h"
|
|
10
|
+
|
|
11
|
+
#if SD_MAC
|
|
12
|
+
|
|
13
|
+
@implementation NSBezierPath (SDRoundedCorners)
|
|
14
|
+
|
|
15
|
+
+ (instancetype)sd_bezierPathWithRoundedRect:(NSRect)rect byRoundingCorners:(SDRectCorner)corners cornerRadius:(CGFloat)cornerRadius {
|
|
16
|
+
NSBezierPath *path = [NSBezierPath bezierPath];
|
|
17
|
+
|
|
18
|
+
CGFloat maxCorner = MIN(NSWidth(rect), NSHeight(rect)) / 2;
|
|
19
|
+
|
|
20
|
+
CGFloat topLeftRadius = MIN(maxCorner, (corners & SDRectCornerTopLeft) ? cornerRadius : 0);
|
|
21
|
+
CGFloat topRightRadius = MIN(maxCorner, (corners & SDRectCornerTopRight) ? cornerRadius : 0);
|
|
22
|
+
CGFloat bottomLeftRadius = MIN(maxCorner, (corners & SDRectCornerBottomLeft) ? cornerRadius : 0);
|
|
23
|
+
CGFloat bottomRightRadius = MIN(maxCorner, (corners & SDRectCornerBottomRight) ? cornerRadius : 0);
|
|
24
|
+
|
|
25
|
+
NSPoint topLeft = NSMakePoint(NSMinX(rect), NSMaxY(rect));
|
|
26
|
+
NSPoint topRight = NSMakePoint(NSMaxX(rect), NSMaxY(rect));
|
|
27
|
+
NSPoint bottomLeft = NSMakePoint(NSMinX(rect), NSMinY(rect));
|
|
28
|
+
NSPoint bottomRight = NSMakePoint(NSMaxX(rect), NSMinY(rect));
|
|
29
|
+
|
|
30
|
+
[path moveToPoint:NSMakePoint(NSMidX(rect), NSMaxY(rect))];
|
|
31
|
+
[path appendBezierPathWithArcFromPoint:topLeft toPoint:bottomLeft radius:topLeftRadius];
|
|
32
|
+
[path appendBezierPathWithArcFromPoint:bottomLeft toPoint:bottomRight radius:bottomLeftRadius];
|
|
33
|
+
[path appendBezierPathWithArcFromPoint:bottomRight toPoint:topRight radius:bottomRightRadius];
|
|
34
|
+
[path appendBezierPathWithArcFromPoint:topRight toPoint:topLeft radius:topRightRadius];
|
|
35
|
+
[path closePath];
|
|
36
|
+
|
|
37
|
+
return path;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
#endif
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
/// Copy the associated object from source image to target image. The associated object including all the category read/write properties.
|
|
12
|
+
/// @param source source
|
|
13
|
+
/// @param target target
|
|
14
|
+
FOUNDATION_EXPORT void SDImageCopyAssociatedObject(UIImage * _Nullable source, UIImage * _Nullable target);
|
|
@@ -0,0 +1,29 @@
|
|
|
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 "SDAssociatedObject.h"
|
|
10
|
+
#import "UIImage+Metadata.h"
|
|
11
|
+
#import "UIImage+ExtendedCacheData.h"
|
|
12
|
+
#import "UIImage+MemoryCacheCost.h"
|
|
13
|
+
#import "UIImage+ForceDecode.h"
|
|
14
|
+
|
|
15
|
+
void SDImageCopyAssociatedObject(UIImage * _Nullable source, UIImage * _Nullable target) {
|
|
16
|
+
if (!source || !target) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// Image Metadata
|
|
20
|
+
target.sd_isIncremental = source.sd_isIncremental;
|
|
21
|
+
target.sd_isTransformed = source.sd_isTransformed;
|
|
22
|
+
target.sd_decodeOptions = source.sd_decodeOptions;
|
|
23
|
+
target.sd_imageLoopCount = source.sd_imageLoopCount;
|
|
24
|
+
target.sd_imageFormat = source.sd_imageFormat;
|
|
25
|
+
// Force Decode
|
|
26
|
+
target.sd_isDecoded = source.sd_isDecoded;
|
|
27
|
+
// Extended Cache Data
|
|
28
|
+
target.sd_extendedObject = source.sd_extendedObject;
|
|
29
|
+
}
|