Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Created January 22, 2011 12:39
Show Gist options
  • Save rummelonp/791098 to your computer and use it in GitHub Desktop.
Save rummelonp/791098 to your computer and use it in GitHub Desktop.
iOSアプリのPrefixファイル
#ifdef __OBJC__
# import <Foundation/Foundation.h>
# import <UIKit/UIKit.h>
#endif
#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 30200)
# define IS_PAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
# define IS_PHONE UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad
#else
# define IS_PAD NO
# define IS_PHONE YES
#endif
#ifdef DEBUG
#define LOG(...) NSLog(__VA_ARGS__)
#define LOG_METHOD NSLog(@"%@/%@", NSStringFromClass([self class]), NSStringFromSelector(_cmd))
#define LOG_POINT(p) NSLog(@"x:%f/y:%f", p.x, p.y)
#define LOG_SIZE(s) NSLog(@"w:%f/h:%f", s.width, s.height)
#define LOG_RECT(r) NSLog(@"x:%f/y:%f/w:%f/h:%f", r.origin.x, r.origin.y, r.size.width, r.size.height)
#else
#define LOG(...) ;
#define LOG_METHOD ;
#define LOG_POINT(p) ;
#define LOG_SIZE(s) ;
#define LOG_RECT(r) ;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment