Develop
2014.03.26 11:04
[ios] 유용한 매크로
조회 수 3701 댓글 0
# 유용한 매크로
#define ApplicationDelegate ((MyAppDelegate *)[[UIApplication sharedApplication] delegate]) #define UserDefaults [NSUserDefaults standardUserDefaults] #define SharedApplication [UIApplication sharedApplication] #define Bundle [NSBundle mainBundle] #define MainScreen [UIScreen mainScreen] #define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES #define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO #define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x #define NavBar self.navigationController.navigationBar #define TabBar self.tabBarController.tabBar #define NavBarHeight self.navigationController.navigationBar.bounds.size.height #define TabBarHeight self.tabBarController.tabBar.bounds.size.height #define ScreenWidth [[UIScreen mainScreen] bounds].size.width #define ScreenHeight [[UIScreen mainScreen] bounds].size.height #define TouchHeightDefault 44 #define TouchHeightSmall 32 #define ViewWidth(v) v.frame.size.width #define ViewHeight(v) v.frame.size.height #define ViewX(v) v.frame.origin.x #define ViewY(v) v.frame.origin.y #define SelfViewWidth self.view.bounds.size.width #define SelfViewHeight self.view.bounds.size.height #define RectX(f) f.origin.x #define RectY(f) f.origin.y #define RectWidth(f) f.size.width #define RectHeight(f) f.size.height #define RectSetWidth(f, w) CGRectMake(RectX(f), RectY(f), w, RectHeight(f)) #define RectSetHeight(f, h) CGRectMake(RectX(f), RectY(f), RectWidth(f), h) #define RectSetX(f, x) CGRectMake(x, RectY(f), RectWidth(f), RectHeight(f)) #define RectSetY(f, y) CGRectMake(RectX(f), y, RectWidth(f), RectHeight(f)) #define RectSetSize(f, w, h) CGRectMake(RectX(f), RectY(f), w, h) #define RectSetOrigin(f, x, y) CGRectMake(x, y, RectWidth(f), RectHeight(f)) #define DATE_COMPONENTS NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit #define TIME_COMPONENTS NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit #define FlushPool(p) [p drain]; p = [[NSAutoreleasePool alloc] init] #define RGB(r, g, b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0] #define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
[출처] https://gist.github.com/mwaterfall/953656
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
897 | Database | [mysql] CPU 점유율이 높을 때 확인할 내용 | hooni | 2015.08.26 | 6777 |
896 | System/OS | [ms-sql] 프로시져 예제.. | hooni | 2013.04.23 | 13507 |
895 | System/OS | [ms-sql] 서브스트링(substring), 프로시저(SP) 작성 예제 | hooni | 2013.04.23 | 41398 |
894 | Develop | [maven] Mac OS에 메이븐(maven) 설치하기 | hooni | 2015.01.21 | 1224 |
893 | Develop | [matlab] 정보은닉 스테가노그래피(Steganography) 수업 | hooni | 2016.10.03 | 791 |
892 | Develop | [matlab] ZigZag-Scanning (2-D Array) | hooni | 2016.10.15 | 2117 |
891 | System/OS | [mac][추천 무료앱] 구름 입력기 - 국내 맥 사용자를 위한 한글 대안 입력기 1 | hooni | 2015.01.04 | 2311 |
890 | System/OS | [mac] 패키지 매니저, MacPort | hooni | 2015.01.03 | 1131 |
889 | System/OS | [mac] 컨텍스트(Context) 메뉴 "다음으로 열기" 내용 정리 | hooni | 2013.07.10 | 18904 |
888 | System/OS | [mac] 맥에서 슬립(잠자기) 모드 진입을 막는 방법~ | hooni | 2013.10.10 | 31297 |
887 | System/OS | [mac] 맥에서 기본 실행 앱 변경하기 | hooni | 2018.03.02 | 1970 |
886 | System/OS | [mac] 맥에서 APM(apache,php,mysql) 구성하기 | hooni | 2013.04.23 | 38833 |