Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 42b883e020c5032030d550923610c7c0a9b48b7a @danielamitay committed Sep 30, 2012
Showing with 2,105 additions and 0 deletions.
  1. BIN .DS_Store
  2. +31 −0 DAModularTableView/DAModularTableRow.h
  3. +38 −0 DAModularTableView/DAModularTableRow.m
  4. +33 −0 DAModularTableView/DAModularTableSection.h
  5. +56 −0 DAModularTableView/DAModularTableSection.m
  6. +57 −0 DAModularTableView/DAModularTableView.h
  7. +390 −0 DAModularTableView/DAModularTableView.m
  8. +16 −0 DAModularTableView/DAModularTableViewController.h
  9. +43 −0 DAModularTableView/DAModularTableViewController.m
  10. BIN DAModularTableViewExample/.DS_Store
  11. +350 −0 DAModularTableViewExample/DAModularTableViewExample.xcodeproj/project.pbxproj
  12. +7 −0 ...TableViewExample/DAModularTableViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  13. BIN ....xcodeproj/project.xcworkspace/xcuserdata/danielamitay.xcuserdatad/UserInterfaceState.xcuserstate
  14. +10 −0 ...le.xcodeproj/project.xcworkspace/xcuserdata/danielamitay.xcuserdatad/WorkspaceSettings.xcsettings
  15. +5 −0 ...rTableViewExample.xcodeproj/xcuserdata/danielamitay.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  16. +85 −0 ...xample.xcodeproj/xcuserdata/danielamitay.xcuserdatad/xcschemes/DAModularTableViewExample.xcscheme
  17. +22 −0 ...TableViewExample.xcodeproj/xcuserdata/danielamitay.xcuserdatad/xcschemes/xcschememanagement.plist
  18. BIN DAModularTableViewExample/DAModularTableViewExample/.DS_Store
  19. +17 −0 DAModularTableViewExample/DAModularTableViewExample/AppDelegate.h
  20. +30 −0 DAModularTableViewExample/DAModularTableViewExample/AppDelegate.m
  21. +48 −0 DAModularTableViewExample/DAModularTableViewExample/DAModularTableViewExample-Info.plist
  22. +14 −0 DAModularTableViewExample/DAModularTableViewExample/DAModularTableViewExample-Prefix.pch
  23. BIN DAModularTableViewExample/DAModularTableViewExample/Default-568h@2x.png
  24. +13 −0 ...dularTableViewExample/DAModularTableViewExample/View Controllers/DynamicInsertionViewController.h
  25. +44 −0 ...dularTableViewExample/DAModularTableViewExample/View Controllers/DynamicInsertionViewController.m
  26. +13 −0 ...arTableViewExample/DAModularTableViewExample/View Controllers/DynamicModificationViewController.h
  27. +69 −0 ...arTableViewExample/DAModularTableViewExample/View Controllers/DynamicModificationViewController.m
  28. +13 −0 DAModularTableViewExample/DAModularTableViewExample/View Controllers/InformationViewController.h
  29. +130 −0 DAModularTableViewExample/DAModularTableViewExample/View Controllers/InformationViewController.m
  30. +13 −0 DAModularTableViewExample/DAModularTableViewExample/View Controllers/MixedCellsViewController.h
  31. +170 −0 DAModularTableViewExample/DAModularTableViewExample/View Controllers/MixedCellsViewController.m
  32. +13 −0 DAModularTableViewExample/DAModularTableViewExample/View Controllers/RootViewController.h
  33. +84 −0 DAModularTableViewExample/DAModularTableViewExample/View Controllers/RootViewController.m
  34. +13 −0 DAModularTableViewExample/DAModularTableViewExample/View Controllers/WaterfallViewController.h
  35. +69 −0 DAModularTableViewExample/DAModularTableViewExample/View Controllers/WaterfallViewController.m
  36. +2 −0 DAModularTableViewExample/DAModularTableViewExample/en.lproj/InfoPlist.strings
  37. +18 −0 DAModularTableViewExample/DAModularTableViewExample/main.m
  38. BIN DAModularTableViewExample/icon@2x.png
  39. +23 −0 LICENSE.md
  40. +166 −0 README.md
  41. BIN screenshot.png
