@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,387 @@
|
|
|
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_UIKIT
|
|
12
|
+
|
|
13
|
+
#import "SDWebImageManager.h"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Integrates SDWebImage async downloading and caching of remote images with UIButton.
|
|
17
|
+
*/
|
|
18
|
+
@interface UIButton (WebCache)
|
|
19
|
+
|
|
20
|
+
#pragma mark - Image
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Get the current image URL.
|
|
24
|
+
*/
|
|
25
|
+
@property (nonatomic, strong, readonly, nullable) NSURL *sd_currentImageURL;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get the image URL for a control state.
|
|
29
|
+
*
|
|
30
|
+
* @param state Which state you want to know the URL for. The values are described in UIControlState.
|
|
31
|
+
*/
|
|
32
|
+
- (nullable NSURL *)sd_imageURLForState:(UIControlState)state;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Set the button `image` with an `url`.
|
|
36
|
+
*
|
|
37
|
+
* The download is asynchronous and cached.
|
|
38
|
+
*
|
|
39
|
+
* @param url The url for the image.
|
|
40
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
41
|
+
*/
|
|
42
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
43
|
+
forState:(UIControlState)state NS_REFINED_FOR_SWIFT;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Set the button `image` with an `url` and a placeholder.
|
|
47
|
+
*
|
|
48
|
+
* The download is asynchronous and cached.
|
|
49
|
+
*
|
|
50
|
+
* @param url The url for the image.
|
|
51
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
52
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
53
|
+
* @see sd_setImageWithURL:placeholderImage:options:
|
|
54
|
+
*/
|
|
55
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
56
|
+
forState:(UIControlState)state
|
|
57
|
+
placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Set the button `image` with an `url`, placeholder and custom options.
|
|
61
|
+
*
|
|
62
|
+
* The download is asynchronous and cached.
|
|
63
|
+
*
|
|
64
|
+
* @param url The url for the image.
|
|
65
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
66
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
67
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
68
|
+
*/
|
|
69
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
70
|
+
forState:(UIControlState)state
|
|
71
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
72
|
+
options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Set the button `image` with an `url`, placeholder, custom options and context.
|
|
76
|
+
*
|
|
77
|
+
* The download is asynchronous and cached.
|
|
78
|
+
*
|
|
79
|
+
* @param url The url for the image.
|
|
80
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
81
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
82
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
83
|
+
* @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
|
|
84
|
+
*/
|
|
85
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
86
|
+
forState:(UIControlState)state
|
|
87
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
88
|
+
options:(SDWebImageOptions)options
|
|
89
|
+
context:(nullable SDWebImageContext *)context;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Set the button `image` with an `url`.
|
|
93
|
+
*
|
|
94
|
+
* The download is asynchronous and cached.
|
|
95
|
+
*
|
|
96
|
+
* @param url The url for the image.
|
|
97
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
98
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
99
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
100
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
101
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
102
|
+
* The fourth parameter is the original image url.
|
|
103
|
+
*/
|
|
104
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
105
|
+
forState:(UIControlState)state
|
|
106
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Set the button `image` with an `url`, placeholder.
|
|
110
|
+
*
|
|
111
|
+
* The download is asynchronous and cached.
|
|
112
|
+
*
|
|
113
|
+
* @param url The url for the image.
|
|
114
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
115
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
116
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
117
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
118
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
119
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
120
|
+
* The fourth parameter is the original image url.
|
|
121
|
+
*/
|
|
122
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
123
|
+
forState:(UIControlState)state
|
|
124
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
125
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Set the button `image` with an `url`, placeholder and custom options.
|
|
129
|
+
*
|
|
130
|
+
* The download is asynchronous and cached.
|
|
131
|
+
*
|
|
132
|
+
* @param url The url for the image.
|
|
133
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
134
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
135
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
136
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
137
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
138
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
139
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
140
|
+
* The fourth parameter is the original image url.
|
|
141
|
+
*/
|
|
142
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
143
|
+
forState:(UIControlState)state
|
|
144
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
145
|
+
options:(SDWebImageOptions)options
|
|
146
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Set the button `image` with an `url`, placeholder and custom options.
|
|
150
|
+
*
|
|
151
|
+
* The download is asynchronous and cached.
|
|
152
|
+
*
|
|
153
|
+
* @param url The url for the image.
|
|
154
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
155
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
156
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
157
|
+
* @param progressBlock A block called while image is downloading
|
|
158
|
+
* @note the progress block is executed on a background queue
|
|
159
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
160
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
161
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
162
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
163
|
+
* The fourth parameter is the original image url.
|
|
164
|
+
*/
|
|
165
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
166
|
+
forState:(UIControlState)state
|
|
167
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
168
|
+
options:(SDWebImageOptions)options
|
|
169
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
170
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Set the button `image` with an `url`, placeholder, custom options and context.
|
|
174
|
+
*
|
|
175
|
+
* The download is asynchronous and cached.
|
|
176
|
+
*
|
|
177
|
+
* @param url The url for the image.
|
|
178
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
179
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
180
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
181
|
+
* @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
|
|
182
|
+
* @param progressBlock A block called while image is downloading
|
|
183
|
+
* @note the progress block is executed on a background queue
|
|
184
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
185
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
186
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
187
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
188
|
+
* The fourth parameter is the original image url.
|
|
189
|
+
*/
|
|
190
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
191
|
+
forState:(UIControlState)state
|
|
192
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
193
|
+
options:(SDWebImageOptions)options
|
|
194
|
+
context:(nullable SDWebImageContext *)context
|
|
195
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
196
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
197
|
+
|
|
198
|
+
#pragma mark - Background Image
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Get the current background image URL.
|
|
202
|
+
*/
|
|
203
|
+
@property (nonatomic, strong, readonly, nullable) NSURL *sd_currentBackgroundImageURL;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Get the background image URL for a control state.
|
|
207
|
+
*
|
|
208
|
+
* @param state Which state you want to know the URL for. The values are described in UIControlState.
|
|
209
|
+
*/
|
|
210
|
+
- (nullable NSURL *)sd_backgroundImageURLForState:(UIControlState)state;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Set the button `backgroundImage` with an `url`.
|
|
214
|
+
*
|
|
215
|
+
* The download is asynchronous and cached.
|
|
216
|
+
*
|
|
217
|
+
* @param url The url for the image.
|
|
218
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
219
|
+
*/
|
|
220
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
221
|
+
forState:(UIControlState)state NS_REFINED_FOR_SWIFT;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Set the button `backgroundImage` with an `url` and a placeholder.
|
|
225
|
+
*
|
|
226
|
+
* The download is asynchronous and cached.
|
|
227
|
+
*
|
|
228
|
+
* @param url The url for the image.
|
|
229
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
230
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
231
|
+
* @see sd_setImageWithURL:placeholderImage:options:
|
|
232
|
+
*/
|
|
233
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
234
|
+
forState:(UIControlState)state
|
|
235
|
+
placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Set the button `backgroundImage` with an `url`, placeholder and custom options.
|
|
239
|
+
*
|
|
240
|
+
* The download is asynchronous and cached.
|
|
241
|
+
*
|
|
242
|
+
* @param url The url for the image.
|
|
243
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
244
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
245
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
246
|
+
*/
|
|
247
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
248
|
+
forState:(UIControlState)state
|
|
249
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
250
|
+
options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Set the button `backgroundImage` with an `url`, placeholder, custom options and context.
|
|
254
|
+
*
|
|
255
|
+
* The download is asynchronous and cached.
|
|
256
|
+
*
|
|
257
|
+
* @param url The url for the image.
|
|
258
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
259
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
260
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
261
|
+
* @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
|
|
262
|
+
*/
|
|
263
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
264
|
+
forState:(UIControlState)state
|
|
265
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
266
|
+
options:(SDWebImageOptions)options
|
|
267
|
+
context:(nullable SDWebImageContext *)context;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Set the button `backgroundImage` with an `url`.
|
|
271
|
+
*
|
|
272
|
+
* The download is asynchronous and cached.
|
|
273
|
+
*
|
|
274
|
+
* @param url The url for the image.
|
|
275
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
276
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
277
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
278
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
279
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
280
|
+
* The fourth parameter is the original image url.
|
|
281
|
+
*/
|
|
282
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
283
|
+
forState:(UIControlState)state
|
|
284
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Set the button `backgroundImage` with an `url`, placeholder.
|
|
288
|
+
*
|
|
289
|
+
* The download is asynchronous and cached.
|
|
290
|
+
*
|
|
291
|
+
* @param url The url for the image.
|
|
292
|
+
* @param state The state that uses the specified title. The values are described in UIControlState.
|
|
293
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
294
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
295
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
296
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
297
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
298
|
+
* The fourth parameter is the original image url.
|
|
299
|
+
*/
|
|
300
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
301
|
+
forState:(UIControlState)state
|
|
302
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
303
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Set the button `backgroundImage` with an `url`, placeholder and custom options.
|
|
307
|
+
*
|
|
308
|
+
* The download is asynchronous and cached.
|
|
309
|
+
*
|
|
310
|
+
* @param url The url for the image.
|
|
311
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
312
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
313
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
314
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
315
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
316
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
317
|
+
* The fourth parameter is the original image url.
|
|
318
|
+
*/
|
|
319
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
320
|
+
forState:(UIControlState)state
|
|
321
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
322
|
+
options:(SDWebImageOptions)options
|
|
323
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Set the button `backgroundImage` with an `url`, placeholder and custom options.
|
|
327
|
+
*
|
|
328
|
+
* The download is asynchronous and cached.
|
|
329
|
+
*
|
|
330
|
+
* @param url The url for the image.
|
|
331
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
332
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
333
|
+
* @param progressBlock A block called while image is downloading
|
|
334
|
+
* @note the progress block is executed on a background queue
|
|
335
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
336
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
337
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
338
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
339
|
+
* The fourth parameter is the original image url.
|
|
340
|
+
*/
|
|
341
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
342
|
+
forState:(UIControlState)state
|
|
343
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
344
|
+
options:(SDWebImageOptions)options
|
|
345
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
346
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Set the button `backgroundImage` with an `url`, placeholder, custom options and context.
|
|
350
|
+
*
|
|
351
|
+
* The download is asynchronous and cached.
|
|
352
|
+
*
|
|
353
|
+
* @param url The url for the image.
|
|
354
|
+
* @param placeholder The image to be set initially, until the image request finishes.
|
|
355
|
+
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
356
|
+
* @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
|
|
357
|
+
* @param progressBlock A block called while image is downloading
|
|
358
|
+
* @note the progress block is executed on a background queue
|
|
359
|
+
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
360
|
+
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
361
|
+
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
362
|
+
* indicating if the image was retrieved from the local cache or from the network.
|
|
363
|
+
* The fourth parameter is the original image url.
|
|
364
|
+
*/
|
|
365
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
366
|
+
forState:(UIControlState)state
|
|
367
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
368
|
+
options:(SDWebImageOptions)options
|
|
369
|
+
context:(nullable SDWebImageContext *)context
|
|
370
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
371
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
372
|
+
|
|
373
|
+
#pragma mark - Cancel
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Cancel the current image download
|
|
377
|
+
*/
|
|
378
|
+
- (void)sd_cancelImageLoadForState:(UIControlState)state;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Cancel the current backgroundImage download
|
|
382
|
+
*/
|
|
383
|
+
- (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state;
|
|
384
|
+
|
|
385
|
+
@end
|
|
386
|
+
|
|
387
|
+
#endif
|
|
@@ -0,0 +1,234 @@
|
|
|
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 "UIButton+WebCache.h"
|
|
10
|
+
|
|
11
|
+
#if SD_UIKIT
|
|
12
|
+
|
|
13
|
+
#import "objc/runtime.h"
|
|
14
|
+
#import "UIView+WebCacheOperation.h"
|
|
15
|
+
#import "UIView+WebCache.h"
|
|
16
|
+
#import "SDInternalMacros.h"
|
|
17
|
+
|
|
18
|
+
static char imageURLStorageKey;
|
|
19
|
+
|
|
20
|
+
typedef NSMutableDictionary<NSString *, NSURL *> SDStateImageURLDictionary;
|
|
21
|
+
|
|
22
|
+
static inline NSString * imageURLKeyForState(UIControlState state) {
|
|
23
|
+
return [NSString stringWithFormat:@"image_%lu", (unsigned long)state];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static inline NSString * backgroundImageURLKeyForState(UIControlState state) {
|
|
27
|
+
return [NSString stringWithFormat:@"backgroundImage_%lu", (unsigned long)state];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static inline NSString * imageOperationKeyForState(UIControlState state) {
|
|
31
|
+
return [NSString stringWithFormat:@"UIButtonImageOperation%lu", (unsigned long)state];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static inline NSString * backgroundImageOperationKeyForState(UIControlState state) {
|
|
35
|
+
return [NSString stringWithFormat:@"UIButtonBackgroundImageOperation%lu", (unsigned long)state];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@implementation UIButton (WebCache)
|
|
39
|
+
|
|
40
|
+
#pragma mark - Image
|
|
41
|
+
|
|
42
|
+
- (nullable NSURL *)sd_currentImageURL {
|
|
43
|
+
NSURL *url = self.sd_imageURLStorage[imageURLKeyForState(self.state)];
|
|
44
|
+
|
|
45
|
+
if (!url) {
|
|
46
|
+
url = self.sd_imageURLStorage[imageURLKeyForState(UIControlStateNormal)];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return url;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
- (nullable NSURL *)sd_imageURLForState:(UIControlState)state {
|
|
53
|
+
return self.sd_imageURLStorage[imageURLKeyForState(state)];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state {
|
|
57
|
+
[self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder {
|
|
61
|
+
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options {
|
|
65
|
+
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options progress:nil completed:nil];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context {
|
|
69
|
+
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options context:context progress:nil completed:nil];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state completed:(nullable SDExternalCompletionBlock)completedBlock {
|
|
73
|
+
[self sd_setImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock {
|
|
77
|
+
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock {
|
|
81
|
+
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options progress:nil completed:completedBlock];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock {
|
|
85
|
+
[self sd_setImageWithURL:url forState:state placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
89
|
+
forState:(UIControlState)state
|
|
90
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
91
|
+
options:(SDWebImageOptions)options
|
|
92
|
+
context:(nullable SDWebImageContext *)context
|
|
93
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
94
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock {
|
|
95
|
+
if (!url) {
|
|
96
|
+
[self.sd_imageURLStorage removeObjectForKey:imageURLKeyForState(state)];
|
|
97
|
+
} else {
|
|
98
|
+
self.sd_imageURLStorage[imageURLKeyForState(state)] = url;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
SDWebImageMutableContext *mutableContext;
|
|
102
|
+
if (context) {
|
|
103
|
+
mutableContext = [context mutableCopy];
|
|
104
|
+
} else {
|
|
105
|
+
mutableContext = [NSMutableDictionary dictionary];
|
|
106
|
+
}
|
|
107
|
+
mutableContext[SDWebImageContextSetImageOperationKey] = imageOperationKeyForState(state);
|
|
108
|
+
@weakify(self);
|
|
109
|
+
[self sd_internalSetImageWithURL:url
|
|
110
|
+
placeholderImage:placeholder
|
|
111
|
+
options:options
|
|
112
|
+
context:mutableContext
|
|
113
|
+
setImageBlock:^(UIImage * _Nullable image, NSData * _Nullable imageData, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
|
|
114
|
+
@strongify(self);
|
|
115
|
+
[self setImage:image forState:state];
|
|
116
|
+
}
|
|
117
|
+
progress:progressBlock
|
|
118
|
+
completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
|
|
119
|
+
if (completedBlock) {
|
|
120
|
+
completedBlock(image, error, cacheType, imageURL);
|
|
121
|
+
}
|
|
122
|
+
}];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
#pragma mark - Background Image
|
|
126
|
+
|
|
127
|
+
- (nullable NSURL *)sd_currentBackgroundImageURL {
|
|
128
|
+
NSURL *url = self.sd_imageURLStorage[backgroundImageURLKeyForState(self.state)];
|
|
129
|
+
|
|
130
|
+
if (!url) {
|
|
131
|
+
url = self.sd_imageURLStorage[backgroundImageURLKeyForState(UIControlStateNormal)];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return url;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
- (nullable NSURL *)sd_backgroundImageURLForState:(UIControlState)state {
|
|
138
|
+
return self.sd_imageURLStorage[backgroundImageURLKeyForState(state)];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state {
|
|
142
|
+
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:nil];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder {
|
|
146
|
+
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:nil];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options {
|
|
150
|
+
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options progress:nil completed:nil];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context {
|
|
154
|
+
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options context:context progress:nil completed:nil];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state completed:(nullable SDExternalCompletionBlock)completedBlock {
|
|
158
|
+
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:nil options:0 completed:completedBlock];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder completed:(nullable SDExternalCompletionBlock)completedBlock {
|
|
162
|
+
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:0 completed:completedBlock];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock {
|
|
166
|
+
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options progress:nil completed:completedBlock];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url forState:(UIControlState)state placeholderImage:(nullable UIImage *)placeholder options:(SDWebImageOptions)options progress:(nullable SDImageLoaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock {
|
|
170
|
+
[self sd_setBackgroundImageWithURL:url forState:state placeholderImage:placeholder options:options context:nil progress:progressBlock completed:completedBlock];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
- (void)sd_setBackgroundImageWithURL:(nullable NSURL *)url
|
|
174
|
+
forState:(UIControlState)state
|
|
175
|
+
placeholderImage:(nullable UIImage *)placeholder
|
|
176
|
+
options:(SDWebImageOptions)options
|
|
177
|
+
context:(nullable SDWebImageContext *)context
|
|
178
|
+
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
|
179
|
+
completed:(nullable SDExternalCompletionBlock)completedBlock {
|
|
180
|
+
if (!url) {
|
|
181
|
+
[self.sd_imageURLStorage removeObjectForKey:backgroundImageURLKeyForState(state)];
|
|
182
|
+
} else {
|
|
183
|
+
self.sd_imageURLStorage[backgroundImageURLKeyForState(state)] = url;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
SDWebImageMutableContext *mutableContext;
|
|
187
|
+
if (context) {
|
|
188
|
+
mutableContext = [context mutableCopy];
|
|
189
|
+
} else {
|
|
190
|
+
mutableContext = [NSMutableDictionary dictionary];
|
|
191
|
+
}
|
|
192
|
+
mutableContext[SDWebImageContextSetImageOperationKey] = backgroundImageOperationKeyForState(state);
|
|
193
|
+
@weakify(self);
|
|
194
|
+
[self sd_internalSetImageWithURL:url
|
|
195
|
+
placeholderImage:placeholder
|
|
196
|
+
options:options
|
|
197
|
+
context:mutableContext
|
|
198
|
+
setImageBlock:^(UIImage * _Nullable image, NSData * _Nullable imageData, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
|
|
199
|
+
@strongify(self);
|
|
200
|
+
[self setBackgroundImage:image forState:state];
|
|
201
|
+
}
|
|
202
|
+
progress:progressBlock
|
|
203
|
+
completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
|
|
204
|
+
if (completedBlock) {
|
|
205
|
+
completedBlock(image, error, cacheType, imageURL);
|
|
206
|
+
}
|
|
207
|
+
}];
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
#pragma mark - Cancel
|
|
211
|
+
|
|
212
|
+
- (void)sd_cancelImageLoadForState:(UIControlState)state {
|
|
213
|
+
[self sd_cancelImageLoadOperationWithKey:imageOperationKeyForState(state)];
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
- (void)sd_cancelBackgroundImageLoadForState:(UIControlState)state {
|
|
217
|
+
[self sd_cancelImageLoadOperationWithKey:backgroundImageOperationKeyForState(state)];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
#pragma mark - Private
|
|
221
|
+
|
|
222
|
+
- (SDStateImageURLDictionary *)sd_imageURLStorage {
|
|
223
|
+
SDStateImageURLDictionary *storage = objc_getAssociatedObject(self, &imageURLStorageKey);
|
|
224
|
+
if (!storage) {
|
|
225
|
+
storage = [NSMutableDictionary dictionary];
|
|
226
|
+
objc_setAssociatedObject(self, &imageURLStorageKey, storage, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return storage;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@end
|
|
233
|
+
|
|
234
|
+
#endif
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
4
|
+
* (c) Fabrice Aneche
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
#import "SDWebImageCompat.h"
|
|
12
|
+
|
|
13
|
+
@interface UIImage (ExtendedCacheData)
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
Read and Write the extended object and bind it to the image. Which can hold some extra metadata like Image's scale factor, URL rich link, date, etc.
|
|
17
|
+
The extended object should conforms to NSCoding, which we use `NSKeyedArchiver` and `NSKeyedUnarchiver` to archive it to data, and write to disk cache.
|
|
18
|
+
@note The disk cache preserve both of the data and extended data with the same cache key. For manual query, use the `SDDiskCache` protocol method `extendedDataForKey:` instead.
|
|
19
|
+
@note You can specify arbitrary object conforms to NSCoding (NSObject protocol here is used to support object using `NS_ROOT_CLASS`, which is not NSObject subclass). If you load image from disk cache, you should check the extended object class to avoid corrupted data.
|
|
20
|
+
@warning This object don't need to implements NSSecureCoding (but it's recommended), because we allows arbitrary class.
|
|
21
|
+
*/
|
|
22
|
+
@property (nonatomic, strong, nullable) id<NSObject, NSCoding> sd_extendedObject;
|
|
23
|
+
|
|
24
|
+
@end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
4
|
+
* (c) Fabrice Aneche
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import "UIImage+ExtendedCacheData.h"
|
|
11
|
+
#import <objc/runtime.h>
|
|
12
|
+
|
|
13
|
+
@implementation UIImage (ExtendedCacheData)
|
|
14
|
+
|
|
15
|
+
- (id<NSObject, NSCoding>)sd_extendedObject {
|
|
16
|
+
return objc_getAssociatedObject(self, @selector(sd_extendedObject));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
- (void)setSd_extendedObject:(id<NSObject, NSCoding>)sd_extendedObject {
|
|
20
|
+
objc_setAssociatedObject(self, @selector(sd_extendedObject), sd_extendedObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@end
|