You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.5 KiB
40 lines
1.5 KiB
![]()
2 years ago
|
//
|
||
|
// XHFoundationMacro.h
|
||
|
// MessageDisplayExample
|
||
|
//
|
||
|
// Created by dw_iOS on 14-5-22.
|
||
|
// Copyright (c) 2014年 嗨,我是曾宪华(@xhzengAIB),曾加入YY Inc.担任高级移动开发工程师,拍立秀App联合创始人,热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved.
|
||
|
//
|
||
|
|
||
|
#ifndef MessageDisplayExample_XHFoundationMacro_h
|
||
|
#define MessageDisplayExample_XHFoundationMacro_h
|
||
|
|
||
|
#ifdef DEBUG
|
||
|
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
|
||
|
#else
|
||
|
# define DLog(...)
|
||
|
#endif
|
||
|
|
||
|
// block self
|
||
|
#define WEAKSELF typeof(self) __weak weakSelf = self;
|
||
|
#define STRONGSELF typeof(weakSelf) __strong strongSelf = weakSelf;
|
||
|
|
||
|
// device verson float value
|
||
|
#define CURRENT_SYS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
|
||
|
|
||
|
// Size
|
||
|
#define MDK_SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
|
||
|
#define MDK_SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
|
||
|
|
||
|
// iPad
|
||
|
#define kIsiPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
|
||
|
#define kIs_iPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
|
||
|
#define kIs_iPhone_6 (kIs_iPhone && MDK_SCREEN_HEIGHT == 667.0)
|
||
|
#define kIs_iPhone_6P (kIs_iPhone && MDK_SCREEN_HEIGHT == 736.0)
|
||
|
|
||
|
// image STRETCH
|
||
|
#define XH_STRETCH_IMAGE(image, edgeInsets) (CURRENT_SYS_VERSION < 6.0 ? [image stretchableImageWithLeftCapWidth:edgeInsets.left topCapHeight:edgeInsets.top] : [image resizableImageWithCapInsets:edgeInsets resizingMode:UIImageResizingModeStretch])
|
||
|
|
||
|
|
||
|
#endif
|