//
//  GMConstant.m
//  GMKit
//
//  Created by wangyang on 2017/11/8.
//

#import "Constant.h"

@implementation Constant
+ (CGRect)screenBounds {
    return [[UIScreen mainScreen] bounds];
}

+ (CGFloat)screenWidth {
    return [[UIScreen mainScreen] bounds].size.width;
}

+ (CGFloat)statusBarHeight{
    return  [UIApplication sharedApplication].statusBarFrame.size.height;
}

+ (CGFloat)screenHeight {
    return [[UIScreen mainScreen] bounds].size.height;
}

+ (CGFloat)onePixel {
    return 1/[UIScreen mainScreen].scale;
}

+ (CGFloat)deviceScale {
    return [UIScreen mainScreen].scale;
}

+ (NSString *)appName {
    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
}

+ (NSString *)appVersion {
    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
}

+ (NSString *)appBuildVersion {
    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
}

+ (NSString *)appHome {
    return NSHomeDirectory();
}

+ (NSString *)appTemp {
    return NSTemporaryDirectory();
}

+ (NSString *)appDocument {
    return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
}

+ (NSString *)appBundle {
    return [NSBundle mainBundle].resourcePath;
}
@end