Giter Site home page Giter Site logo

Vic_Li's Projects

- icon -

// // Macro.h // NewTest // // Created by leipu on 15/10/11. // Copyright (c) 2015年 Leo. All rights reserved. // #pragma mark - UI & FILE /* 检测,是否运行在iOS7.0或更高版本 */ #ifndef NSFoundationVersionNumber_iOS_6_1 #define NSFoundationVersionNumber_iOS_6_1 993.00 #endif #define MINIMAL_UI (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) /* 检查设备类型 */ #define IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) /* 控件高度 */ #define NAVIGATION_BAR_HEIGHT (MINIMAL_UI ? 64.0f : 44.0f) #define STATUS_BAR_HEIGHT 20 // 状态栏 #define TOOLBAR_HEIGHT 44 // 底部工具栏 #define TABBAR_HEIGHT 44 #define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width) // 屏幕宽度 #define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height) // 屏幕高度 #define SCREEN_SCALE ([UIScreen mainScreen].scale) #define isIos7 ([[[UIDevice currentDevice] systemVersion] floatValue]) #define StatusbarSize ((isIos7 >= 7 && __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_6_1)?20.f:0.f) // 通过Red, Green, Blue设置颜色值 #define UIColorWithRGBA(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)] #define UIColorWithRGB(r,g,b) UIColorWithRGBA(r, g, b, 1.0) // 通过16进制数设置颜色值 #define UIColorWithHexA(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ blue:((float)(rgbValue & 0xFF))/255.0 \ alpha:(a)] #define UIColorWithHex(rgbValue) UIColorWithHexA(rgbValue, 1.0) // 通过图片设置颜色值 #define UIColorWithTexture(image) [UIColor colorWithPatternImage:[UIImage imageNamed:image]] #pragma mark - Path #define kHomePath NSHomeDirectory() #define kCachePath [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"] #define kDocumentFolder [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] #define kDocumentFolder2 [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] #define kLibraryPath [NSHomeDirectory() stringByAppendingPathComponent:@"Library"] #define kTempPath NSTemporaryDirectory() #define kMainBoundPath [[NSBundle mainBundle] bundlePath] #define kResourcePath [[NSBundle mainBundle] resourcePath] #define kExecutablePath [[NSBundle mainBundle] executablePath] #pragma mark - System #define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue] #define APP_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] #define BUNDLE_NAME [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"] #define BUNDLE_VERSION [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] #define BUNDLE_ID [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"] #define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO) #define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO) #define iPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO) #pragma mark - Number #define DEGREES_TO_RADIANS(x) (M_PI * (x) / 180.0) // 弧度转角度 #define RADIANS_TO_DEGREES(x) (r * 180.0) / (M_PI) // 角度转弧度 #pragma mark - Log #ifdef DEBUG //测试模式 # define DLog(...) NSLog((@"%s [Line %d] %@"), __PRETTY_FUNCTION__, __LINE__, [NSString stringWithFormat:__VA_ARGS__]) # define SLog(...) NSLog(__VA_ARGS__) #else # define DLog(...) # define SLog(...) #endif #pragma mark - String #define HSStringFromCGSize(size) [NSString stringWithFormat:@"%.0f_%.0f", size.width * SCREEN_SCALE, size.height * SCREEN_SCALE]

996.icu icon 996.icu

Repo for counting stars and contributing. Press F to pay respect to glorious developers.

aachartkit icon aachartkit

📈📊🚀🚀🚀An elegant and friendly data visualization chart framework for Apple developers . Extremely powerful ,supports line, spline, area, areaspline, column, bar, pie, scatter, angular gauges, arearange, areasplinerange, columnrange, bubble, box plot, error bars, funnel, waterfall and polar chart types.极其精美而又强大的跨平台数据可视化图表框架,支持柱状图、条形图、折线图、曲线图、折线填充图、曲线填充图、气泡图、扇形图、环形图、散点图、雷达图、混合图等各种类型的多达几十种的信息图图表,完全满足工作所需.

aerial icon aerial

Apple TV Aerial Screensaver for Mac

airsandbox icon airsandbox

view iOS app sandbox file system on real device, share files via airdrop

appcenter-docs icon appcenter-docs

content repo for Visual Studio App Center on docs.microsoft.com

apporderfiles icon apporderfiles

The easiest way to generate order files for Mach-O using Clang. Improving App Performance.

appperformance icon appperformance

App性能监控,包括:CPU占用率、内存占用大小、卡顿、启动闪退、崩溃、耗电量等。

autossh icon autossh

Password-free automatic login SSH(免密登陆SSH)

avoidcrash icon avoidcrash

This framework can effective avoid crash by potential error code. For example : If you insert a nil into a mutable array, this framework can avoid crash and note you that where cause crash.

awesome icon awesome

😎 Awesome lists about all kinds of interesting topics

awesome-ios icon awesome-ios

A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.