Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial Commit

  • Loading branch information...
commit 7ced9f6f4eaec2c98dad7292e89dd5ae0aba24e4 1 parent 73a7b25
@pwightman pwightman authored
View
15 .gitignore
@@ -0,0 +1,15 @@
+# Xcode
+build/*
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+*.xcworkspace
+!default.xcworkspace
+xcuserdata
+profile
+*.moved-aside
View
203 MTBlockTableView.xcodeproj/project.pbxproj
@@ -11,11 +11,24 @@
5F25FF3F15D6A87B00662F86 /* MTBlockTableView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5F25FF3E15D6A87B00662F86 /* MTBlockTableView.h */; };
5F25FF4115D6A87B00662F86 /* MTBlockTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F25FF4015D6A87B00662F86 /* MTBlockTableView.m */; };
5F25FF4915D6A87B00662F86 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF4815D6A87B00662F86 /* SenTestingKit.framework */; };
- 5F25FF4B15D6A87B00662F86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF4A15D6A87B00662F86 /* UIKit.framework */; };
5F25FF4C15D6A87B00662F86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF3915D6A87B00662F86 /* Foundation.framework */; };
5F25FF4F15D6A87B00662F86 /* libMTBlockTableView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF3615D6A87B00662F86 /* libMTBlockTableView.a */; };
5F25FF5515D6A87B00662F86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5F25FF5315D6A87B00662F86 /* InfoPlist.strings */; };
5F25FF5815D6A87B00662F86 /* MTBlockTableViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F25FF5715D6A87B00662F86 /* MTBlockTableViewTests.m */; };
+ 5F25FF6215D6AA8900662F86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF6115D6AA8900662F86 /* UIKit.framework */; };
+ 5F25FF6415D6AA9200662F86 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF6315D6AA9200662F86 /* CoreGraphics.framework */; };
+ 5F25FF6515D6AB0B00662F86 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF6315D6AA9200662F86 /* CoreGraphics.framework */; };
+ 5F25FF6615D6AB1000662F86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF6115D6AA8900662F86 /* UIKit.framework */; };
+ 5F25FFBD15DAA71C00662F86 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF6115D6AA8900662F86 /* UIKit.framework */; };
+ 5F25FFBE15DAA71C00662F86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF3915D6A87B00662F86 /* Foundation.framework */; };
+ 5F25FFBF15DAA71C00662F86 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF6315D6AA9200662F86 /* CoreGraphics.framework */; };
+ 5F25FFC515DAA71C00662F86 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5F25FFC315DAA71C00662F86 /* InfoPlist.strings */; };
+ 5F25FFC715DAA71C00662F86 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F25FFC615DAA71C00662F86 /* main.m */; };
+ 5F25FFCB15DAA71C00662F86 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F25FFCA15DAA71C00662F86 /* AppDelegate.m */; };
+ 5F25FFCE15DAA71C00662F86 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5F25FFCC15DAA71C00662F86 /* MainStoryboard_iPhone.storyboard */; };
+ 5F25FFD115DAA71C00662F86 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5F25FFCF15DAA71C00662F86 /* MainStoryboard_iPad.storyboard */; };
+ 5F25FFD415DAA71C00662F86 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F25FFD315DAA71C00662F86 /* ViewController.m */; };
+ 5F25FFDB15DAA8E500662F86 /* libMTBlockTableView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F25FF3615D6A87B00662F86 /* libMTBlockTableView.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -26,6 +39,13 @@
remoteGlobalIDString = 5F25FF3515D6A87B00662F86;
remoteInfo = MTBlockTableView;
};
+ 5F25FFD915DAA8CE00662F86 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 5F25FF2D15D6A87A00662F86 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 5F25FF3515D6A87B00662F86;
+ remoteInfo = MTBlockTableView;
+ };
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -49,11 +69,23 @@
5F25FF4015D6A87B00662F86 /* MTBlockTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MTBlockTableView.m; sourceTree = "<group>"; };
5F25FF4715D6A87B00662F86 /* MTBlockTableViewTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MTBlockTableViewTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
5F25FF4815D6A87B00662F86 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
- 5F25FF4A15D6A87B00662F86 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
5F25FF5215D6A87B00662F86 /* MTBlockTableViewTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MTBlockTableViewTests-Info.plist"; sourceTree = "<group>"; };
5F25FF5415D6A87B00662F86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
5F25FF5615D6A87B00662F86 /* MTBlockTableViewTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTBlockTableViewTests.h; sourceTree = "<group>"; };
5F25FF5715D6A87B00662F86 /* MTBlockTableViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MTBlockTableViewTests.m; sourceTree = "<group>"; };
+ 5F25FF6115D6AA8900662F86 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 5F25FF6315D6AA9200662F86 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 5F25FFBB15DAA71C00662F86 /* MTBlockTableViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MTBlockTableViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 5F25FFC215DAA71C00662F86 /* MTBlockTableViewDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MTBlockTableViewDemo-Info.plist"; sourceTree = "<group>"; };
+ 5F25FFC415DAA71C00662F86 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 5F25FFC615DAA71C00662F86 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 5F25FFC815DAA71C00662F86 /* MTBlockTableViewDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MTBlockTableViewDemo-Prefix.pch"; sourceTree = "<group>"; };
+ 5F25FFC915DAA71C00662F86 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 5F25FFCA15DAA71C00662F86 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ 5F25FFCD15DAA71C00662F86 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = "<group>"; };
+ 5F25FFD015DAA71C00662F86 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
+ 5F25FFD215DAA71C00662F86 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
+ 5F25FFD315DAA71C00662F86 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -61,6 +93,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 5F25FF6415D6AA9200662F86 /* CoreGraphics.framework in Frameworks */,
+ 5F25FF6215D6AA8900662F86 /* UIKit.framework in Frameworks */,
5F25FF3A15D6A87B00662F86 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -69,13 +103,25 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 5F25FF6615D6AB1000662F86 /* UIKit.framework in Frameworks */,
+ 5F25FF6515D6AB0B00662F86 /* CoreGraphics.framework in Frameworks */,
5F25FF4915D6A87B00662F86 /* SenTestingKit.framework in Frameworks */,
- 5F25FF4B15D6A87B00662F86 /* UIKit.framework in Frameworks */,
5F25FF4C15D6A87B00662F86 /* Foundation.framework in Frameworks */,
5F25FF4F15D6A87B00662F86 /* libMTBlockTableView.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 5F25FFB815DAA71C00662F86 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5F25FFDB15DAA8E500662F86 /* libMTBlockTableView.a in Frameworks */,
+ 5F25FFBD15DAA71C00662F86 /* UIKit.framework in Frameworks */,
+ 5F25FFBE15DAA71C00662F86 /* Foundation.framework in Frameworks */,
+ 5F25FFBF15DAA71C00662F86 /* CoreGraphics.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -84,6 +130,7 @@
children = (
5F25FF3B15D6A87B00662F86 /* MTBlockTableView */,
5F25FF5015D6A87B00662F86 /* MTBlockTableViewTests */,
+ 5F25FFC015DAA71C00662F86 /* MTBlockTableViewDemo */,
5F25FF3815D6A87B00662F86 /* Frameworks */,
5F25FF3715D6A87B00662F86 /* Products */,
);
@@ -94,6 +141,7 @@
children = (
5F25FF3615D6A87B00662F86 /* libMTBlockTableView.a */,
5F25FF4715D6A87B00662F86 /* MTBlockTableViewTests.octest */,
+ 5F25FFBB15DAA71C00662F86 /* MTBlockTableViewDemo.app */,
);
name = Products;
sourceTree = "<group>";
@@ -101,9 +149,10 @@
5F25FF3815D6A87B00662F86 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 5F25FF6315D6AA9200662F86 /* CoreGraphics.framework */,
+ 5F25FF6115D6AA8900662F86 /* UIKit.framework */,
5F25FF3915D6A87B00662F86 /* Foundation.framework */,
5F25FF4815D6A87B00662F86 /* SenTestingKit.framework */,
- 5F25FF4A15D6A87B00662F86 /* UIKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -145,6 +194,31 @@
name = "Supporting Files";
sourceTree = "<group>";
};
+ 5F25FFC015DAA71C00662F86 /* MTBlockTableViewDemo */ = {
+ isa = PBXGroup;
+ children = (
+ 5F25FFC915DAA71C00662F86 /* AppDelegate.h */,
+ 5F25FFCA15DAA71C00662F86 /* AppDelegate.m */,
+ 5F25FFCC15DAA71C00662F86 /* MainStoryboard_iPhone.storyboard */,
+ 5F25FFCF15DAA71C00662F86 /* MainStoryboard_iPad.storyboard */,
+ 5F25FFD215DAA71C00662F86 /* ViewController.h */,
+ 5F25FFD315DAA71C00662F86 /* ViewController.m */,
+ 5F25FFC115DAA71C00662F86 /* Supporting Files */,
+ );
+ path = MTBlockTableViewDemo;
+ sourceTree = "<group>";
+ };
+ 5F25FFC115DAA71C00662F86 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 5F25FFC215DAA71C00662F86 /* MTBlockTableViewDemo-Info.plist */,
+ 5F25FFC315DAA71C00662F86 /* InfoPlist.strings */,
+ 5F25FFC615DAA71C00662F86 /* main.m */,
+ 5F25FFC815DAA71C00662F86 /* MTBlockTableViewDemo-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -184,6 +258,24 @@
productReference = 5F25FF4715D6A87B00662F86 /* MTBlockTableViewTests.octest */;
productType = "com.apple.product-type.bundle";
};
+ 5F25FFBA15DAA71C00662F86 /* MTBlockTableViewDemo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 5F25FFD715DAA71C00662F86 /* Build configuration list for PBXNativeTarget "MTBlockTableViewDemo" */;
+ buildPhases = (
+ 5F25FFB715DAA71C00662F86 /* Sources */,
+ 5F25FFB815DAA71C00662F86 /* Frameworks */,
+ 5F25FFB915DAA71C00662F86 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 5F25FFDA15DAA8CE00662F86 /* PBXTargetDependency */,
+ );
+ name = MTBlockTableViewDemo;
+ productName = MTBlockTableViewDemo;
+ productReference = 5F25FFBB15DAA71C00662F86 /* MTBlockTableViewDemo.app */;
+ productType = "com.apple.product-type.application";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -207,6 +299,7 @@
targets = (
5F25FF3515D6A87B00662F86 /* MTBlockTableView */,
5F25FF4615D6A87B00662F86 /* MTBlockTableViewTests */,
+ 5F25FFBA15DAA71C00662F86 /* MTBlockTableViewDemo */,
);
};
/* End PBXProject section */
@@ -220,6 +313,16 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 5F25FFB915DAA71C00662F86 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5F25FFC515DAA71C00662F86 /* InfoPlist.strings in Resources */,
+ 5F25FFCE15DAA71C00662F86 /* MainStoryboard_iPhone.storyboard in Resources */,
+ 5F25FFD115DAA71C00662F86 /* MainStoryboard_iPad.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
@@ -255,6 +358,16 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 5F25FFB715DAA71C00662F86 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5F25FFC715DAA71C00662F86 /* main.m in Sources */,
+ 5F25FFCB15DAA71C00662F86 /* AppDelegate.m in Sources */,
+ 5F25FFD415DAA71C00662F86 /* ViewController.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
@@ -263,6 +376,11 @@
target = 5F25FF3515D6A87B00662F86 /* MTBlockTableView */;
targetProxy = 5F25FF4D15D6A87B00662F86 /* PBXContainerItemProxy */;
};
+ 5F25FFDA15DAA8CE00662F86 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 5F25FF3515D6A87B00662F86 /* MTBlockTableView */;
+ targetProxy = 5F25FFD915DAA8CE00662F86 /* PBXContainerItemProxy */;
+ };
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@@ -274,6 +392,30 @@
name = InfoPlist.strings;
sourceTree = "<group>";
};
+ 5F25FFC315DAA71C00662F86 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 5F25FFC415DAA71C00662F86 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ 5F25FFCC15DAA71C00662F86 /* MainStoryboard_iPhone.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 5F25FFCD15DAA71C00662F86 /* en */,
+ );
+ name = MainStoryboard_iPhone.storyboard;
+ sourceTree = "<group>";
+ };
+ 5F25FFCF15DAA71C00662F86 /* MainStoryboard_iPad.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 5F25FFD015DAA71C00662F86 /* en */,
+ );
+ name = MainStoryboard_iPad.storyboard;
+ sourceTree = "<group>";
+ };
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
@@ -299,6 +441,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ OTHER_LDFLAGS = (
+ "-all_load",
+ "-ObjC",
+ );
SDKROOT = iphoneos;
};
name = Debug;
@@ -318,6 +464,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ OTHER_LDFLAGS = (
+ "-all_load",
+ "-ObjC",
+ );
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
@@ -377,6 +527,41 @@
};
name = Release;
};
+ 5F25FFD515DAA71C00662F86 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "MTBlockTableViewDemo/MTBlockTableViewDemo-Prefix.pch";
+ INFOPLIST_FILE = "MTBlockTableViewDemo/MTBlockTableViewDemo-Info.plist";
+ OTHER_LDFLAGS = (
+ "-all_load",
+ "-ObjC",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ 5F25FFD615DAA71C00662F86 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "MTBlockTableViewDemo/MTBlockTableViewDemo-Prefix.pch";
+ INFOPLIST_FILE = "MTBlockTableViewDemo/MTBlockTableViewDemo-Info.plist";
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ OTHER_LDFLAGS = (
+ "-all_load",
+ "-ObjC",
+ );
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -396,6 +581,7 @@
5F25FF5D15D6A87B00662F86 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
5F25FF5E15D6A87B00662F86 /* Build configuration list for PBXNativeTarget "MTBlockTableViewTests" */ = {
isa = XCConfigurationList;
@@ -404,6 +590,15 @@
5F25FF6015D6A87B00662F86 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 5F25FFD715DAA71C00662F86 /* Build configuration list for PBXNativeTarget "MTBlockTableViewDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5F25FFD515DAA71C00662F86 /* Debug */,
+ 5F25FFD615DAA71C00662F86 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
View
2  MTBlockTableView/MTBlockTableView-Prefix.pch
@@ -4,4 +4,6 @@
#ifdef __OBJC__
#import <Foundation/Foundation.h>
+ #import <UIKit/UIKit.h>
+ #import <CoreGraphics/CoreGraphics.h>
#endif
View
28 MTBlockTableView/MTBlockTableView.h
@@ -1,13 +1,33 @@
//
// MTBlockTableView.h
-// MTBlockTableView
+// MTTableViewController
//
-// Created by Parker Wightman on 8/11/12.
+// Created by Parker Wightman on 8/10/12.
// Copyright (c) 2012 Mysterious Trousers. All rights reserved.
//
-#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
-@interface MTBlockTableView : NSObject
+@interface MTBlockTableView : UITableView <UITableViewDelegate, UITableViewDataSource>
+
+#pragma mark UITableViewDataSource blocks (required)
+
+@property (nonatomic, strong) NSInteger (^numberOfRowsInSectionBlock)(UITableView *tableView, NSInteger section);
+@property (nonatomic, strong) UITableViewCell * (^cellForRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath);
+
+
+
+#pragma mark UITableViewDataSource blocks (optional)
+
+@property (nonatomic, strong) NSInteger (^numberOfSectionsInTableViewBlock)(UITableView *tableView);
+@property (nonatomic, strong) NSString * (^titleForHeaderInSectionBlock)(UITableView *tableView, NSInteger section);
+@property (nonatomic, strong) NSString * (^titleForFooterInSectionBlock)(UITableView *tableView, NSInteger section);
+@property (nonatomic, strong) BOOL (^canEditRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath);
+@property (nonatomic, strong) BOOL (^canMoveRowAtIndexPathBlock)(UITableView *tableView, NSIndexPath *indexPath);
+@property (nonatomic, strong) NSArray * (^sectionIndexTitlesBlock)(UITableView *tableView);
+@property (nonatomic, strong) void (^commitEditingStyleForRowAtIndexPathBlock)(UITableView *tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath *indexPath);
+@property (nonatomic, strong) void (^moveRowAtIndexPathToIndexPathBlock)(UITableView *tableView, NSIndexPath *sourceIndexPath, NSIndexPath *destinationIndexPath);
+@property (nonatomic, strong) NSInteger (^sectionForSectionIndexTitleAtIndex)(UITableView *tableView, NSString *title, NSInteger index);
@end
+
View
121 MTBlockTableView/MTBlockTableView.m
@@ -1,8 +1,8 @@
//
// MTBlockTableView.m
-// MTBlockTableView
+// MTTableViewController
//
-// Created by Parker Wightman on 8/11/12.
+// Created by Parker Wightman on 8/10/12.
// Copyright (c) 2012 Mysterious Trousers. All rights reserved.
//
@@ -10,4 +10,121 @@
@implementation MTBlockTableView
+- (id) initWithFrame:(CGRect)frame {
+ self = [super initWithFrame:frame];
+
+ if (self) {
+ self.delegate = self;
+ self.dataSource = self;
+ }
+
+ return self;
+}
+
+- (void) awakeFromNib {
+ [super awakeFromNib];
+ self.delegate = self;
+ self.dataSource = self;
+}
+
+
+
+
+#pragma mark UITableViewDataSource Methods (required)
+
+
+
+- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ if (_numberOfRowsInSectionBlock) {
+ return _numberOfRowsInSectionBlock(tableView, section);
+ }
+
+ @throw [NSException exceptionWithName:@"Unimplemented Block Method" reason:@"You must assign a block to the numberOfRowInSectionBlock property of MTBlockTableViews" userInfo:@{}];
+}
+
+- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+ if (_cellForRowAtIndexPathBlock) {
+ return _cellForRowAtIndexPathBlock(tableView, indexPath);
+ }
+
+ @throw [NSException exceptionWithName:@"Unimplemented Block Method" reason:@"You must assign a block to the cellForRowAtIndexPathBlock property of MTBlockTableViews" userInfo:@{}];
+
+
+}
+
+
+
+
+#pragma mark UITableViewDataSource Methods (optional)
+
+
+
+- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
+ if (_numberOfSectionsInTableViewBlock) {
+ return _numberOfSectionsInTableViewBlock(tableView);
+ }
+
+ return 1;
+}
+
+- (NSString *) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
+ if (_titleForHeaderInSectionBlock) {
+ return _titleForHeaderInSectionBlock(tableView, section);
+ }
+
+ return nil;
+}
+
+- (NSString *) tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section {
+ if (_titleForFooterInSectionBlock) {
+ return _titleForFooterInSectionBlock(tableView, section);
+ }
+
+ return nil;
+}
+
+- (BOOL) tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
+ if (_canEditRowAtIndexPathBlock) {
+ return _canEditRowAtIndexPathBlock(tableView, indexPath);
+ }
+
+ return NO;
+}
+
+- (BOOL) tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
+ if (_canMoveRowAtIndexPathBlock) {
+ return _canMoveRowAtIndexPathBlock(tableView, indexPath);
+ }
+
+ return NO;
+}
+
+- (NSArray *) sectionIndexTitlesForTableView:(UITableView *)tableView {
+ if (_sectionIndexTitlesBlock) {
+ return _sectionIndexTitlesBlock(tableView);
+ }
+
+ return nil;
+}
+
+- (void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
+ if (_commitEditingStyleForRowAtIndexPathBlock) {
+ _commitEditingStyleForRowAtIndexPathBlock(tableView, editingStyle, indexPath);
+ }
+}
+
+- (void) tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath {
+ if (_moveRowAtIndexPathToIndexPathBlock) {
+ _moveRowAtIndexPathToIndexPathBlock(tableView, sourceIndexPath, destinationIndexPath);
+ }
+}
+
+- (NSInteger) tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
+ if (_sectionForSectionIndexTitleAtIndex) {
+ _sectionForSectionIndexTitleAtIndex(tableView, title, index);
+ }
+
+ return 0;
+}
+
@end
View
15 MTBlockTableViewDemo/AppDelegate.h
@@ -0,0 +1,15 @@
+//
+// AppDelegate.h
+// MTBlockTableViewDemo
+//
+// Created by Parker Wightman on 8/14/12.
+// Copyright (c) 2012 Mysterious Trousers. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
View
46 MTBlockTableViewDemo/AppDelegate.m
@@ -0,0 +1,46 @@
+//
+// AppDelegate.m
+// MTBlockTableViewDemo
+//
+// Created by Parker Wightman on 8/14/12.
+// Copyright (c) 2012 Mysterious Trousers. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ // Override point for customization after application launch.
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+@end
View
49 MTBlockTableViewDemo/MTBlockTableViewDemo-Info.plist
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>mysterioustrousers.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIMainStoryboardFile</key>
+ <string>MainStoryboard_iPhone</string>
+ <key>UIMainStoryboardFile~ipad</key>
+ <string>MainStoryboard_iPad</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
View
14 MTBlockTableViewDemo/MTBlockTableViewDemo-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'MTBlockTableViewDemo' target in the 'MTBlockTableViewDemo' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_5_0
+#warning "This project uses features only available in iOS SDK 5.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
View
16 MTBlockTableViewDemo/ViewController.h
@@ -0,0 +1,16 @@
+//
+// ViewController.h
+// MTBlockTableViewDemo
+//
+// Created by Parker Wightman on 8/14/12.
+// Copyright (c) 2012 Mysterious Trousers. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <MTBlockTableView/MTBlockTableView.h>
+
+@interface ViewController : UIViewController
+
+@property (strong, nonatomic) IBOutlet MTBlockTableView *tableView;
+
+@end
View
51 MTBlockTableViewDemo/ViewController.m
@@ -0,0 +1,51 @@
+//
+// ViewController.m
+// MTBlockTableViewDemo
+//
+// Created by Parker Wightman on 8/14/12.
+// Copyright (c) 2012 Mysterious Trousers. All rights reserved.
+//
+
+#import "ViewController.h"
+#import <MTBlockTableView/MTBlockTableView.h>
+
+@interface ViewController ()
+
+@end
+
+@implementation ViewController
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ [_tableView setNumberOfRowsInSectionBlock:^NSInteger(UITableView *tableView, NSInteger section) {
+ return 10;
+ }];
+
+ [_tableView setCellForRowAtIndexPathBlock:^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) {
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
+
+ cell.textLabel.text = [@(indexPath.row) stringValue];
+
+ return cell;
+ }];
+}
+
+- (void)viewDidUnload
+{
+ [self setTableView:nil];
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
+ return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
+ } else {
+ return YES;
+ }
+}
+
+@end
View
2  MTBlockTableViewDemo/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
27 MTBlockTableViewDemo/en.lproj/MainStoryboard_iPad.storyboard
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.0" toolsVersion="1906" systemVersion="11A511" targetRuntime="iOS.CocoaTouch.iPad" nextObjectID="6" propertyAccessControl="none" initialViewController="2">
+ <dependencies>
+ <development defaultVersion="4200" identifier="xcode"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="902"/>
+ </dependencies>
+ <scenes>
+ <scene sceneID="4">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="3" sceneMemberID="firstResponder"/>
+ <viewController id="2" customClass="ViewController" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="5">
+ <rect key="frame" x="0.0" y="20" width="768" height="1004"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ </viewController>
+ </objects>
+ </scene>
+ </scenes>
+ <simulatedMetricsContainer key="defaultSimulatedMetrics">
+ <simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
+ <simulatedOrientationMetrics key="orientation"/>
+ <simulatedScreenMetrics key="destination"/>
+ </simulatedMetricsContainer>
+</document>
View
59 MTBlockTableViewDemo/en.lproj/MainStoryboard_iPhone.storyboard
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2549" systemVersion="12A269" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="2">
+ <dependencies>
+ <deployment defaultVersion="1296" identifier="iOS"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1498"/>
+ </dependencies>
+ <scenes>
+ <!--View Controller-->
+ <scene sceneID="5">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="4" sceneMemberID="firstResponder"/>
+ <viewController id="2" customClass="ViewController" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="3">
+ <rect key="frame" x="0.0" y="20" width="320" height="460"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <subviews>
+ <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="singleLineEtched" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="BPQ-bp-QgB" customClass="MTBlockTableView">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="460"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
+ <prototypes>
+ <tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="10" reuseIdentifier="Cell" id="GLh-lk-9Ue">
+ <rect key="frame" x="0.0" y="46" width="320" height="46"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+ <rect key="frame" x="10" y="1" width="300" height="43"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+ </view>
+ </tableViewCell>
+ </prototypes>
+ </tableView>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ <connections>
+ <outlet property="tableView" destination="BPQ-bp-QgB" id="wUF-Tp-lT2"/>
+ </connections>
+ </viewController>
+ </objects>
+ </scene>
+ </scenes>
+ <classes>
+ <class className="MTBlockTableView" superclassName="UITableView">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/MTBlockTableView.h"/>
+ </class>
+ <class className="ViewController" superclassName="UIViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/ViewController.h"/>
+ <relationships>
+ <relationship kind="outlet" name="tableView" candidateClass="MTBlockTableView"/>
+ </relationships>
+ </class>
+ </classes>
+ <simulatedMetricsContainer key="defaultSimulatedMetrics">
+ <simulatedStatusBarMetrics key="statusBar"/>
+ <simulatedOrientationMetrics key="orientation"/>
+ <simulatedScreenMetrics key="destination"/>
+ </simulatedMetricsContainer>
+</document>
View
18 MTBlockTableViewDemo/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// MTBlockTableViewDemo
+//
+// Created by Parker Wightman on 8/14/12.
+// Copyright (c) 2012 Mysterious Trousers. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
View
6 MTBlockTableViewTests/MTBlockTableViewTests.h
@@ -6,8 +6,14 @@
// Copyright (c) 2012 Mysterious Trousers. All rights reserved.
//
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+#import <CoreGraphics/CoreGraphics.h>
#import <SenTestingKit/SenTestingKit.h>
+#import "MTBlockTableView.h"
@interface MTBlockTableViewTests : SenTestCase
+@property (nonatomic, strong) MTBlockTableView *tableView;
+
@end
View
116 MTBlockTableViewTests/MTBlockTableViewTests.m
@@ -8,13 +8,15 @@
#import "MTBlockTableViewTests.h"
+
@implementation MTBlockTableViewTests
- (void)setUp
{
[super setUp];
- // Set-up code here.
+ _tableView = [[MTBlockTableView alloc] initWithFrame:CGRectZero];
+
}
- (void)tearDown
@@ -24,9 +26,117 @@ - (void)tearDown
[super tearDown];
}
-- (void)testExample
+- (void)testNumberOfSectionsInTableViewBlock
+{
+ [_tableView setNumberOfSectionsInTableViewBlock:^NSInteger(UITableView *tableView) {
+ return 10;
+ }];
+
+ STAssertEquals([_tableView.dataSource numberOfSectionsInTableView:_tableView], 10, nil);
+}
+
+- (void)testNumberOfRowsInSectionBlock
{
- STFail(@"Unit tests are not implemented yet in MTBlockTableViewTests");
+ [_tableView setNumberOfSectionsInTableViewBlock:^NSInteger(UITableView *tableView) {
+ return 2;
+ }];
+
+ [_tableView setNumberOfRowsInSectionBlock:^NSInteger(UITableView *tableView, NSInteger section) {
+ return (section == 0 ? 2 : 1);
+ }];
+
+ STAssertEquals([_tableView.dataSource tableView:_tableView numberOfRowsInSection:0], 2, nil);
+ STAssertEquals([_tableView.dataSource tableView:_tableView numberOfRowsInSection:1], 1, nil);
+}
+
+- (void)testCellForRowAtIndexPathBlock {
+ UITableViewCell *cell = [[UITableViewCell alloc] initWithFrame:CGRectZero];
+
+ [_tableView setCellForRowAtIndexPathBlock:^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) {
+ if (indexPath.section == 1 && indexPath.row == 2) {
+ return cell;
+ }
+
+ return nil;
+ }];
+
+ STAssertEquals([_tableView.dataSource tableView:_tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:1]], cell, nil);
+}
+
+- (void)testTitleForHeaderInSectionBlock {
+ STAssertEqualObjects([_tableView.dataSource tableView:_tableView titleForHeaderInSection:3], nil, nil);
+
+ NSString *title = @"Foobar";
+
+ [_tableView setTitleForHeaderInSectionBlock:^NSString *(UITableView *tableView, NSInteger section) {
+ if (section == 3) {
+ return title;
+ }
+ return nil;
+ }];
+
+ STAssertEquals([_tableView.dataSource tableView:_tableView titleForHeaderInSection:3], title, nil);
+}
+
+- (void)testTitleForFooterInSectionBlock {
+ STAssertEqualObjects([_tableView.dataSource tableView:_tableView titleForFooterInSection:3], nil, nil);
+
+ NSString *title = @"Foobar";
+
+ [_tableView setTitleForFooterInSectionBlock:^NSString *(UITableView *tableView, NSInteger section) {
+ if (section == 3) {
+ return title;
+ }
+ return nil;
+ }];
+
+ STAssertEquals([_tableView.dataSource tableView:_tableView titleForFooterInSection:3], title, nil);
+}
+
+- (void)testCanEditRowAtIndexPath {
+ STAssertEquals([_tableView.dataSource tableView:_tableView canEditRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:1]], NO, nil);
+
+ [_tableView setCanEditRowAtIndexPathBlock:^BOOL(UITableView *tableView, NSIndexPath *indexPath) {
+ if (indexPath.row == 1 && indexPath.section == 1){
+ return YES;
+ }
+
+ return NO;
+
+ }];
+
+ STAssertEquals([_tableView.dataSource tableView:_tableView canEditRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:1]], YES, nil);
+}
+
+- (void)testCanMoveRowAtIndexPath {
+ STAssertEquals([_tableView.dataSource tableView:_tableView canMoveRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:1]], NO, nil);
+
+ [_tableView setCanMoveRowAtIndexPathBlock:^BOOL(UITableView *tableView, NSIndexPath *indexPath) {
+ if (indexPath.row == 1 && indexPath.section == 1){
+ return YES;
+ }
+
+ return NO;
+
+ }];
+
+ STAssertEquals([_tableView.dataSource tableView:_tableView canMoveRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:1]], YES, nil);
+}
+
+- (void)testSectionIndexTitlesBlock {
+ STAssertEqualObjects([_tableView.dataSource sectionIndexTitlesForTableView:_tableView], nil, nil);
+
+ NSArray *indexes = @[ ];
+
+ [_tableView setSectionIndexTitlesBlock:^NSArray *(UITableView *tableView) {
+ return indexes;
+ }];
+
+ STAssertEqualObjects([_tableView.dataSource sectionIndexTitlesForTableView:_tableView], indexes, nil);
+}
+
+- (void)testCommitEditingStyleForRowAtIndexPathBlock {
+
}
@end
Please sign in to comment.
Something went wrong with that request. Please try again.