Develop
2014.03.26 11:04

[ios] 유용한 매크로

Views 3654 Votes 0 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

# 유용한 매크로

#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

?

List of Articles
No. Category Subject Author Date Views
121 Develop [php] Connect to Firebase Console in Laravel file hooni 2018.05.09 3110
120 Develop [php] gd 프로그램.. htm 파일.. ㅋㅋ file hooni 2013.04.23 7412
119 Develop [php] GregorianToJD(), JDToGregorian() 함수 내용 hooni 2013.12.25 10593
118 Develop [php] Laravel 4. twitter bootstrap 적용하기 hooni 2018.04.05 2539
117 Develop [php] Laravel 5.4: Specified key was too long error file hooni 2017.12.04 9221
116 Develop [php] Laravel Route에서 PC/Mobile 분기 hooni 2018.01.24 2464
115 Develop [PHP] MacOS에서 PHP 7 설치하기 file hooni 2018.05.11 4878
114 Develop [php] mysql_ 과 mysqli_ 의 차이 hooni 2017.12.01 1691
113 Develop [php] php+db 연동(odbc, mssql, mysql, sybase) 3 hooni 2013.04.23 8539
112 Develop [php] php5.3부터는 eregi()대신 preg_match()를 사용 hooni 2013.11.18 12470
111 Develop [php] substr() 한글 자를 때 깨짐 방지 hooni 2014.01.09 20363
110 Develop [php] URL/URI 관련 환경변수 hooni 2003.04.23 9147
109 Develop [php] whois정보 조회 프로그램 hooni 2003.04.23 11733
108 Develop [php] XE 관리자 IP대역 설정 오류 해결법 hooni 2014.02.10 10775
107 Develop [php] XE 스킨에서 특정 도메인 리다이렉션 file hooni 2015.01.28 575
106 Develop [php] XE 에서 php 구문 사용하기 (XE 템플릿에서) hooni 2013.10.31 19441
Board Pagination Prev 1 ... 44 45 46 47 48 ... 53 Next
/ 53