GiGaMaskTime/GIGA/Common/GiGaHelper.h

63 lines
1.4 KiB
Objective-C

//
// GiGaHelper.h
// GIGA
//
// Created by lianxiang on 2018/8/13.
// Copyright © 2018年 com.giga.ios. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface GiGaHelper : NSObject
/**
* 获取当前时间 格式 yyyy-MM-dd hh:mm:ss
*/
+(NSString *) getNowTimeString;
/**
* 时间转时间戳
*/
+(long) timeStampWithDate:(NSDate *) timeDate;
/**
* 时间戳转时间
*/
+ (NSString *) dateWithTimeStamp:(long) longValue;
/**
* 根据时间间隔获取未来时间戳
hour 几小时
min 几分钟
second 几秒
*/
+(long)getFutureTimetstamp:(NSUInteger)hour minute:(NSUInteger)min second:(NSUInteger)second;
/**
* 系统当前时间时间戳
*/
+(long)getNowDateTimestamp;
/**
* NSTimeInterval 转分钟秒
*/
+(NSString *)stringWithNSTimerinterval:(NSTimeInterval)interval;
//计算文字的长度
+ (CGSize)sizeWithText:(NSString *)text font:(UIFont *)font maxSize:(CGSize)maxSize;
+(CGFloat)getSpaceLabelHeight:(NSString*)str withFont:(UIFont*)font maxSize:(CGSize)maxSize;
+(void)setLabelSpace:(UILabel*)label withValue:(NSString*)str withFont:(UIFont*)font;
/**
是否是手机号
*/
+(BOOL)isPhoneNumber:(NSString*)mobileNumber;
+(NSAttributedString *)stringWithText:(NSString *)title textColor:(UIColor *)color textFont:(UIFont *)font leterSpace:(CGFloat )space;
+(NSString *)convertToJsonData:(NSDictionary *)dict;
+(NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
@end