Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added custom logging to pch

  • Loading branch information...
commit ac773828e00a9292b5514cb7b67595e8b9172f5a 1 parent 72a99f4
@TheVole authored
Showing with 18 additions and 2 deletions.
  1. +2 −2 Classes/HorizontalTableView.h.m
  2. +16 −0 Scroller_Prefix.pch
View
4 Classes/HorizontalTableView.h.m
@@ -59,7 +59,7 @@ - (UIView *)viewForPhysicalPage:(NSUInteger)pageIndex {
pageView = [self loadViewForPage:pageIndex];
[self.pageViews replaceObjectAtIndex:pageIndex withObject:pageView];
[self.scrollView addSubview:pageView];
- NSLog(@"View loaded for page %d", pageIndex);
+ DLog(@"View loaded for page %d", pageIndex);
} else {
pageView = [self.pageViews objectAtIndex:pageIndex];
}
@@ -172,7 +172,7 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
- NSLog(@"scrollViewDidEndDecelerating");
+ DLog(@"scrollViewDidEndDecelerating");
NSUInteger physicalPage = self.physicalPageIndex;
NSUInteger properPage = [self physicalPageForPage:[self pageForPhysicalPage:physicalPage]];
if (physicalPage != properPage)
View
16 Scroller_Prefix.pch
@@ -6,3 +6,19 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
+
+
+#ifdef DEBUG
+#define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
+#define ALog(...) [[NSAssertionHandler currentHandler] \
+handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] \
+lineNumber:__LINE__ description:__VA_ARGS__]
+#else
+#define DLog(...) do {} while (0)
+#ifndef NS_BLOCK_ASSERTIONS
+#define NS_BLOCK_ASSERTIONS
+#endif
+#define ALog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
+#endif
+
+#define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while (0)
Please sign in to comment.
Something went wrong with that request. Please try again.