Contents

Develop
2014.03.26 11:04

[ios] 유용한 매크로

조회 수 3697 댓글 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


?

  1. [js] jQuery 코드 작성시 편리한 HTML 템플릿

    Date2013.12.17 CategoryDevelop Byhooni Views33114
    Read More
  2. [js] jQuery 치트 시트

    Date2013.12.18 CategoryDevelop Byhooni Views36301
    Read More
  3. [js] jQuery 충돌 회피

    Date2013.12.17 CategoryDevelop Byhooni Views38371
    Read More
  4. [js] jQuery 셀랙터(selector) 요약

    Date2013.12.17 CategoryDevelop Byhooni Views9439
    Read More
  5. [js] jQuery 셀 병합

    Date2014.09.23 CategoryDevelop Byhooni Views3556
    Read More
  6. [js] jQuery 관련 사이트 링크 모음

    Date2013.04.23 CategoryDevelop Byhooni Views18275
    Read More
  7. [js] jQuery 관련 문서 ㅎㅎ

    Date2013.04.23 CategoryDevelop Byhooni Views31255
    Read More
  8. [js] jQuery plugin 요약

    Date2013.12.20 CategoryDevelop Byhooni Views10748
    Read More
  9. [js] jQuery 배열 루프(each)

    Date2013.12.17 CategoryDevelop Byhooni Views10021
    Read More
  10. [js] jQjuery $ 활용

    Date2013.12.17 CategoryDevelop Byhooni Views8903
    Read More
  11. [js] Javascript로 만든 포트리스 (2010)

    Date2017.03.03 CategoryDevelop Byhooni Views2809
    Read More
  12. [js] IE에서 인쇄 설정 팁

    Date2013.04.23 CategoryDevelop Byhooni Views10914
    Read More
Board Pagination Prev 1 ... 14 15 16 17 18 19 20 21 22 23 ... 71 Next
/ 71