//
//  SDGeneralTool.h
//  HomeHealth
//
//  Created by newuser on 16/12/30.
//  Copyright © 2016年 ChiJian. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "OffcnBaseNetworking.h"

@interface SDGeneralTool : NSObject

//toast
+(void)toastWithTitlemessage:(NSString *)titlemessage;
+(void)removeDSToast;
//Alert弹框
+(void)popAlertControllerWithTarget:(UIViewController *)target title:(NSString *)title message:(NSString *)message finished:(void(^)(UIAlertAction * _Nonnull action))finished;

//push
+(void)pushViewControllerWithController:(UIViewController *)Controller;

+ (NSString*)deviceVersion;

+ (NSString *)getDouble2Num:(id)num;

#pragma mark - 计算时间差
+(BOOL)isPassMinute:(int)min startTime:(NSString *)startTime endTime:(NSString *)endTime;
//聊天获取下一条消息时间标签
+(NSString*)getNextMsgTimeWithTime:(NSString *)Time;
//当天时间
+(NSString*)getHistorySameDayTimeWithTime:(NSString *)Time;
//获取当前的时间
+(NSString*)getCurrentTimes;
+(NSString*)getAllCurrentTimes;
//获取当前时间戳（以毫秒为单位）
+(NSString *)getNowTimeTimestampMillisecond;
//获取当前时间戳(以秒为单位)
+(NSString *)getNowSSTimeTimestamp;
//获取当前时间戳(以毫秒为单位)
+(NSString *)getNowSSSTimeTimestamp;

+(NSString *)getHHTimeWithSeconds:(NSTimeInterval)s;

+ (NSString *)getTimeWithSeconds:(NSTimeInterval)s;

+(NSString *)getTimeWithDate:(NSDate *)date;

+ (BOOL)isAllowInputPasssword:(NSString *)str;

//[6-20位字符，可由中文、英文、数字及“_”、“-”组成]
+(BOOL)isValidateName:(NSString *)name;
//手机号验证
+(BOOL)checkTelNumber:(NSString *)telNumber;

+ (BOOL)isIPhoneX;

+ (BOOL)isIPhone4;

//base64编码
+(NSString *)encode:(NSString *)string;
//base64解码
+(NSString *)dencode:(NSString *)base64String;

//获取系统开机时间到1970时间差值
+(double)getLaunchSystemTime;
//将某个时间转化成时间戳
+(NSInteger)timeSwitchTimestamp:(NSString *)formatTime;
+(NSInteger)timeSwitchDayTimestamp:(NSString *)formatTime;
//GMT格式---@"d MMM yyyy HH:mm:ss 'GMT'"
+(NSString *)getGMTTimestamp;
//隐藏手机号
+(NSString *)hidNameWithStr:(NSString *)str;

//普通字符串转换为十六进制的
+(NSString *)hexStringFromString:(NSString *)string;
@end
