@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,122 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) DreamPiggy <lizhuoli1126@126.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 SwiftUI
|
|
10
|
+
import SDWebImage
|
|
11
|
+
|
|
12
|
+
/// A Image observable object for handle aniamted image playback. This is used to avoid `@State` update may capture the View struct type and cause memory leak.
|
|
13
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
14
|
+
public final class ImagePlayer : ObservableObject {
|
|
15
|
+
var player: SDAnimatedImagePlayer?
|
|
16
|
+
|
|
17
|
+
/// Max buffer size
|
|
18
|
+
public var maxBufferSize: UInt?
|
|
19
|
+
|
|
20
|
+
/// Custom loop count
|
|
21
|
+
public var customLoopCount: UInt?
|
|
22
|
+
|
|
23
|
+
/// Animation runloop mode
|
|
24
|
+
public var runLoopMode: RunLoop.Mode = .common
|
|
25
|
+
|
|
26
|
+
/// Animation playback rate
|
|
27
|
+
public var playbackRate: Double = 1.0
|
|
28
|
+
|
|
29
|
+
/// Animation playback mode
|
|
30
|
+
public var playbackMode: SDAnimatedImagePlaybackMode = .normal
|
|
31
|
+
|
|
32
|
+
deinit {
|
|
33
|
+
player?.stopPlaying()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// Current playing frame image
|
|
37
|
+
@Published public var currentFrame: PlatformImage?
|
|
38
|
+
|
|
39
|
+
/// Current playing frame index
|
|
40
|
+
@Published public var currentFrameIndex: UInt = 0
|
|
41
|
+
|
|
42
|
+
/// Current playing loop count
|
|
43
|
+
@Published public var currentLoopCount: UInt = 0
|
|
44
|
+
|
|
45
|
+
var currentAnimatedImage: (PlatformImage & SDAnimatedImageProvider)?
|
|
46
|
+
|
|
47
|
+
/// Whether current player is valid for playing. This will check the internal player exist or not
|
|
48
|
+
public var isValid: Bool {
|
|
49
|
+
player != nil
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/// Current playing status
|
|
53
|
+
public var isPlaying: Bool {
|
|
54
|
+
player?.isPlaying ?? false
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/// Start the animation
|
|
58
|
+
public func startPlaying() {
|
|
59
|
+
player?.startPlaying()
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/// Pause the animation
|
|
63
|
+
public func pausePlaying() {
|
|
64
|
+
player?.pausePlaying()
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/// Stop the animation
|
|
68
|
+
public func stopPlaying() {
|
|
69
|
+
player?.stopPlaying()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/// Seek to frame and loop count
|
|
73
|
+
public func seekToFrame(at: UInt, loopCount: UInt) {
|
|
74
|
+
player?.seekToFrame(at: at, loopCount: loopCount)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/// Clear the frame buffer
|
|
78
|
+
public func clearFrameBuffer() {
|
|
79
|
+
player?.clearFrameBuffer()
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/// Setup the player using Animated Image.
|
|
83
|
+
/// After setup, you can always check `isValid` status, or call `startPlaying` to play the animation.
|
|
84
|
+
/// - Parameter image: animated image
|
|
85
|
+
public func setupPlayer(animatedImage: PlatformImage & SDAnimatedImageProvider) {
|
|
86
|
+
if isValid {
|
|
87
|
+
return
|
|
88
|
+
}
|
|
89
|
+
currentAnimatedImage = animatedImage
|
|
90
|
+
if let imagePlayer = SDAnimatedImagePlayer(provider: animatedImage) {
|
|
91
|
+
imagePlayer.animationFrameHandler = { [weak self] (index, frame) in
|
|
92
|
+
guard let self = self else {
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
if (self.isPlaying) {
|
|
96
|
+
self.currentFrameIndex = index
|
|
97
|
+
self.currentFrame = frame
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
imagePlayer.animationLoopHandler = { [weak self] (loopCount) in
|
|
101
|
+
guard let self = self else {
|
|
102
|
+
return
|
|
103
|
+
}
|
|
104
|
+
if (self.isPlaying) {
|
|
105
|
+
self.currentLoopCount = loopCount
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Setup configuration
|
|
109
|
+
if let maxBufferSize = maxBufferSize {
|
|
110
|
+
imagePlayer.maxBufferSize = maxBufferSize
|
|
111
|
+
}
|
|
112
|
+
if let customLoopCount = customLoopCount {
|
|
113
|
+
imagePlayer.totalLoopCount = customLoopCount
|
|
114
|
+
}
|
|
115
|
+
imagePlayer.runLoopMode = runLoopMode
|
|
116
|
+
imagePlayer.playbackRate = playbackRate
|
|
117
|
+
imagePlayer.playbackMode = playbackMode
|
|
118
|
+
|
|
119
|
+
self.player = imagePlayer
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) DreamPiggy <lizhuoli1126@126.com>
|
|
4
|
+
*
|
|
5
|
+
* For the full copyright and license information, please view the LICENSE
|
|
6
|
+
* file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import Foundation
|
|
10
|
+
import SDWebImage
|
|
11
|
+
|
|
12
|
+
#if os(iOS) || os(tvOS) || os(macOS)
|
|
13
|
+
|
|
14
|
+
/// Use wrapper to solve tne `UIImageView`/`NSImageView` frame size become image size issue (SwiftUI's Bug)
|
|
15
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
16
|
+
public class AnimatedImageViewWrapper : PlatformView {
|
|
17
|
+
var wrapped = SDAnimatedImageView()
|
|
18
|
+
var interpolationQuality = CGInterpolationQuality.default
|
|
19
|
+
var shouldAntialias = false
|
|
20
|
+
var resizable = false
|
|
21
|
+
|
|
22
|
+
override public func draw(_ rect: CGRect) {
|
|
23
|
+
#if os(macOS)
|
|
24
|
+
guard let ctx = NSGraphicsContext.current?.cgContext else {
|
|
25
|
+
return
|
|
26
|
+
}
|
|
27
|
+
#else
|
|
28
|
+
guard let ctx = UIGraphicsGetCurrentContext() else {
|
|
29
|
+
return
|
|
30
|
+
}
|
|
31
|
+
#endif
|
|
32
|
+
ctx.interpolationQuality = interpolationQuality
|
|
33
|
+
ctx.setShouldAntialias(shouldAntialias)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#if os(macOS)
|
|
37
|
+
public override func layout() {
|
|
38
|
+
super.layout()
|
|
39
|
+
wrapped.frame = self.bounds
|
|
40
|
+
}
|
|
41
|
+
#else
|
|
42
|
+
public override func layoutSubviews() {
|
|
43
|
+
super.layoutSubviews()
|
|
44
|
+
wrapped.frame = self.bounds
|
|
45
|
+
}
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
public override var intrinsicContentSize: CGSize {
|
|
49
|
+
/// Match the behavior of SwiftUI.Image, only when image is resizable, use the super implementation to calculate size
|
|
50
|
+
if resizable {
|
|
51
|
+
return super.intrinsicContentSize
|
|
52
|
+
} else {
|
|
53
|
+
/// Not resizable, always use image size, like SwiftUI.Image
|
|
54
|
+
return wrapped.intrinsicContentSize
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public override init(frame frameRect: CGRect) {
|
|
59
|
+
super.init(frame: frameRect)
|
|
60
|
+
addSubview(wrapped)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public required init?(coder: NSCoder) {
|
|
64
|
+
super.init(coder: coder)
|
|
65
|
+
addSubview(wrapped)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// Use wrapper to solve the `UIProgressView`/`NSProgressIndicator` frame origin NaN crash (SwiftUI's bug)
|
|
70
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
71
|
+
public class ProgressIndicatorWrapper : PlatformView {
|
|
72
|
+
#if os(macOS)
|
|
73
|
+
var wrapped = NSProgressIndicator()
|
|
74
|
+
#else
|
|
75
|
+
var wrapped = UIProgressView(progressViewStyle: .default)
|
|
76
|
+
#endif
|
|
77
|
+
|
|
78
|
+
#if os(macOS)
|
|
79
|
+
public override func layout() {
|
|
80
|
+
super.layout()
|
|
81
|
+
wrapped.setFrameOrigin(CGPoint(x: round(self.bounds.width - wrapped.frame.width) / 2, y: round(self.bounds.height - wrapped.frame.height) / 2))
|
|
82
|
+
}
|
|
83
|
+
#else
|
|
84
|
+
public override func layoutSubviews() {
|
|
85
|
+
super.layoutSubviews()
|
|
86
|
+
wrapped.center = self.center
|
|
87
|
+
}
|
|
88
|
+
#endif
|
|
89
|
+
|
|
90
|
+
public override init(frame frameRect: CGRect) {
|
|
91
|
+
super.init(frame: frameRect)
|
|
92
|
+
addSubview(wrapped)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public required init?(coder: NSCoder) {
|
|
96
|
+
super.init(coder: coder)
|
|
97
|
+
addSubview(wrapped)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
102
|
+
extension PlatformView {
|
|
103
|
+
/// Adds constraints to this `UIView` instances `superview` object to make sure this always has the same size as the superview.
|
|
104
|
+
/// Please note that this has no effect if its `superview` is `nil` – add this `UIView` instance as a subview before calling this.
|
|
105
|
+
func bindFrameToSuperviewBounds() {
|
|
106
|
+
guard let superview = self.superview else {
|
|
107
|
+
print("Error! `superview` was nil – call `addSubview(view: UIView)` before calling `bindFrameToSuperviewBounds()` to fix this.")
|
|
108
|
+
return
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
self.translatesAutoresizingMaskIntoConstraints = false
|
|
112
|
+
self.topAnchor.constraint(equalTo: superview.topAnchor, constant: 0).isActive = true
|
|
113
|
+
self.bottomAnchor.constraint(equalTo: superview.bottomAnchor, constant: 0).isActive = true
|
|
114
|
+
self.leadingAnchor.constraint(equalTo: superview.leadingAnchor, constant: 0).isActive = true
|
|
115
|
+
self.trailingAnchor.constraint(equalTo: superview.trailingAnchor, constant: 0).isActive = true
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/// Finding the HostingView for UIKit/AppKit View.
|
|
119
|
+
/// - Parameter entry: The entry platform view
|
|
120
|
+
/// - Returns: The hosting view.
|
|
121
|
+
func findHostingView() -> PlatformView? {
|
|
122
|
+
var superview = self.superview
|
|
123
|
+
while let s = superview {
|
|
124
|
+
if NSStringFromClass(type(of: s)).contains("HostingView") {
|
|
125
|
+
return s
|
|
126
|
+
}
|
|
127
|
+
superview = s.superview
|
|
128
|
+
}
|
|
129
|
+
return nil
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
#endif
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) DreamPiggy <lizhuoli1126@126.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 SwiftUI
|
|
10
|
+
|
|
11
|
+
#if os(macOS) || os(iOS) || os(tvOS)
|
|
12
|
+
/// An activity indicator (system style)
|
|
13
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
14
|
+
public struct ActivityIndicator: PlatformViewRepresentable {
|
|
15
|
+
@Binding var isAnimating: Bool
|
|
16
|
+
var style: Style
|
|
17
|
+
|
|
18
|
+
/// Create the indicator with animation binding and style
|
|
19
|
+
/// - Parameters:
|
|
20
|
+
/// - isAnimating: The binding to control the animation
|
|
21
|
+
/// - style: The indicator style
|
|
22
|
+
public init(_ isAnimating: Binding<Bool>, style: Style = .medium) {
|
|
23
|
+
self._isAnimating = isAnimating
|
|
24
|
+
self.style = style
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#if os(macOS)
|
|
28
|
+
public typealias NSViewType = NSProgressIndicator
|
|
29
|
+
#elseif os(iOS) || os(tvOS)
|
|
30
|
+
public typealias UIViewType = UIActivityIndicatorView
|
|
31
|
+
#endif
|
|
32
|
+
|
|
33
|
+
#if os(iOS) || os(tvOS)
|
|
34
|
+
public func makeUIView(context: UIViewRepresentableContext<ActivityIndicator>) -> UIActivityIndicatorView {
|
|
35
|
+
let activityStyle: UIActivityIndicatorView.Style
|
|
36
|
+
switch style {
|
|
37
|
+
case .medium:
|
|
38
|
+
activityStyle = .medium
|
|
39
|
+
case .large:
|
|
40
|
+
activityStyle = .large
|
|
41
|
+
}
|
|
42
|
+
let indicator = UIActivityIndicatorView(style: activityStyle)
|
|
43
|
+
indicator.hidesWhenStopped = true
|
|
44
|
+
return indicator
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public func updateUIView(_ uiView: UIActivityIndicatorView, context: UIViewRepresentableContext<ActivityIndicator>) {
|
|
48
|
+
isAnimating ? uiView.startAnimating() : uiView.stopAnimating()
|
|
49
|
+
}
|
|
50
|
+
#endif
|
|
51
|
+
|
|
52
|
+
#if os(macOS)
|
|
53
|
+
public func makeNSView(context: NSViewRepresentableContext<ActivityIndicator>) -> NSProgressIndicator {
|
|
54
|
+
let controlSize: NSControl.ControlSize
|
|
55
|
+
switch style {
|
|
56
|
+
case .medium:
|
|
57
|
+
controlSize = .small
|
|
58
|
+
case .large:
|
|
59
|
+
controlSize = .regular
|
|
60
|
+
}
|
|
61
|
+
let indicator = NSProgressIndicator()
|
|
62
|
+
indicator.style = .spinning
|
|
63
|
+
indicator.controlSize = controlSize
|
|
64
|
+
indicator.isDisplayedWhenStopped = false
|
|
65
|
+
return indicator
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public func updateNSView(_ nsView: NSProgressIndicator, context: NSViewRepresentableContext<ActivityIndicator>) {
|
|
69
|
+
isAnimating ? nsView.startAnimation(nil) : nsView.stopAnimation(nil)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
#endif
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
76
|
+
extension ActivityIndicator {
|
|
77
|
+
public enum Style {
|
|
78
|
+
case medium
|
|
79
|
+
case large
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
#endif
|
package/example/ios/Pods/SDWebImageSwiftUI/SDWebImageSwiftUI/Classes/Indicator/Indicator.swift
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) DreamPiggy <lizhuoli1126@126.com>
|
|
4
|
+
*
|
|
5
|
+
* For the full copyright and license information, please view the LICENSE
|
|
6
|
+
* file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import Foundation
|
|
10
|
+
import SwiftUI
|
|
11
|
+
|
|
12
|
+
/// A type to build the indicator
|
|
13
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
14
|
+
public struct Indicator<T> where T : View {
|
|
15
|
+
var content: (Binding<Bool>, Binding<Double>) -> T
|
|
16
|
+
|
|
17
|
+
/// Create a indicator with builder
|
|
18
|
+
/// - Parameter builder: A builder to build indicator
|
|
19
|
+
/// - Parameter isAnimating: A Binding to control the animation. If image is during loading, the value is true, else (like start loading) the value is false.
|
|
20
|
+
/// - Parameter progress: A Binding to control the progress during loading. Value between [0.0, 1.0]. If no progress can be reported, the value is 0.
|
|
21
|
+
/// Associate a indicator when loading image with url
|
|
22
|
+
public init(@ViewBuilder content: @escaping (_ isAnimating: Binding<Bool>, _ progress: Binding<Double>) -> T) {
|
|
23
|
+
self.content = content
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/// A observable model to report indicator loading status
|
|
28
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
29
|
+
public class IndicatorStatus : ObservableObject {
|
|
30
|
+
/// whether indicator is loading or not
|
|
31
|
+
@Published var isLoading: Bool = false
|
|
32
|
+
/// indicator progress, should only be used for indicator binding, value between [0.0, 1.0]
|
|
33
|
+
@Published var progress: Double = 0
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// A implementation detail View Modifier with indicator
|
|
37
|
+
/// SwiftUI View Modifier construced by using a internal View type which modify the `body`
|
|
38
|
+
/// It use type system to represent the view hierarchy, and Swift `some View` syntax to hide the type detail for users
|
|
39
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
40
|
+
public struct IndicatorViewModifier<T> : ViewModifier where T : View {
|
|
41
|
+
|
|
42
|
+
/// The loading status
|
|
43
|
+
@ObservedObject public var status: IndicatorStatus
|
|
44
|
+
|
|
45
|
+
/// The indicator
|
|
46
|
+
public var indicator: Indicator<T>
|
|
47
|
+
|
|
48
|
+
public func body(content: Content) -> some View {
|
|
49
|
+
ZStack {
|
|
50
|
+
content
|
|
51
|
+
.backport
|
|
52
|
+
.overlay {
|
|
53
|
+
if status.isLoading {
|
|
54
|
+
indicator.content($status.isLoading, $status.progress)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#if os(macOS) || os(iOS) || os(tvOS)
|
|
62
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
63
|
+
extension Indicator where T == ActivityIndicator {
|
|
64
|
+
/// Activity Indicator
|
|
65
|
+
public static var activity: Indicator {
|
|
66
|
+
Indicator { isAnimating, _ in
|
|
67
|
+
ActivityIndicator(isAnimating)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/// Activity Indicator with style
|
|
72
|
+
/// - Parameter style: style
|
|
73
|
+
public static func activity(style: ActivityIndicator.Style) -> Indicator {
|
|
74
|
+
Indicator { isAnimating, _ in
|
|
75
|
+
ActivityIndicator(isAnimating, style: style)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
81
|
+
extension Indicator where T == ProgressIndicator {
|
|
82
|
+
/// Progress Indicator
|
|
83
|
+
public static var progress: Indicator {
|
|
84
|
+
Indicator { isAnimating, progress in
|
|
85
|
+
ProgressIndicator(isAnimating, progress: progress)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/// Progress Indicator with style
|
|
90
|
+
/// - Parameter style: style
|
|
91
|
+
public static func progress(style: ProgressIndicator.Style) -> Indicator {
|
|
92
|
+
Indicator { isAnimating, progress in
|
|
93
|
+
ProgressIndicator(isAnimating, progress: progress, style: style)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
#endif
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) DreamPiggy <lizhuoli1126@126.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 SwiftUI
|
|
10
|
+
|
|
11
|
+
#if os(macOS) || os(iOS) || os(tvOS)
|
|
12
|
+
/// A progress bar indicator (system style)
|
|
13
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
14
|
+
public struct ProgressIndicator: PlatformViewRepresentable {
|
|
15
|
+
@Binding var isAnimating: Bool
|
|
16
|
+
@Binding var progress: Double
|
|
17
|
+
var style: Style
|
|
18
|
+
|
|
19
|
+
/// Create indicator with animation binding, progress binding and the style
|
|
20
|
+
/// - Parameters:
|
|
21
|
+
/// - isAnimating: The binding to control the animation
|
|
22
|
+
/// - progress: The binding to update the progress
|
|
23
|
+
/// - style: The indicator style
|
|
24
|
+
public init(_ isAnimating: Binding<Bool>, progress: Binding<Double>, style: Style = .default) {
|
|
25
|
+
self._isAnimating = isAnimating
|
|
26
|
+
self._progress = progress
|
|
27
|
+
self.style = style
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#if os(macOS)
|
|
31
|
+
public typealias NSViewType = ProgressIndicatorWrapper
|
|
32
|
+
#elseif os(iOS) || os(tvOS)
|
|
33
|
+
public typealias UIViewType = ProgressIndicatorWrapper
|
|
34
|
+
#endif
|
|
35
|
+
|
|
36
|
+
#if os(iOS) || os(tvOS)
|
|
37
|
+
public func makeUIView(context: UIViewRepresentableContext<ProgressIndicator>) -> ProgressIndicatorWrapper {
|
|
38
|
+
let progressStyle: UIProgressView.Style
|
|
39
|
+
switch style {
|
|
40
|
+
#if os(iOS)
|
|
41
|
+
case .bar:
|
|
42
|
+
progressStyle = .bar
|
|
43
|
+
#endif
|
|
44
|
+
case .default:
|
|
45
|
+
progressStyle = .default
|
|
46
|
+
}
|
|
47
|
+
let uiView = ProgressIndicatorWrapper()
|
|
48
|
+
let view = uiView.wrapped
|
|
49
|
+
view.progressViewStyle = progressStyle
|
|
50
|
+
return uiView
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public func updateUIView(_ uiView: ProgressIndicatorWrapper, context: UIViewRepresentableContext<ProgressIndicator>) {
|
|
54
|
+
let view = uiView.wrapped
|
|
55
|
+
if isAnimating {
|
|
56
|
+
view.setProgress(Float(progress), animated: true)
|
|
57
|
+
} else {
|
|
58
|
+
if progress == 0 {
|
|
59
|
+
view.isHidden = false
|
|
60
|
+
view.progress = 0
|
|
61
|
+
} else {
|
|
62
|
+
view.isHidden = true
|
|
63
|
+
view.progress = 1
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
#endif
|
|
68
|
+
|
|
69
|
+
#if os(macOS)
|
|
70
|
+
public func makeNSView(context: NSViewRepresentableContext<ProgressIndicator>) -> ProgressIndicatorWrapper {
|
|
71
|
+
let nsView = ProgressIndicatorWrapper()
|
|
72
|
+
let view = nsView.wrapped
|
|
73
|
+
view.style = .bar
|
|
74
|
+
view.isDisplayedWhenStopped = false
|
|
75
|
+
view.controlSize = .small
|
|
76
|
+
view.frame = CGRect(x: 0, y: 0, width: 160, height: 0) // Width from `UIProgressView` default width
|
|
77
|
+
view.sizeToFit()
|
|
78
|
+
view.autoresizingMask = [.maxXMargin, .minXMargin, .maxYMargin, .minYMargin]
|
|
79
|
+
return nsView
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public func updateNSView(_ nsView: ProgressIndicatorWrapper, context: NSViewRepresentableContext<ProgressIndicator>) {
|
|
83
|
+
let view = nsView.wrapped
|
|
84
|
+
if isAnimating {
|
|
85
|
+
view.isIndeterminate = false
|
|
86
|
+
view.doubleValue = Double(progress) * 100
|
|
87
|
+
view.startAnimation(nil)
|
|
88
|
+
} else {
|
|
89
|
+
if progress == 0 {
|
|
90
|
+
view.isHidden = false
|
|
91
|
+
view.isIndeterminate = true
|
|
92
|
+
view.doubleValue = 0
|
|
93
|
+
view.stopAnimation(nil)
|
|
94
|
+
} else {
|
|
95
|
+
view.isHidden = true
|
|
96
|
+
view.isIndeterminate = false
|
|
97
|
+
view.doubleValue = 100
|
|
98
|
+
view.stopAnimation(nil)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
#endif
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
106
|
+
extension ProgressIndicator {
|
|
107
|
+
public enum Style {
|
|
108
|
+
case `default`
|
|
109
|
+
#if os(iOS)
|
|
110
|
+
case bar
|
|
111
|
+
#endif
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
#endif
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the SDWebImage package.
|
|
3
|
+
* (c) DreamPiggy <lizhuoli1126@126.com>
|
|
4
|
+
*
|
|
5
|
+
* For the full copyright and license information, please view the LICENSE
|
|
6
|
+
* file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import Foundation
|
|
10
|
+
import SwiftUI
|
|
11
|
+
@_exported import SDWebImage // Automatically import SDWebImage
|
|
12
|
+
|
|
13
|
+
#if os(macOS)
|
|
14
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
15
|
+
public typealias PlatformImage = NSImage
|
|
16
|
+
#else
|
|
17
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
18
|
+
public typealias PlatformImage = UIImage
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
#if os(macOS)
|
|
22
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
23
|
+
public typealias PlatformView = NSView
|
|
24
|
+
#endif
|
|
25
|
+
#if os(iOS) || os(tvOS)
|
|
26
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
27
|
+
public typealias PlatformView = UIView
|
|
28
|
+
#endif
|
|
29
|
+
#if os(watchOS)
|
|
30
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
31
|
+
public typealias PlatformView = WKInterfaceObject
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
#if os(macOS)
|
|
35
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
36
|
+
public typealias PlatformViewRepresentable = NSViewRepresentable
|
|
37
|
+
#endif
|
|
38
|
+
#if os(iOS) || os(tvOS)
|
|
39
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
40
|
+
public typealias PlatformViewRepresentable = UIViewRepresentable
|
|
41
|
+
#endif
|
|
42
|
+
#if os(watchOS)
|
|
43
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
44
|
+
public typealias PlatformViewRepresentable = WKInterfaceObjectRepresentable
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
#if os(macOS)
|
|
48
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
49
|
+
extension NSViewRepresentable {
|
|
50
|
+
typealias PlatformViewType = NSViewType
|
|
51
|
+
}
|
|
52
|
+
#endif
|
|
53
|
+
#if os(iOS) || os(tvOS)
|
|
54
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
55
|
+
extension UIViewRepresentable {
|
|
56
|
+
typealias PlatformViewType = UIViewType
|
|
57
|
+
}
|
|
58
|
+
#endif
|
|
59
|
+
#if os(watchOS)
|
|
60
|
+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
|
|
61
|
+
extension WKInterfaceObjectRepresentable {
|
|
62
|
+
typealias PlatformViewType = WKInterfaceObjectType
|
|
63
|
+
}
|
|
64
|
+
#endif
|