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.
41 lines
1.4 KiB
41 lines
1.4 KiB
![]()
2 years ago
|
//
|
||
|
// XHFoundationMacro.h
|
||
|
// MessageDisplayExample
|
||
|
//
|
||
|
// Created by dw_iOS on 14-5-22.
|
||
|
// Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). 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(...)
|
||
|
# define debugMethod()
|
||
|
#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
|