본문 바로가기

Development/IOS & Mac

Objective C Handler iOS에서도 Event Handling 과 같은 기법을 사용 할 수 있다.~! 나온지는 조금 지났지만 문법을 정리하자면.. 아래와 같이 선언 후 객체처럼 사용하면 된다.typedef void (^progressHandler)(float percentProgress);-(void) addCalculationProgressHandler:(progressHandler)handler; handler(111); 또 다른 방법 - (NSURLConnection *) requestPostUrl:(NSString *)urlStr Body:(id)body Handle:(void (^)(NSData *result)) handleBlock; NSDictionary에 넣고 쓸 때는 아래와 같이 쓰면 된다. void(^hand.. 더보기
[iOS] PBJVision iOS에서 카메라를 커스텀하여 사용할 경우 아주 유용한 라이브러리이다. VisionVision is an iOS camera engine that supports touch-to-record video, slow motion video (120 fps for supporting hardware, which is currently only iPhone 5S), and photo capture. It is compatible with both iOS 6 and iOS 7 and supports 64-bit. Pause and resume video capture is also possible without having to use a touch gesture as the sample project provi.. 더보기
[iOS] UITableView HeaderView Frame Animation UITableView에서 HeaderView에 Frame 애니메이션을 적용하는 방법이다. [UIView animateWithDuration:FOLD_ANIMATION_DURATION animations:^{[self.headerView setFrame:rect];[self.tableView setTableHeaderView:self.headerView];}]; 더보기
[IOS Library] UltraVisual 스타일 CollectionView RPSlidingMenu 이동하기 더보기
[iOS] Array Sorting 아래와 같이 사용하면 된다.~! NSArray *sortedArray; sortedArray = [drinkDetails sortedArrayUsingComparator:^NSComparisonResult(id a, id b) { NSDate *first = [(Person*)a birthDate]; NSDate *second = [(Person*)b birthDate]; return [first compare:second]; }]; 더보기
[iOS] UITextField Padding 값주기 헤더@interface UITextField (Padding) {}//end Variables -(void) setLeftPadding:(int) paddingValue;-(void) setRightPadding:(int) paddingValue; @end 구현 부@implementation UITextField (Padding) -(void) setLeftPadding:(int) paddingValue { UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, paddingValue, self.frame.size.height)]; self.leftView = paddingView; self.leftViewMode = UITextFiel.. 더보기
[IOS Library] 이미지 Blur 처리해주는 라이브러리 PurposeFXBlurView is a UIView subclass that replicates the iOS 7 realtime background blur effect, but works on iOS 5 and above. It is designed to be as fast and as simple to use as possible. FXBlurView offers two modes of operation: static, where the view is rendered only once when it is added to a superview (though it can be updated by calling setNeedsDisplay or updateAsynchronously:completion:.. 더보기
[IOS Library] 이미지에서 색상값 추출 LEColorPickerA Cocoa-Touch system for getting a color scheme in function of an image, like iTunes 11 does. It is designed as a general purpose class set, in wich LEColorPicker is the interface for your client code. 이동하기 더보기
[iOS] capturing self strongly in this block is likely to lead to a retain cycle 아래와 같은 패턴에서 block 안에서 self를 사용하게 되면 capturing self strongly in this block is likely to lead to a retain cycle 라는 경고가 뜨게 된다. 그럴 때에는 __weak typeof(self) weakSelf = self; ^(NSDictionary *dic) {self.~~~~~~ 이렇게 쓰지말고 weakSelf.~~~~~~ 이렇게 쓰자 } 더보기
[iOS] NSString URLEncoding 하기 iOS에서 제공해주는 [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 메소드의 경우 문제가 많고 버그도 있다라는 것으로 알려져있다. 한 가지 예시로 이메일 abcd@asbd.com을 Encoding해보면 결과가 그대로 출력되는 것을 알 수 있다. 위의 방법을 대체 할 수 있는 방법은 @interface NSString (URLEncoding) -(NSString *)urlEncodeUsingEncoding:(NSStringEncoding)encoding; @end @implementation NSString (URLEncoding) -(NSString *)urlEncodeUsingEncoding:(NSStringEncoding).. 더보기