UIView+DSEMExtension.h 1.96 KB
//
//  UIView+DSEMExtension.h
//  BKProjectFramework
//
//  Created by BIKE on 2018/7/11.
//  Copyright © 2018年 BIKE. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MBProgressHUD/MBProgressHUD.h>

#define DS_showMessage(msg) [DS_APP_KEY_WINDOW showMessage:msg]

@interface UIView (DSEMExtension)

#pragma mark - 附加属性

/**
 x
 */
@property (nonatomic, assign) CGFloat x;
/**
 y
 */
@property (nonatomic, assign) CGFloat y;
/**
 width
 */
@property (nonatomic, assign) CGFloat width;
/**
 height
 */
@property (nonatomic, assign) CGFloat height;
/**
 origin
 */
@property (nonatomic, assign) CGPoint origin;
/**
 size
 */
@property (nonatomic, assign) CGSize size;
/**
 centerX
 */
@property (nonatomic, assign) CGFloat centerX;
/**
 centerY
 */
@property (nonatomic, assign) CGFloat centerY;

#pragma mark - 查找Controller

/**
 查找controller
 
 @return UIViewController
 */
-(nullable UIViewController *)findViewController;

#pragma mark - 加载框

/**
 显示加载框 (不可点击)
 */
-(nonnull MBProgressHUD*)showLoading;

/**
 显示带提示加载框 (不可点击)
 
 @param remind 提示
 */
-(void)showLoading:(nullable NSString*)remind;

/**
 隐藏加载框 (不可点击)
 */
-(void)hideLoading;

/**
 显示加载框 (可点击)
 */
-(nonnull MBProgressHUD*)showHUD;

/**
 显示带提示加载框 (可点击)
 
 @param remind 提示
 */
-(void)showHUD:(nullable NSString*)remind;

/**
 隐藏加载框 (可点击)
 */
-(void)hideHUD;

#pragma mark - 提示框

/// 提示框
/// @param message 提示信息
-(void)showMessage:(nullable NSString *)message;

#pragma mark - 加入购物车动画

/**
 加入购物车动画
 
 @param frame 开始frame
 @param targetFrame 结束frame
 @param complete 完成
 */
-(void)addShopingCartAnimateWithbeginFrame:(CGRect)frame targetFrame:(CGRect)targetFrame complete:(nullable void (^)(void))complete;

#pragma mark - 截图

/**
 截图

 @return 截图
 */
-(nonnull UIImage *)getScreenshot;

@end