Prechádzať zdrojové kódy

Documentation update and garden

DreamPiggy 9 mesiacov pred
rodič
commit
240770cd78

+ 1 - 0
Configs/App-Shared.xcconfig

@@ -6,3 +6,4 @@
 
 // Name of an asset catalog app icon set whose contents will be merged into the `Info.plist`.
 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
+_EXPERIMENTAL_SWIFT_EXPLICIT_MODULES = NO

+ 5 - 0
Configs/Docc.xcconfig

@@ -0,0 +1,5 @@
+RUN_DOCUMENTATION_COMPILER = YES
+DOCC_EXTRACT_SWIFT_INFO_FOR_OBJC_SYMBOLS = YES
+DOCC_ENABLE_CXX_SUPPORT = YES
+DOCC_EXTRACT_EXTENSION_SYMBOLS = YES
+OTHER_DOCC_FLAGS= --transform-for-static-hosting

+ 1 - 0
SDWebImage/Core/SDImageCoder.h

@@ -11,6 +11,7 @@
 #import "NSData+ImageContentType.h"
 #import "SDImageFrame.h"
 
+/// Image Decoding/Encoding Options
 typedef NSString * SDImageCoderOption NS_STRING_ENUM;
 typedef NSDictionary<SDImageCoderOption, id> SDImageCoderOptions;
 typedef NSMutableDictionary<SDImageCoderOption, id> SDImageCoderMutableOptions;

+ 1 - 1
SDWebImage/Core/SDImageLoader.h

@@ -59,7 +59,7 @@ FOUNDATION_EXPORT id<SDProgressiveImageCoder> _Nullable SDImageLoaderGetProgress
 
 /**
  This function set the progressive decoder for current loading operation. If no progressive decoding is happended, pass nil.
- @param operation The loading operation to associate the progerssive decoder.
+ @param progressiveCoder The loading operation to associate the progerssive decoder.
  */
 FOUNDATION_EXPORT void SDImageLoaderSetProgressiveCoder(id<SDWebImageOperation> _Nonnull operation, id<SDProgressiveImageCoder> _Nullable progressiveCoder);
 

+ 1 - 0
SDWebImage/Core/SDWebImageDefine.h

@@ -9,6 +9,7 @@
 #import "SDWebImageCompat.h"
 
 typedef void(^SDWebImageNoParamsBlock)(void);
+/// Image Loading context option
 typedef NSString * SDWebImageContextOption NS_EXTENSIBLE_STRING_ENUM;
 typedef NSDictionary<SDWebImageContextOption, id> SDWebImageContext;
 typedef NSMutableDictionary<SDWebImageContextOption, id> SDWebImageMutableContext;

+ 2 - 2
SDWebImage/Core/SDWebImageManager.h

@@ -162,7 +162,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
  @note If you use `transformer`, `cacheKeyFilter` or `cacheSerializer` property of manager, the input context option already apply those properties before passed. This options processor is a better replacement for those property in common usage.
  For example, you can control the global options, based on the URL or original context option like the below code.
  
- @code
+ * @code
  SDWebImageManager.sharedManager.optionsProcessor = [SDWebImageOptionsProcessor optionsProcessorWithBlock:^SDWebImageOptionsResult * _Nullable(NSURL * _Nullable url, SDWebImageOptions options, SDWebImageContext * _Nullable context) {
      // Only do animation on `SDAnimatedImageView`
      if (!context[SDWebImageContextAnimatedImageClass]) {
@@ -179,7 +179,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
  
      return [[SDWebImageOptionsResult alloc] initWithOptions:options context:context];
  }];
- @endcode
+ * @endcode
  */
 @property (nonatomic, strong, nullable) id<SDWebImageOptionsProcessor> optionsProcessor;
 

+ 2 - 0
SDWebImage/Core/UIImage+Transform.m

@@ -536,6 +536,7 @@ static inline CGImageRef _Nullable SDCreateCGImageFromCIImage(CIImage * _Nonnull
 
 #pragma mark - Image Blending
 
+#if SD_UIKIT || SD_MAC
 static NSString * _Nullable SDGetCIFilterNameFromBlendMode(CGBlendMode blendMode) {
     // CGBlendMode: https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_images/dq_images.html#//apple_ref/doc/uid/TP30001066-CH212-CJBIJEFG
     // CIFilter: https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/uid/TP30000136-SW71
@@ -625,6 +626,7 @@ static NSString * _Nullable SDGetCIFilterNameFromBlendMode(CGBlendMode blendMode
     }
     return filterName;
 }
+#endif
 
 - (nullable UIImage *)sd_tintedImageWithColor:(nonnull UIColor *)tintColor {
     return [self sd_tintedImageWithColor:tintColor blendMode:kCGBlendModeSourceIn];

+ 3 - 2
SDWebImage/Core/UIView+WebCacheState.h

@@ -11,10 +11,11 @@
 
 /**
  A loading state to manage View Category which contains multiple states. Like UIImgeView.image && UIImageView.highlightedImage
- @code
+
+ * @code
  SDWebImageLoadState *loadState = [self sd_imageLoadStateForKey:@keypath(self, highlitedImage)];
  NSProgress *highlitedImageProgress = loadState.progress;
- @endcode
+ * @endcode
  */
 @interface SDWebImageLoadState : NSObject