BIN .DS_Store
Binary file not shown.
@@ -0,0 +1,31 @@
+//
+// DAModularTableRow.h
+// DAModularTableView
+//
+// Created by Daniel Amitay on 8/5/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface DAModularTableRow : NSObject
+
+@property (nonatomic, strong) NSString *text;
+@property (nonatomic, strong) NSString *detailText;
+@property (nonatomic, strong) UIImage *image;
+@property (nonatomic, strong) UIView *accessoryView;
+
+@property (nonatomic) CGFloat rowHeight;
+
+@property (nonatomic) UITableViewCellSelectionStyle selectionStyle;
+@property (nonatomic) UITableViewCellAccessoryType accessoryType;
+@property (nonatomic) UITableViewCellStyle cellStyle;
+@property (nonatomic) UITableViewRowAnimation rowAnimation;
+
+@property (nonatomic, copy) void(^didSelectBlock)(NSIndexPath *indexPath);
+@property (nonatomic, copy) void(^cellForRowBlock)(UITableViewCell *cell, NSIndexPath *indexPath);
+@property (nonatomic) SEL didSelectAction;
+
++ (DAModularTableRow *)row;
+
+@end
@@ -0,0 +1,38 @@
+//
+// DAModularTableRow.m
+// DAModularTableView
+//
+// Created by Daniel Amitay on 8/5/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import "DAModularTableRow.h"
+
+@implementation DAModularTableRow
+
+@synthesize text, detailText, image, accessoryView;
+@synthesize rowHeight;
+@synthesize selectionStyle, accessoryType, cellStyle, rowAnimation;
+@synthesize didSelectBlock, cellForRowBlock, didSelectAction;
+
+#pragma mark - Public Methods
+
++ (DAModularTableRow *)row
+{
+ return [[DAModularTableRow alloc] init];
+}
+
+- (id)init
+{
+ self = [super init];
+ if (self)
+ {
+ self.selectionStyle = UITableViewCellSelectionStyleBlue;
+ self.accessoryType = UITableViewCellAccessoryNone;
+ self.cellStyle = UITableViewCellStyleDefault;
+ self.rowAnimation = UITableViewRowAnimationAutomatic;
+ }
+ return self;
+}
+
+@end
@@ -0,0 +1,33 @@
+//
+// DAModularTableSection.h
+// DAModularTableView
+//
+// Created by Daniel Amitay on 8/5/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "DAModularTableRow.h"
+
+@interface DAModularTableSection : NSObject
+
+@property (nonatomic, strong) NSMutableArray *rows;
+
+@property (nonatomic, strong) NSString *headerTitle;
+@property (nonatomic, strong) NSString *footerTitle;
+
+@property (nonatomic, strong) UIView *headerView;
+@property (nonatomic, strong) UIView *footerView;
+
+@property (nonatomic) CGFloat headerHeight;
+@property (nonatomic) CGFloat footerHeight;
+
+@property (nonatomic) UITableViewRowAnimation rowAnimation;
+
++ (DAModularTableSection *)section;
+
+#pragma mark - Accessing Rows
+
+- (DAModularTableRow *)rowAtIndex:(NSInteger)index;
+
+@end
@@ -0,0 +1,56 @@
+//
+// DAModularTableSection.m
+// DAModularTableView
+//
+// Created by Daniel Amitay on 8/5/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import "DAModularTableSection.h"
+
+@implementation DAModularTableSection
+
+@synthesize rows = _rows;
+
+@synthesize headerHeight, footerHeight;
+@synthesize headerTitle, footerTitle;
+@synthesize headerView, footerView;
+
+@synthesize rowAnimation;
+
+#pragma mark - Public Methods
+
++ (DAModularTableSection *)section
+{
+ return [[DAModularTableSection alloc] init];
+}
+
+- (id)init
+{
+ self = [super init];
+ if (self)
+ {
+ self.headerHeight = UITableViewAutomaticDimension;
+ self.footerHeight = UITableViewAutomaticDimension;
+ self.rowAnimation = UITableViewRowAnimationAutomatic;
+ }
+ return self;
+}
+
+- (DAModularTableRow *)rowAtIndex:(NSInteger)index;
+{
+ return [[self rows] objectAtIndex:index];
+}
+
+#pragma mark - Property Methods
+
+- (NSMutableArray *)rows
+{
+ if (!_rows)
+ {
+ _rows = [NSMutableArray array];
+ }
+ return _rows;
+}
+
+@end
@@ -0,0 +1,57 @@
+//
+// DAModularTableView.h
+// DAModularTableView
+//
+// Created by Daniel Amitay on 8/5/12.
+// Copyright (c) 2012 Daniel Amitay. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "DAModularTableSection.h"
+
+@interface DAModularTableView : UITableView
+
+@property (nonatomic, strong) NSMutableArray *sections;
+
+#pragma mark - Accessing Rows, Sections, Cells and Index Paths
+
+- (DAModularTableSection *)sectionAtIndex:(NSInteger)index;
+- (DAModularTableRow *)rowAtIndexPath:(NSIndexPath *)indexPath;
+
+- (UITableViewCell *)cellForRow:(DAModularTableRow *)row;
+- (NSIndexPath *)indexPathForRow:(DAModularTableRow *)row;
+- (NSInteger)indexForSection:(DAModularTableSection *)section;
+
+- (DAModularTableRow *)rowForCell:(UITableViewCell *)cell;
+
+#pragma mark - Inserting, Removing, Reloading Sections
+
+- (void)insertSection:(DAModularTableSection *)section;
+- (void)insertSection:(DAModularTableSection *)section
+ animated:(BOOL)animated;
+- (void)insertSection:(DAModularTableSection *)section
+ atIndex:(NSInteger)index
+ animated:(BOOL)animated;
+
+- (void)removeSection:(DAModularTableSection *)section
+ animated:(BOOL)animated;
+
+- (void)reloadSection:(DAModularTableSection *)section
+ animated:(BOOL)animated;
+
+#pragma mark - Inserting, Removing, Reloading Rows
+
+- (void)insertRow:(DAModularTableRow *)row;
+- (void)insertRow:(DAModularTableRow *)row
+ animated:(BOOL)animated;
+- (void)insertRow:(DAModularTableRow *)row
+ atIndexPath:(NSIndexPath *)indexPath
+ animated:(BOOL)animated;
+
+- (void)removeRow:(DAModularTableRow *)row
+ animated:(BOOL)animated;
+
+- (void)reloadRow:(DAModularTableRow *)row
+ animated:(BOOL)animated;
+
+@end
Oops, something went wrong.

0 comments on commit 42b883e

Please sign in to comment.