iOS/Objective C 26

NSTimer가 스크롤링(Scrolling) 할때 작동이 멈춰요

NSTimer *elapsedTimeTimer = [NSTimer scheduledTimerWithTimeInterval:0.001 target:self selector:@selector(updateElapsedTimeLabel) userInfo:nil repeats:YES]; [[NSRunLoop currentRunLoop] addTimer:elapsedTimeTimer forMode:NSRunLoopCommonModes]; 스크롤링중 타이머가 정상작동을 하지 않는 경우 작동멈춤을 무시하게 됩니다. 출처 : https://stackoverflow.com/questions/5377914/uilabel-updating-stops-during-scrolling-uiscrollview

iOS/Objective C 2017.08.09

아이폰에서만 사용하고싶어요 혹은 아이패드에서만 사용하고싶어요

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) 아이폰에서만 사용할래요 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) 아이패드에서만 사용할래요 typedef NS_ENUM(NSInteger, UIUserInterfaceIdiom) { UIUserInterfaceIdiomUnspecified = -1, UIUserInterfaceIdiomPhone NS_ENUM_AVAILABLE_IOS(3_2), // iPhone and iPod touch style UI UIUserInterfaceIdiomPad NS_ENUM_AVAILABLE_IOS(3_2), // iPad style UI UIUse..

iOS/Objective C 2017.08.08

UIImageView Image ContentMode (비율)

//이미지를 중앙 비율을 맞추는것은 contentMode라고 한다//그에대한 자세한 설명은 http://marines.co.kr/archives/174 //contentMode Enum typedef NS_ENUM(NSInteger, UIViewContentMode) { UIViewContentModeScaleToFill, UIViewContentModeScaleAspectFit, // contents scaled to fit with fixed aspect. remainder is transparent UIViewContentModeScaleAspectFill, // contents scaled to fill with fixed aspect. some portion of content may be cl..

iOS/Objective C 2017.01.03

StoryBoard IB_DESIGNABLE

UIView+IB.h//h파일에 넣어주면 스토리보드에 UIView옵션이 생긴다.//그 옵션에 값을 넣어준다면 코딩으로 layer를 수정하지않아도 View생성시 값이 들어간다. 때에따라 자유롭게 사용하자.//(예) borderWidth#import IB_DESIGNABLE @interface UIView (IB) @property (nonatomic, assign) IBInspectable CGFloat borderWidth; @end UIView+IB.m#import "UIView+IB.h" IB_DESIGNABLE@implementation UIView (IB) //borderwidth make- (CGFloat)borderWidth;{ return self.layer.borderWidth;} - (v..

iOS/Objective C 2017.01.03