Contents

Develop
2014.03.26 11:04

[ios] 유용한 매크로

조회 수 3656 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

# 유용한 매크로

#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
번호 분류 제목 글쓴이 날짜 조회 수
753 Develop [js] 초간단 현재 사이트 쿠키 확인하는 명령~ hooni 2003.04.23 7275
752 Develop [js] 초간단 암호화/복호화 소스.. hooni 2003.04.23 8843
751 Develop [js] 주소표시줄 URL 읽어오기 (변경까지) secret hooni 2014.01.21 1
750 Develop [js] 주민번호 생성기.. file hooni 2003.04.23 8143
749 Develop [js] 좋은 강연자료 & UI 자료 hooni 2014.10.06 912
748 Develop [js] 점점 커지는 새창.. hooni 2003.04.23 6998
747 Develop [js] 자바스크립트의 클로저 (JavaScript's Closure) hooni 2013.05.15 12979
746 Develop [js] 자바스크립트와 정규표현식 메뉴얼 (chm 형식) file hooni 2013.04.23 7616
745 Develop [js] 자바스크립트를 동적으로 로딩하기 hooni 2013.04.23 13576
744 Develop [js] 자바스크립트로 응용프로그램 실행 ㅎㅎ hooni 2003.04.23 9812
743 Develop [js] 자바스크립트로 만든 게임 file hooni 2013.04.23 8386
742 Develop [js] 자바스크립트(Javascript) 코드를 동적으로 삽입하는 방법.. file hooni 2013.04.23 22879
Board Pagination Prev 1 ... 31 32 33 34 35 36 37 38 39 40 ... 98 Next
/ 98