iOS-YYKit(部分category)

2017-12-07  本文已影响216人  精神病患者link常

UIImage+YYAdd.h

设置图片的圆角边框,可以指定是哪一个角
- (nullable UIImage *)imageByRoundCornerRadius:(CGFloat)radius
                                       corners:(UIRectCorner)corners
                                   borderWidth:(CGFloat)borderWidth
                                   borderColor:(nullable UIColor *)borderColor
                                borderLineJoin:(CGLineJoin)borderLineJoin;

加载GIF
+ (BOOL)isAnimatedGIFData:(NSData *)data;
+ (BOOL)isAnimatedGIFFile:(NSString *)path;

旋转图片
- (nullable UIImage *)imageByRotateLeft90;
- (nullable UIImage *)imageByRotateRight90;
- (nullable UIImage *)imageByRotate180;
- (nullable UIImage *)imageByFlipVertical;
- (nullable UIImage *)imageByFlipHorizontal;

UIImageView+YYWebImage.h

    [webImageView setImageWithURL:[NSURL URLWithString:@""] options:YYWebImageOptionProgressiveBlur];

    [webImageView setHighlightedImageWithURL:[NSURL URLWithString:@""] options:YYWebImageOptionProgressiveBlur];


    // Show network activity on status bar when download image.
    //当下载图片的时候会在状态栏显示一个当前网络状况
    //YYWebImageOptionShowNetworkActivity
    
    // Display progressive/interlaced/baseline image during download (same as web browser).
    // 渐进式图片加载,一边下载一边显示
    //YYWebImageOptionProgressive = 1 << 1,
    
    // Display blurred progressive JPEG or interlaced PNG image during download.
    // This will ignore baseline image for better user experience.
    // 渐进式图片加载,一边下载一边显示,模糊效果
    //YYWebImageOptionProgressiveBlur = 1 << 2,

UIScrollView+YYAdd.h

主要是滚动到某一个位置
- (void)scrollToTop;
- (void)scrollToBottom;
- (void)scrollToLeft;
- (void)scrollToRight;
- (void)scrollToTopAnimated:(BOOL)animated;
- (void)scrollToBottomAnimated:(BOOL)animated;
- (void)scrollToLeftAnimated:(BOOL)animated;
- (void)scrollToRightAnimated:(BOOL)animated;

UITableView+YYAdd.h

主要是更新、插入、删除操作
- (void)updateWithBlock:(void (^)(UITableView *tableView))block;

- (void)scrollToRow:(NSUInteger)row inSection:(NSUInteger)section atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated;

- (void)insertRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation;

- (void)reloadRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation;

- (void)deleteRow:(NSUInteger)row inSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation;

- (void)insertRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation;

- (void)reloadRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation;

- (void)deleteRowAtIndexPath:(NSIndexPath *)indexPath withRowAnimation:(UITableViewRowAnimation)animation;

- (void)insertSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation;

- (void)deleteSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation;

- (void)reloadSection:(NSUInteger)section withRowAnimation:(UITableViewRowAnimation)animation;

- (void)clearSelectedRowsAnimated:(BOOL)animated;

UIView+YYAdd.h

截屏
- (nullable UIImage *)snapshotImage;

设置阴影
- (void)setLayerShadow:(nullable UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius;

@property (nonatomic) CGFloat left;        ///< Shortcut for frame.origin.x.
@property (nonatomic) CGFloat top;         ///< Shortcut for frame.origin.y
@property (nonatomic) CGFloat right;       ///< Shortcut for frame.origin.x + frame.size.width
@property (nonatomic) CGFloat bottom;      ///< Shortcut for frame.origin.y + frame.size.height
@property (nonatomic) CGFloat width;       ///< Shortcut for frame.size.width.
@property (nonatomic) CGFloat height;      ///< Shortcut for frame.size.height.
@property (nonatomic) CGFloat centerX;     ///< Shortcut for center.x
@property (nonatomic) CGFloat centerY;     ///< Shortcut for center.y
@property (nonatomic) CGPoint origin;      ///< Shortcut for frame.origin.
@property (nonatomic) CGSize  size;        ///< Shortcut for frame.size.

上一篇下一篇

猜你喜欢

热点阅读