//
//  Macro.h
//  EZSaaSCommonPlugin
//
//  Created by jinke5 on 19/05/2018.
//

#define WeakObj(o) try{}@finally{} __weak typeof(o) o##Weak = o;
#define StrongObj(o) autoreleasepool{} __strong typeof(o) o = o##Weak;

//masonry补充
#define kSafeAreaInsets(view) ({UIEdgeInsets i; if(@available(iOS 11.0, *)) {i = view.safeAreaInsets;} else {i = UIEdgeInsetsZero;} i;})
#define kSafeMasTop(view) ({NSObject *mas;if(@available(iOS 11.0, *)) {mas = view.ysmas_safeAreaLayoutGuideTop;} else {mas = view.ysmas_top;} mas;})
#define kSafeMasBottom(view) ({NSObject *mas;if(@available(iOS 11.0, *)) {mas = view.ysmas_safeAreaLayoutGuideBottom;} else {mas = view.ysmas_bottom;} mas;})
#define kSafeMasLeft(view) ({NSObject *mas;if(@available(iOS 11.0, *)) {mas = view.ysmas_safeAreaLayoutGuideLeft;} else {mas = view.ysmas_left;} mas;})
#define kSafeMasRight(view) ({NSObject *mas;if(@available(iOS 11.0, *)) {mas = view.ysmas_safeAreaLayoutGuideRight;} else {mas = view.ysmas_right;} mas;})
