//
//  MyTools.h
//  CapitalChamberlain
//
//  Created by 张杰 on 15/12/10.
//  Copyright © 2015年 SunShine. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface MyTools : NSObject

+ (void)animateToBottomDuration:(NSTimeInterval)duration view:(UIView *)view;//view向下移动自身高度的距离
+ (void)animateFromBottomDuration:(NSTimeInterval)duration view:(UIView *)view viewHeight:(CGFloat)height;//view向上移动自身高度的距离

+ (void)appearAndDisappearAnimateDuration:(NSTimeInterval)duration view:(UIView *)view;//淡入淡出动画

+ (NSString *)stringFromDate:(NSDate *)date format:(NSString *)format;//日期格式 @"yyyy-MM-dd HH:mm:ss"
//判断手机号格式
+ (NSString *)valiMobile:(NSString *)mobile;

+ (UILabel *)labelWithFontSize:(CGFloat)font textColor:(UIColor *)color top:(CGFloat)top bottom:(CGFloat)bottom left:(CGFloat)left right:(CGFloat)right centerX:(CGFloat)centerX centerY:(CGFloat)centerY isSizeToFit:(BOOL)isSizeToFit width:(CGFloat)width height:(CGFloat)height cotent:(NSString *)content;

+ (UIButton *)buttonWithType:(UIButtonType)buttonType FontSize:(CGFloat)font textColor:(UIColor *)color top:(CGFloat)top bottom:(CGFloat)bottom left:(CGFloat)left right:(CGFloat)right centerX:(CGFloat)centerX centerY:(CGFloat)centerY isSizeToFit:(BOOL)isSizeToFit  width:(CGFloat)width height:(CGFloat)height cotent:(NSString *)content action:(SEL)action target:(id)target;

+ (UITableView *)tableViewWithStyle:(UITableViewStyle)style Top:(CGFloat)top bottom:(CGFloat)bottom left:(CGFloat)left right:(CGFloat)right centerX:(CGFloat)centerX centerY:(CGFloat)centerY width:(CGFloat)width height:(CGFloat)height delegateAndDatasource:(id)target rigistClass:(Class)cellClass CellReuseIdentifier:(NSString *)identifier separatorStyle:(BOOL)separator;

+ (UIImageView *)imageViewBackGroundColor:(UIColor *)color top:(CGFloat)top left:(CGFloat)left bottom:(CGFloat)bottom right:(CGFloat)right centerX:(CGFloat)centerX centerY:(CGFloat)centerY  width:(CGFloat)width height:(CGFloat)height cornerRadius:(CGFloat)cornerRadius;

+ (UIImage*)imageFromView:(UIView*)view;

//设置view的位置大小等属性
+ (void)setView:(UIView *)tableView withTop:(CGFloat)top left:(CGFloat)left bottom:(CGFloat)bottom right:(CGFloat)right centerX:(CGFloat)centerX centerY:(CGFloat)centerY  width:(CGFloat)width height:(CGFloat)height cornerRadius:(CGFloat)cornerRadius;

+(void)showAlertWithStringAndTitle:(NSString *)msg title:(NSString*)title;
/**
 *  @param pDate  时间戳
 *  @param format 日期格式@"yyyy-MM-dd HH:mm:ss"
 *
 *  @return 日期字符串
 */
+ (NSString *)LongToDate:(NSNumber *)pDate WithFormat:(NSString *)format;

+ (void)userDefaultSetObject:(id)object forKey:(NSString *)key;
+ (id)userDefaultObjectforKey:(NSString *)key;
@end
