mirror of
https://github.com/zhigang1992/HHPanningTableViewCell.git
synced 2026-01-12 17:23:02 +08:00
Initial public release
This commit is contained in:
328
HHPanningTableViewCell.xcodeproj/project.pbxproj
Normal file
328
HHPanningTableViewCell.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,328 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8F150F3715B1559D00EE1B9C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F150F3615B1559D00EE1B9C /* UIKit.framework */; };
|
||||
8F150F3915B1559D00EE1B9C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F150F3815B1559D00EE1B9C /* Foundation.framework */; };
|
||||
8F150F3B15B1559D00EE1B9C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F150F3A15B1559D00EE1B9C /* CoreGraphics.framework */; };
|
||||
8F150F4115B1559D00EE1B9C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8F150F3F15B1559D00EE1B9C /* InfoPlist.strings */; };
|
||||
8F150F4315B1559D00EE1B9C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F150F4215B1559D00EE1B9C /* main.m */; };
|
||||
8F150F4715B1559D00EE1B9C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F150F4615B1559D00EE1B9C /* AppDelegate.m */; };
|
||||
8F150F5615B155D300EE1B9C /* TableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F150F5415B155D300EE1B9C /* TableViewController.m */; };
|
||||
8F150F5715B155D300EE1B9C /* TableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8F150F5515B155D300EE1B9C /* TableViewController.xib */; };
|
||||
8F150F5A15B1586B00EE1B9C /* HHPanningTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F150F5915B1586A00EE1B9C /* HHPanningTableViewCell.m */; };
|
||||
8F3F12BB15B56854002B8762 /* HHInnerShadowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F3F12BA15B56854002B8762 /* HHInnerShadowView.m */; };
|
||||
8F6D1C1D15B3392900706C97 /* HHDirectionPanGestureRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F6D1C1C15B3392900706C97 /* HHDirectionPanGestureRecognizer.m */; };
|
||||
8F92F43F162C5F3B0066B3F8 /* dark_dotted.png in Resources */ = {isa = PBXBuildFile; fileRef = 8F92F43D162C5F3B0066B3F8 /* dark_dotted.png */; };
|
||||
8F92F440162C5F3B0066B3F8 /* dark_dotted@2X.png in Resources */ = {isa = PBXBuildFile; fileRef = 8F92F43E162C5F3B0066B3F8 /* dark_dotted@2X.png */; };
|
||||
8FC0367C15B4477900EE4AFA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8FC0367B15B4477900EE4AFA /* QuartzCore.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
8F150F3215B1559D00EE1B9C /* HHPanningTableViewCell.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HHPanningTableViewCell.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8F150F3615B1559D00EE1B9C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
8F150F3815B1559D00EE1B9C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
8F150F3A15B1559D00EE1B9C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
8F150F3E15B1559D00EE1B9C /* HHPanningTableViewCell-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HHPanningTableViewCell-Info.plist"; sourceTree = "<group>"; };
|
||||
8F150F4015B1559D00EE1B9C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
8F150F4215B1559D00EE1B9C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
8F150F4415B1559D00EE1B9C /* HHPanningTableViewCell-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HHPanningTableViewCell-Prefix.pch"; sourceTree = "<group>"; };
|
||||
8F150F4515B1559D00EE1B9C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = HHPanningTableViewCell/AppDelegate.h; sourceTree = "<group>"; };
|
||||
8F150F4615B1559D00EE1B9C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = HHPanningTableViewCell/AppDelegate.m; sourceTree = "<group>"; };
|
||||
8F150F5315B155D300EE1B9C /* TableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TableViewController.h; path = HHPanningTableViewCell/TableViewController.h; sourceTree = "<group>"; };
|
||||
8F150F5415B155D300EE1B9C /* TableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TableViewController.m; path = HHPanningTableViewCell/TableViewController.m; sourceTree = "<group>"; };
|
||||
8F150F5515B155D300EE1B9C /* TableViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = TableViewController.xib; path = HHPanningTableViewCell/TableViewController.xib; sourceTree = "<group>"; };
|
||||
8F150F5815B1586A00EE1B9C /* HHPanningTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HHPanningTableViewCell.h; sourceTree = "<group>"; };
|
||||
8F150F5915B1586A00EE1B9C /* HHPanningTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HHPanningTableViewCell.m; sourceTree = "<group>"; };
|
||||
8F3F12B915B56854002B8762 /* HHInnerShadowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HHInnerShadowView.h; sourceTree = "<group>"; };
|
||||
8F3F12BA15B56854002B8762 /* HHInnerShadowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HHInnerShadowView.m; sourceTree = "<group>"; };
|
||||
8F6D1C1B15B3392900706C97 /* HHDirectionPanGestureRecognizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HHDirectionPanGestureRecognizer.h; sourceTree = "<group>"; };
|
||||
8F6D1C1C15B3392900706C97 /* HHDirectionPanGestureRecognizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HHDirectionPanGestureRecognizer.m; sourceTree = "<group>"; };
|
||||
8F92F43D162C5F3B0066B3F8 /* dark_dotted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dark_dotted.png; sourceTree = "<group>"; };
|
||||
8F92F43E162C5F3B0066B3F8 /* dark_dotted@2X.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dark_dotted@2X.png"; sourceTree = "<group>"; };
|
||||
8FC0367B15B4477900EE4AFA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8F150F2F15B1559D00EE1B9C /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8F150F3715B1559D00EE1B9C /* UIKit.framework in Frameworks */,
|
||||
8F150F3915B1559D00EE1B9C /* Foundation.framework in Frameworks */,
|
||||
8F150F3B15B1559D00EE1B9C /* CoreGraphics.framework in Frameworks */,
|
||||
8FC0367C15B4477900EE4AFA /* QuartzCore.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
8F150F2715B1559D00EE1B9C = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8FC0367915B438BD00EE4AFA /* Demo */,
|
||||
8F150F3C15B1559D00EE1B9C /* HHPanningTableViewCell */,
|
||||
8FC0367A15B438D100EE4AFA /* Images */,
|
||||
8F150F3515B1559D00EE1B9C /* Frameworks */,
|
||||
8F150F3315B1559D00EE1B9C /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8F150F3315B1559D00EE1B9C /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8F150F3215B1559D00EE1B9C /* HHPanningTableViewCell.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8F150F3515B1559D00EE1B9C /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8FC0367B15B4477900EE4AFA /* QuartzCore.framework */,
|
||||
8F150F3615B1559D00EE1B9C /* UIKit.framework */,
|
||||
8F150F3815B1559D00EE1B9C /* Foundation.framework */,
|
||||
8F150F3A15B1559D00EE1B9C /* CoreGraphics.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8F150F3C15B1559D00EE1B9C /* HHPanningTableViewCell */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8F6D1C1B15B3392900706C97 /* HHDirectionPanGestureRecognizer.h */,
|
||||
8F6D1C1C15B3392900706C97 /* HHDirectionPanGestureRecognizer.m */,
|
||||
8F3F12B915B56854002B8762 /* HHInnerShadowView.h */,
|
||||
8F3F12BA15B56854002B8762 /* HHInnerShadowView.m */,
|
||||
8F150F5815B1586A00EE1B9C /* HHPanningTableViewCell.h */,
|
||||
8F150F5915B1586A00EE1B9C /* HHPanningTableViewCell.m */,
|
||||
);
|
||||
path = HHPanningTableViewCell;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8F150F3D15B1559D00EE1B9C /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8F150F3E15B1559D00EE1B9C /* HHPanningTableViewCell-Info.plist */,
|
||||
8F150F3F15B1559D00EE1B9C /* InfoPlist.strings */,
|
||||
8F150F4215B1559D00EE1B9C /* main.m */,
|
||||
8F150F4415B1559D00EE1B9C /* HHPanningTableViewCell-Prefix.pch */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
path = HHPanningTableViewCell;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8FC0367915B438BD00EE4AFA /* Demo */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8F150F4515B1559D00EE1B9C /* AppDelegate.h */,
|
||||
8F150F4615B1559D00EE1B9C /* AppDelegate.m */,
|
||||
8F150F3D15B1559D00EE1B9C /* Supporting Files */,
|
||||
8F150F5315B155D300EE1B9C /* TableViewController.h */,
|
||||
8F150F5415B155D300EE1B9C /* TableViewController.m */,
|
||||
8F150F5515B155D300EE1B9C /* TableViewController.xib */,
|
||||
);
|
||||
name = Demo;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8FC0367A15B438D100EE4AFA /* Images */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8F92F43D162C5F3B0066B3F8 /* dark_dotted.png */,
|
||||
8F92F43E162C5F3B0066B3F8 /* dark_dotted@2X.png */,
|
||||
);
|
||||
name = Images;
|
||||
path = HHPanningTableViewCell;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8F150F3115B1559D00EE1B9C /* HHPanningTableViewCell */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 8F150F5015B1559D00EE1B9C /* Build configuration list for PBXNativeTarget "HHPanningTableViewCell" */;
|
||||
buildPhases = (
|
||||
8F150F2E15B1559D00EE1B9C /* Sources */,
|
||||
8F150F2F15B1559D00EE1B9C /* Frameworks */,
|
||||
8F150F3015B1559D00EE1B9C /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = HHPanningTableViewCell;
|
||||
productName = HHPanningTableViewCell;
|
||||
productReference = 8F150F3215B1559D00EE1B9C /* HHPanningTableViewCell.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
8F150F2915B1559D00EE1B9C /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
CLASSPREFIX = HH;
|
||||
LastUpgradeCheck = 0440;
|
||||
ORGANIZATIONNAME = "Pierre Bernard";
|
||||
};
|
||||
buildConfigurationList = 8F150F2C15B1559D00EE1B9C /* Build configuration list for PBXProject "HHPanningTableViewCell" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 8F150F2715B1559D00EE1B9C;
|
||||
productRefGroup = 8F150F3315B1559D00EE1B9C /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8F150F3115B1559D00EE1B9C /* HHPanningTableViewCell */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8F150F3015B1559D00EE1B9C /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8F150F4115B1559D00EE1B9C /* InfoPlist.strings in Resources */,
|
||||
8F150F5715B155D300EE1B9C /* TableViewController.xib in Resources */,
|
||||
8F92F43F162C5F3B0066B3F8 /* dark_dotted.png in Resources */,
|
||||
8F92F440162C5F3B0066B3F8 /* dark_dotted@2X.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8F150F2E15B1559D00EE1B9C /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8F150F4315B1559D00EE1B9C /* main.m in Sources */,
|
||||
8F150F4715B1559D00EE1B9C /* AppDelegate.m in Sources */,
|
||||
8F150F5615B155D300EE1B9C /* TableViewController.m in Sources */,
|
||||
8F150F5A15B1586B00EE1B9C /* HHPanningTableViewCell.m in Sources */,
|
||||
8F6D1C1D15B3392900706C97 /* HHDirectionPanGestureRecognizer.m in Sources */,
|
||||
8F3F12BB15B56854002B8762 /* HHInnerShadowView.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
8F150F3F15B1559D00EE1B9C /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
8F150F4015B1559D00EE1B9C /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
8F150F4E15B1559D00EE1B9C /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
|
||||
SDKROOT = iphoneos;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8F150F4F15B1559D00EE1B9C /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
|
||||
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
8F150F5115B1559D00EE1B9C /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "HHPanningTableViewCell/HHPanningTableViewCell-Prefix.pch";
|
||||
INFOPLIST_FILE = "HHPanningTableViewCell/HHPanningTableViewCell-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8F150F5215B1559D00EE1B9C /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "HHPanningTableViewCell/HHPanningTableViewCell-Prefix.pch";
|
||||
INFOPLIST_FILE = "HHPanningTableViewCell/HHPanningTableViewCell-Info.plist";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
8F150F2C15B1559D00EE1B9C /* Build configuration list for PBXProject "HHPanningTableViewCell" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8F150F4E15B1559D00EE1B9C /* Debug */,
|
||||
8F150F4F15B1559D00EE1B9C /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
8F150F5015B1559D00EE1B9C /* Build configuration list for PBXNativeTarget "HHPanningTableViewCell" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8F150F5115B1559D00EE1B9C /* Debug */,
|
||||
8F150F5215B1559D00EE1B9C /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 8F150F2915B1559D00EE1B9C /* Project object */;
|
||||
}
|
||||
40
HHPanningTableViewCell/AppDelegate.h
Normal file
40
HHPanningTableViewCell/AppDelegate.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Pierre Bernard & Houdah Software s.à r.l.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
@class TableViewController;
|
||||
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@property (strong, nonatomic) TableViewController *viewController;
|
||||
|
||||
@end
|
||||
73
HHPanningTableViewCell/AppDelegate.m
Normal file
73
HHPanningTableViewCell/AppDelegate.m
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Pierre Bernard & Houdah Software s.à r.l.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
#import "TableViewController.h"
|
||||
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
// Override point for customization after application launch.
|
||||
self.viewController = [[TableViewController alloc] init];
|
||||
self.window.rootViewController = self.viewController;
|
||||
[self.window makeKeyAndVisible];
|
||||
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
|
||||
19
HHPanningTableViewCell/HHAppDelegate.h
Normal file
19
HHPanningTableViewCell/HHAppDelegate.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// HHAppDelegate.h
|
||||
// HHPanningTableViewCell
|
||||
//
|
||||
// Created by Pierre Bernard on 14/7/12.
|
||||
// Copyright (c) 2012 Pierre Bernard. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class HHTableViewController;
|
||||
|
||||
@interface HHAppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@property (strong, nonatomic) HHTableViewController *viewController;
|
||||
|
||||
@end
|
||||
52
HHPanningTableViewCell/HHAppDelegate.m
Normal file
52
HHPanningTableViewCell/HHAppDelegate.m
Normal file
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// HHAppDelegate.m
|
||||
// HHPanningTableViewCell
|
||||
//
|
||||
// Created by Pierre Bernard on 14/7/12.
|
||||
// Copyright (c) 2012 Pierre Bernard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "HHAppDelegate.h"
|
||||
|
||||
#import "HHTableViewController.h"
|
||||
|
||||
@implementation HHAppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
// Override point for customization after application launch.
|
||||
self.viewController = [[HHTableViewController alloc] initWithNibName:@"HHTableViewController" bundle:nil];
|
||||
self.window.rootViewController = self.viewController;
|
||||
[self.window makeKeyAndVisible];
|
||||
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
|
||||
45
HHPanningTableViewCell/HHDirectionPanGestureRecognizer.h
Normal file
45
HHPanningTableViewCell/HHDirectionPanGestureRecognizer.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Pierre Bernard & Houdah Software s.à r.l.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
typedef enum {
|
||||
HHDirectionPanGestureRecognizerHorizontal = (UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionLeft),
|
||||
HHDirectionPangestureRecognizerVertical = (UISwipeGestureRecognizerDirectionUp | UISwipeGestureRecognizerDirectionDown),
|
||||
} HHDirectionPangestureRecognizerDirection;
|
||||
|
||||
|
||||
@interface HHDirectionPanGestureRecognizer : UIPanGestureRecognizer
|
||||
{
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) HHDirectionPangestureRecognizerDirection direction;
|
||||
@property (nonatomic, assign, readonly) BOOL panRecognized;
|
||||
|
||||
@end
|
||||
109
HHPanningTableViewCell/HHDirectionPanGestureRecognizer.m
Normal file
109
HHPanningTableViewCell/HHDirectionPanGestureRecognizer.m
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Pierre Bernard & Houdah Software s.à r.l.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#import "HHDirectionPanGestureRecognizer.h"
|
||||
|
||||
#import <UIKit/UIGestureRecognizerSubclass.h>
|
||||
|
||||
|
||||
static CGFloat const kDirectionPanThreshold = 5.0;
|
||||
|
||||
|
||||
@interface HHDirectionPanGestureRecognizer ()
|
||||
|
||||
@property (nonatomic, assign) BOOL panRecognized;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation HHDirectionPanGestureRecognizer
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Initialization
|
||||
|
||||
- (id)initWithTarget:(id)target action:(SEL)action
|
||||
{
|
||||
self = [super initWithTarget:target action:action];
|
||||
|
||||
if (self != nil) {
|
||||
self.direction = HHDirectionPanGestureRecognizerHorizontal;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Accessors
|
||||
|
||||
@synthesize direction = _direction;
|
||||
@synthesize panRecognized = _panRecognized;
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Instance methods
|
||||
|
||||
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
[super touchesMoved:touches withEvent:event];
|
||||
|
||||
if (self.state == UIGestureRecognizerStateFailed) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self.panRecognized) {
|
||||
HHDirectionPangestureRecognizerDirection direction = self.direction;
|
||||
CGPoint translation = [self translationInView:self.view];
|
||||
|
||||
if (fabsf(translation.x) > kDirectionPanThreshold) {
|
||||
if (direction == HHDirectionPangestureRecognizerVertical) {
|
||||
self.state = UIGestureRecognizerStateFailed;
|
||||
}
|
||||
else {
|
||||
self.panRecognized = YES;
|
||||
}
|
||||
}
|
||||
else if (fabsf(translation.y) > kDirectionPanThreshold) {
|
||||
if (direction == HHDirectionPanGestureRecognizerHorizontal) {
|
||||
self.state = UIGestureRecognizerStateFailed;
|
||||
}
|
||||
else {
|
||||
self.panRecognized = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)reset
|
||||
{
|
||||
[super reset];
|
||||
|
||||
self.panRecognized = NO;
|
||||
}
|
||||
|
||||
@end
|
||||
33
HHPanningTableViewCell/HHInnerShadowView.h
Normal file
33
HHPanningTableViewCell/HHInnerShadowView.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Pierre Bernard & Houdah Software s.à r.l.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface HHInnerShadowView : UIView
|
||||
|
||||
@end
|
||||
102
HHPanningTableViewCell/HHInnerShadowView.m
Normal file
102
HHPanningTableViewCell/HHInnerShadowView.m
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Pierre Bernard & Houdah Software s.à r.l.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#import "HHInnerShadowView.h"
|
||||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
|
||||
@interface HHInnerShadowView ()
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation HHInnerShadowView
|
||||
|
||||
- (id)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
// Initialization code
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Accessors
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Drawing
|
||||
|
||||
- (void)drawRect:(CGRect)rect
|
||||
{
|
||||
// http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer
|
||||
|
||||
CGRect bounds = [self bounds];
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
|
||||
// Create the shape of the shadow
|
||||
CGMutablePathRef visiblePath = CGPathCreateMutable();
|
||||
CGPathAddRect(visiblePath, NULL, bounds);
|
||||
|
||||
[[UIColor clearColor] setFill];
|
||||
|
||||
CGContextAddPath(context, visiblePath);
|
||||
CGContextFillPath(context);
|
||||
|
||||
// Now create a larger rectangle, which we're going to subtract the visible path from and apply a shadow
|
||||
CGMutablePathRef path = CGPathCreateMutable();
|
||||
CGPathAddRect(path, NULL, CGRectInset(bounds, -10.0, -10.0));
|
||||
|
||||
// Add the visible path (so that it gets subtracted for the shadow)
|
||||
CGPathAddPath(path, NULL, visiblePath);
|
||||
CGPathCloseSubpath(path);
|
||||
|
||||
// Add the visible paths as the clipping path to the context
|
||||
CGContextAddPath(context, visiblePath);
|
||||
CGContextClip(context);
|
||||
|
||||
// Now setup the shadow properties on the context
|
||||
CGContextSaveGState(context);
|
||||
CGContextSetShadowWithColor(context, CGSizeMake(0.0f, 1.0f), 10.0f, [[UIColor blackColor] CGColor]);
|
||||
|
||||
// Now fill the rectangle, so the shadow gets drawn
|
||||
[[UIColor blackColor] setFill];
|
||||
|
||||
CGContextSaveGState(context);
|
||||
CGContextAddPath(context, path);
|
||||
CGContextEOFillPath(context);
|
||||
|
||||
// Release the paths
|
||||
CGPathRelease(path);
|
||||
CGPathRelease(visiblePath);
|
||||
}
|
||||
|
||||
@end
|
||||
38
HHPanningTableViewCell/HHPanningTableViewCell-Info.plist
Normal file
38
HHPanningTableViewCell/HHPanningTableViewCell-Info.plist
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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>com.houdah.${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>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
14
HHPanningTableViewCell/HHPanningTableViewCell-Prefix.pch
Normal file
14
HHPanningTableViewCell/HHPanningTableViewCell-Prefix.pch
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'HHPanningTableViewCell' target in the 'HHPanningTableViewCell' project
|
||||
//
|
||||
|
||||
#import <Availability.h>
|
||||
|
||||
#ifndef __IPHONE_4_0
|
||||
#warning "This project uses features only available in iOS SDK 4.0 and later."
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
51
HHPanningTableViewCell/HHPanningTableViewCell.h
Normal file
51
HHPanningTableViewCell/HHPanningTableViewCell.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Pierre Bernard & Houdah Software s.à r.l.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
typedef enum {
|
||||
HHPanningTableViewCellDirectionRight = UISwipeGestureRecognizerDirectionRight,
|
||||
HHPanningTableViewCellDirectionLeft = UISwipeGestureRecognizerDirectionLeft,
|
||||
} HHPanningTableViewCellDirection;
|
||||
|
||||
|
||||
@interface HHPanningTableViewCell : UITableViewCell
|
||||
|
||||
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier;
|
||||
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UIView* drawerView;
|
||||
|
||||
@property (nonatomic, assign) NSInteger directionMask;
|
||||
@property (nonatomic, assign) BOOL shouldBounce;
|
||||
|
||||
- (BOOL)isDrawerRevealed;
|
||||
- (void)setDrawerRevealed:(BOOL)revealed animated:(BOOL)animated;
|
||||
|
||||
@end
|
||||
588
HHPanningTableViewCell/HHPanningTableViewCell.m
Normal file
588
HHPanningTableViewCell/HHPanningTableViewCell.m
Normal file
@@ -0,0 +1,588 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Pierre Bernard & Houdah Software s.à r.l.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#import "HHPanningTableViewCell.h"
|
||||
|
||||
#import "HHDirectionPanGestureRecognizer.h"
|
||||
#import "HHInnerShadowView.h"
|
||||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#import <objc/runtime.h>
|
||||
|
||||
|
||||
#define HH_PANNING_ANIMATION_DURATION 0.1f
|
||||
#define HH_PANNING_BOUNCE_DISTANCE 20.0f
|
||||
#define HH_PANNING_MINIMUM_PAN 50.0f
|
||||
#define HH_PANNING_TRIGGER_OFFSET 100.0f
|
||||
|
||||
|
||||
@interface HHPanningTableViewCell () <UIGestureRecognizerDelegate>
|
||||
|
||||
@property (nonatomic, assign, getter = isDrawerRevealed) BOOL drawerRevealed;
|
||||
@property (nonatomic, assign, getter = isAnimationInProgress) BOOL animationInProgress;
|
||||
|
||||
@property (nonatomic, strong) UIView* containerView;
|
||||
@property (nonatomic, strong) UIView* shadowView;
|
||||
@property (nonatomic, strong) UIPanGestureRecognizer* panGestureRecognizer;
|
||||
@property (nonatomic, assign) CGFloat panOriginX;
|
||||
@property (nonatomic, assign, getter = isPanning) BOOL panning;
|
||||
|
||||
- (void)panningTableViewCellInit;
|
||||
|
||||
- (UIView*)createContainerView;
|
||||
- (UIView*)createShadowView;
|
||||
- (UIPanGestureRecognizer*)createPanGesureRecognizer;
|
||||
|
||||
- (void)setDrawerRevealed:(BOOL)revealed direction:(HHPanningTableViewCellDirection)direction animated:(BOOL)animated;
|
||||
|
||||
- (void)updateShadowFrame;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
static NSString * const kDrawerRevealedContext = @"drawerRevealed";
|
||||
static NSString * const kContainerFrameContext = @"containerFrame";
|
||||
|
||||
static HHPanningTableViewCellDirection HHOppositeDirection(HHPanningTableViewCellDirection direction);
|
||||
|
||||
|
||||
@implementation HHPanningTableViewCell
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Initialization
|
||||
|
||||
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
|
||||
if (self != nil) {
|
||||
[self panningTableViewCellInit];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(NSCoder*)coder
|
||||
{
|
||||
self = [super initWithCoder:coder];
|
||||
|
||||
if (self != nil) {
|
||||
[self panningTableViewCellInit];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)panningTableViewCellInit
|
||||
{
|
||||
self.containerView = [self createContainerView];
|
||||
self.shadowView = [self createShadowView];
|
||||
self.panGestureRecognizer = [self createPanGesureRecognizer];
|
||||
|
||||
[self addGestureRecognizer:self.panGestureRecognizer];
|
||||
|
||||
self.directionMask = 0;
|
||||
self.shouldBounce = YES;
|
||||
|
||||
[self addObserver:self forKeyPath:@"drawerRevealed" options:0 context:(__bridge void *)kDrawerRevealedContext];
|
||||
[self addObserver:self forKeyPath:@"containerView.frame" options:0 context:(__bridge void *)kContainerFrameContext];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
if ([super respondsToSelector:@selector(awakeFromNib)]) {
|
||||
[super awakeFromNib];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)prepareForReuse
|
||||
{
|
||||
[super prepareForReuse];
|
||||
|
||||
[self setDrawerRevealed:NO animated:NO];
|
||||
}
|
||||
|
||||
- (UIView*)createContainerView
|
||||
{
|
||||
UIView* containerView = [[UIView alloc] initWithFrame:self.bounds];
|
||||
|
||||
[containerView setOpaque:YES];
|
||||
[containerView setAutoresizesSubviews:YES];
|
||||
[containerView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
|
||||
|
||||
[containerView setBackgroundColor:[UIColor whiteColor]];
|
||||
|
||||
return containerView;
|
||||
}
|
||||
|
||||
- (UIView*)createShadowView
|
||||
{
|
||||
UIView* shadowView = [[HHInnerShadowView alloc] initWithFrame:self.bounds];
|
||||
|
||||
[shadowView setOpaque:NO];
|
||||
[shadowView setUserInteractionEnabled:NO];
|
||||
[shadowView setAutoresizesSubviews:YES];
|
||||
[shadowView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
|
||||
|
||||
return shadowView;
|
||||
}
|
||||
|
||||
- (UIPanGestureRecognizer*)createPanGesureRecognizer
|
||||
{
|
||||
HHDirectionPanGestureRecognizer* gestureRecognizer = [[HHDirectionPanGestureRecognizer alloc] initWithTarget:self
|
||||
action:@selector(gestureRecognizerDidPan:)];
|
||||
|
||||
gestureRecognizer.direction = HHDirectionPanGestureRecognizerHorizontal;
|
||||
gestureRecognizer.delegate = self;
|
||||
|
||||
return gestureRecognizer;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Finalization
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self removeObserver:self forKeyPath:@"drawerRevealed"];
|
||||
[self removeObserver:self forKeyPath:@"containerView.frame"];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Accessors
|
||||
|
||||
@synthesize drawerView = _drawerView;
|
||||
|
||||
@synthesize directionMask = _directionMask;
|
||||
@synthesize shouldBounce = _shouldBounce;
|
||||
|
||||
@synthesize drawerRevealed = _drawerRevealed;
|
||||
@synthesize animationInProgress = _animationInProgress;
|
||||
|
||||
@synthesize containerView = _containerView;
|
||||
@synthesize shadowView = _shadowView;
|
||||
@synthesize panGestureRecognizer = _panGestureRecognizer;
|
||||
|
||||
@synthesize panOriginX = _panOriginX;
|
||||
@synthesize panning = _panning;
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||
{
|
||||
if (context == (__bridge void *)kDrawerRevealedContext) {
|
||||
if (self.drawerRevealed) {
|
||||
UIView* tableView = [self superview];
|
||||
|
||||
if ([tableView isKindOfClass:[UITableView class]]) {
|
||||
for (UITableViewCell *cell in [(UITableView*)tableView visibleCells]) {
|
||||
if ((cell != self) && [cell isKindOfClass:[HHPanningTableViewCell class]]) {
|
||||
[(HHPanningTableViewCell*)cell setDrawerRevealed:NO animated:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (context == (__bridge void *)kContainerFrameContext) {
|
||||
[self updateShadowFrame];
|
||||
}
|
||||
else {
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark API
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
|
||||
{
|
||||
[super setSelected:selected animated:animated];
|
||||
}
|
||||
|
||||
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
|
||||
{
|
||||
if (highlighted && [self isDrawerRevealed]) {
|
||||
return;
|
||||
}
|
||||
|
||||
[super setHighlighted:highlighted animated:animated];
|
||||
}
|
||||
|
||||
- (void)setEditing:(BOOL)editing animated:(BOOL)animated;
|
||||
{
|
||||
if (editing && [self isDrawerRevealed]) {
|
||||
[self setDrawerRevealed:NO animated:NO];
|
||||
}
|
||||
|
||||
[super setEditing:editing animated:animated];
|
||||
}
|
||||
|
||||
- (void)setDrawerRevealed:(BOOL)revealed animated:(BOOL)animated
|
||||
{
|
||||
NSInteger directionMask = self.directionMask;
|
||||
|
||||
if (HHPanningTableViewCellDirectionRight & directionMask) {
|
||||
[self setDrawerRevealed:revealed direction:HHPanningTableViewCellDirectionRight animated:animated];
|
||||
}
|
||||
else if (HHPanningTableViewCellDirectionLeft & directionMask) {
|
||||
[self setDrawerRevealed:revealed direction:HHPanningTableViewCellDirectionLeft animated:animated];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setDrawerRevealed:(BOOL)revealed direction:(HHPanningTableViewCellDirection)direction animated:(BOOL)animated
|
||||
{
|
||||
if ([self isEditing] || (self.drawerView == nil)) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.drawerRevealed = revealed;
|
||||
|
||||
UIView *drawerView = self.drawerView;
|
||||
UIView *shadowView = self.shadowView;
|
||||
UIView *containerView = self.containerView;
|
||||
CGRect frame = [containerView frame];
|
||||
|
||||
UIView *cellView = self;
|
||||
CGRect bounds = [cellView bounds];
|
||||
CGFloat duration = animated ? HH_PANNING_ANIMATION_DURATION : 0.0f;
|
||||
|
||||
[cellView addSubview:drawerView];
|
||||
[cellView addSubview:shadowView];
|
||||
[cellView addSubview:containerView];
|
||||
|
||||
if (revealed) {
|
||||
if (direction == HHPanningTableViewCellDirectionRight) {
|
||||
frame.origin.x = bounds.origin.x + bounds.size.width;
|
||||
}
|
||||
else {
|
||||
frame.origin.x = bounds.origin.x - bounds.size.width;
|
||||
}
|
||||
|
||||
self.animationInProgress = YES;
|
||||
|
||||
[UIView animateWithDuration:duration
|
||||
delay:0.0f
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
[containerView setFrame:frame];
|
||||
} completion:^(BOOL finished) {
|
||||
[containerView removeFromSuperview];
|
||||
|
||||
self.animationInProgress = NO;
|
||||
}];
|
||||
}
|
||||
else {
|
||||
frame.origin.x = 0.0;
|
||||
|
||||
BOOL shouldBounce = self.shouldBounce;
|
||||
|
||||
if (shouldBounce) {
|
||||
CGFloat bounceDuration = duration;
|
||||
CGFloat offsetX = containerView.frame.origin.x;
|
||||
CGFloat bounceMultiplier = fminf(fabsf(offsetX / HH_PANNING_TRIGGER_OFFSET), 1.0f);
|
||||
CGFloat bounceDistance = bounceMultiplier * HH_PANNING_BOUNCE_DISTANCE;
|
||||
|
||||
if (offsetX < 0.0f) {
|
||||
bounceDistance *= -1.0;
|
||||
}
|
||||
|
||||
self.animationInProgress = YES;
|
||||
|
||||
[UIView animateWithDuration:duration
|
||||
delay:0.0f
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
[containerView setFrame:frame];
|
||||
} completion:^(BOOL finished) {
|
||||
[UIView animateWithDuration:bounceDuration
|
||||
delay:0.0f
|
||||
options:UIViewAnimationCurveLinear
|
||||
animations:^{
|
||||
[containerView setFrame:CGRectOffset(frame, bounceDistance, 0.0f)];
|
||||
} completion:^(BOOL finished) {
|
||||
[UIView animateWithDuration:bounceDuration
|
||||
delay:0.0f
|
||||
options:UIViewAnimationCurveLinear
|
||||
animations:^{
|
||||
[containerView setFrame:frame];
|
||||
} completion:^(BOOL finished) {
|
||||
[drawerView removeFromSuperview];
|
||||
[shadowView removeFromSuperview];
|
||||
|
||||
self.animationInProgress = NO;
|
||||
}];
|
||||
}];
|
||||
}];
|
||||
}
|
||||
else {
|
||||
self.animationInProgress = YES;
|
||||
|
||||
[UIView animateWithDuration:duration
|
||||
delay:0.0f
|
||||
options:UIViewAnimationOptionCurveEaseOut
|
||||
animations:^{
|
||||
[containerView setFrame:frame];
|
||||
} completion:^(BOOL finished) {
|
||||
[drawerView removeFromSuperview];
|
||||
[shadowView removeFromSuperview];
|
||||
|
||||
self.animationInProgress = NO;
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Gesture recognizer
|
||||
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer shouldReceiveTouch:(UITouch*)touch
|
||||
{
|
||||
BOOL shouldReceiveTouch = (! self.animationInProgress) && (! self.editing) && (self.drawerView != nil);
|
||||
|
||||
return shouldReceiveTouch;
|
||||
}
|
||||
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer*)otherGestureRecognizer
|
||||
{
|
||||
if ([gestureRecognizer isKindOfClass:[HHDirectionPanGestureRecognizer class]]) {
|
||||
HHDirectionPanGestureRecognizer *panGestureRecognizer = (HHDirectionPanGestureRecognizer*)gestureRecognizer;
|
||||
|
||||
return (!panGestureRecognizer.panRecognized);
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)gestureRecognizerDidPan:(UIPanGestureRecognizer*)gestureRecognizer
|
||||
{
|
||||
if (self.animationInProgress) {
|
||||
return;
|
||||
}
|
||||
|
||||
UIGestureRecognizerState state = gestureRecognizer.state;
|
||||
|
||||
if (state == UIGestureRecognizerStateBegan) {
|
||||
UIView *drawerView = self.drawerView;
|
||||
UIView *shadowView = self.shadowView;
|
||||
UIView *containerView = self.containerView;
|
||||
|
||||
[self addSubview:drawerView];
|
||||
[self addSubview:shadowView];
|
||||
[self addSubview:containerView];
|
||||
[self setSelected:NO];
|
||||
|
||||
self.panOriginX = containerView.frame.origin.x;
|
||||
self.panning = NO;
|
||||
}
|
||||
else if (state == UIGestureRecognizerStateChanged) {
|
||||
CGPoint translation = [gestureRecognizer translationInView:self];
|
||||
CGFloat totalPanX = translation.x;
|
||||
|
||||
if (!self.panning) {
|
||||
if (fabsf(totalPanX) <= HH_PANNING_MINIMUM_PAN) {
|
||||
totalPanX = 0.0f;
|
||||
}
|
||||
else {
|
||||
self.panning = YES;
|
||||
}
|
||||
}
|
||||
|
||||
UIView *containerView = self.containerView;
|
||||
CGRect containerViewFrame = [containerView frame];
|
||||
|
||||
containerViewFrame.origin.x = self.panOriginX + totalPanX;
|
||||
|
||||
CGFloat width = self.bounds.size.width;
|
||||
NSInteger directionMask = self.directionMask;
|
||||
CGFloat leftLimit = (directionMask & HHPanningTableViewCellDirectionLeft) ? (-1.0 * width) : 0.0f;
|
||||
CGFloat rightLimit = (directionMask & HHPanningTableViewCellDirectionRight) ? width : 0.0f;
|
||||
|
||||
if (containerViewFrame.origin.x <= leftLimit) {
|
||||
containerViewFrame.origin.x = leftLimit;
|
||||
}
|
||||
else if (containerViewFrame.origin.x >= rightLimit) {
|
||||
containerViewFrame.origin.x = rightLimit;
|
||||
}
|
||||
|
||||
[containerView setFrame:containerViewFrame];
|
||||
}
|
||||
else if ((state == UIGestureRecognizerStateEnded) || (state == UIGestureRecognizerStateCancelled)) {
|
||||
BOOL drawerRevealed = self.drawerRevealed;
|
||||
BOOL drawerWasRevealed = drawerRevealed;
|
||||
|
||||
CGPoint translation = [gestureRecognizer translationInView:self];
|
||||
CGFloat totalPanX = translation.x;
|
||||
CGFloat panOriginX = self.panOriginX;
|
||||
BOOL isOffsetRight = (panOriginX > 0.0);
|
||||
HHPanningTableViewCellDirection panDirection = (totalPanX > 0.0f) ? HHPanningTableViewCellDirectionRight : HHPanningTableViewCellDirectionLeft;
|
||||
HHPanningTableViewCellDirection normalizedPanDirection = drawerRevealed ? HHOppositeDirection(panDirection) : panDirection;
|
||||
NSInteger directionMask = self.directionMask;
|
||||
|
||||
if (drawerRevealed) {
|
||||
directionMask = isOffsetRight ? HHPanningTableViewCellDirectionRight : HHPanningTableViewCellDirectionLeft;
|
||||
}
|
||||
|
||||
if (normalizedPanDirection & directionMask) {
|
||||
CGFloat triggerOffset = HH_PANNING_TRIGGER_OFFSET;
|
||||
|
||||
if (fabsf(totalPanX) > triggerOffset) {
|
||||
drawerRevealed = !drawerRevealed;
|
||||
}
|
||||
else {
|
||||
CGPoint velocity = [gestureRecognizer velocityInView:self];
|
||||
CGFloat velocityX = velocity.x;
|
||||
|
||||
if (fabsf(velocityX) > triggerOffset) {
|
||||
drawerRevealed = !drawerRevealed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HHPanningTableViewCellDirection direction = panDirection;
|
||||
|
||||
if (drawerRevealed == drawerWasRevealed) {
|
||||
direction = isOffsetRight ? HHPanningTableViewCellDirectionRight : HHPanningTableViewCellDirectionLeft;
|
||||
}
|
||||
|
||||
[self setDrawerRevealed:drawerRevealed direction:direction animated:YES];
|
||||
|
||||
self.panning = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
|
||||
UIView* cellView = self;
|
||||
UIView* containerView = self.containerView;
|
||||
UIView* drawerView = self.drawerView;
|
||||
UIView* shadowView = self.shadowView;
|
||||
UIView* backgroundView = self.backgroundView;
|
||||
UIView* contentView = self.contentView;
|
||||
|
||||
if (!self.animationInProgress) {
|
||||
CGRect cellBounds = [cellView bounds];
|
||||
CGRect contentBounds = [contentView bounds];
|
||||
CGRect containerFrame = cellBounds;
|
||||
|
||||
containerFrame.size.height = contentBounds.size.height;
|
||||
|
||||
if (self.drawerRevealed) {
|
||||
CGRect frame = [containerView frame];
|
||||
|
||||
frame.size.height = contentBounds.size.height;
|
||||
frame.size.width = contentBounds.size.width;
|
||||
|
||||
if (frame.origin.x > cellBounds.origin.x) {
|
||||
frame.origin.x = cellBounds.origin.x + cellBounds.size.width;
|
||||
}
|
||||
else {
|
||||
frame.origin.x = cellBounds.origin.x - cellBounds.size.width;
|
||||
}
|
||||
|
||||
[containerView setFrame:frame];
|
||||
|
||||
[containerView addSubview:backgroundView];
|
||||
[containerView addSubview:contentView];
|
||||
|
||||
[self insertSubview:drawerView belowSubview:containerView];
|
||||
[self insertSubview:shadowView aboveSubview:drawerView];
|
||||
}
|
||||
else {
|
||||
[containerView setFrame:containerFrame];
|
||||
[containerView addSubview:backgroundView];
|
||||
[containerView addSubview:contentView];
|
||||
|
||||
[self addSubview:containerView];
|
||||
}
|
||||
}
|
||||
|
||||
// Move other subviews. E.g. drag reorder control
|
||||
for (UIView *subview in [self.subviews reverseObjectEnumerator]) {
|
||||
if (subview == containerView) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (subview == drawerView) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (subview == shadowView) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (subview == backgroundView) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (subview == contentView) {
|
||||
continue;
|
||||
}
|
||||
|
||||
[containerView insertSubview:subview atIndex:0];
|
||||
}
|
||||
|
||||
[drawerView setFrame:contentView.frame];
|
||||
[self updateShadowFrame];
|
||||
}
|
||||
|
||||
- (void)updateShadowFrame
|
||||
{
|
||||
UIView* cellView = self;
|
||||
CGRect cellBounds = [cellView bounds];
|
||||
UIView* containerView = self.containerView;
|
||||
UIView* shadowView = self.shadowView;
|
||||
CGRect containerFrame = [containerView frame];
|
||||
CGRect shadowFrame = containerFrame;
|
||||
|
||||
shadowFrame.size.width *= 2.0;
|
||||
|
||||
if (containerFrame.origin.x < cellBounds.origin.x) {
|
||||
shadowFrame.origin.x = containerFrame.origin.x + containerFrame.size.width;
|
||||
}
|
||||
else {
|
||||
shadowFrame.origin.x = shadowFrame.origin.x - shadowFrame.size.width;
|
||||
}
|
||||
|
||||
[shadowView setFrame:shadowFrame];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
static HHPanningTableViewCellDirection HHOppositeDirection(HHPanningTableViewCellDirection direction)
|
||||
{
|
||||
switch (direction) {
|
||||
case HHPanningTableViewCellDirectionRight:
|
||||
return HHPanningTableViewCellDirectionLeft;
|
||||
case HHPanningTableViewCellDirectionLeft:
|
||||
return HHPanningTableViewCellDirectionRight;
|
||||
}
|
||||
}
|
||||
16
HHPanningTableViewCell/HHTableViewController.h
Normal file
16
HHPanningTableViewCell/HHTableViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// HHTableViewController.h
|
||||
// HHPanningTableViewCell
|
||||
//
|
||||
// Created by Pierre Bernard on 14/7/12.
|
||||
// Copyright (c) 2012 Pierre Bernard. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
@interface HHTableViewController : UITableViewController
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil;
|
||||
|
||||
@end
|
||||
123
HHPanningTableViewCell/HHTableViewController.m
Normal file
123
HHPanningTableViewCell/HHTableViewController.m
Normal file
@@ -0,0 +1,123 @@
|
||||
//
|
||||
// HHTableViewController.m
|
||||
// HHPanningTableViewCell
|
||||
//
|
||||
// Created by Pierre Bernard on 14/7/12.
|
||||
// Copyright (c) 2012 Pierre Bernard. All rights reserved.
|
||||
//
|
||||
|
||||
#import "HHTableViewController.h"
|
||||
|
||||
#import "HHPanningTableViewCell.h"
|
||||
|
||||
|
||||
@interface HHTableViewController ()
|
||||
|
||||
@property (nonatomic, retain) NSArray *rowTitles;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation HHTableViewController
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Initialization
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
|
||||
if (self != nil) {
|
||||
self.rowTitles = [NSArray arrayWithObjects:@"Pan direction: None", @"Pan direction: Right", @"Pan direction: Left", @"Pan direction: Both", nil];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
// Uncomment the following line to preserve selection between presentations.
|
||||
// self.clearsSelectionOnViewWillAppear = NO;
|
||||
|
||||
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
|
||||
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Accessors
|
||||
|
||||
@synthesize rowTitles = _rowTitles;
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Rotation
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
{
|
||||
return (interfaceOrientation == UIInterfaceOrientationPortrait);
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Table view data source
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
// Return the number of sections.
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
// Return the number of rows in the section.
|
||||
return [self.rowTitles count];
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
static NSString *CellIdentifier = @"Cell";
|
||||
HHPanningTableViewCell *cell = (HHPanningTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
||||
|
||||
if (cell == nil) {
|
||||
cell = [[HHPanningTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
|
||||
reuseIdentifier:CellIdentifier];
|
||||
|
||||
UIView *drawerView = [[UIView alloc] initWithFrame:cell.frame];
|
||||
|
||||
drawerView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"dottedPattern.png"]];
|
||||
|
||||
cell.drawerView = drawerView;
|
||||
cell.directionMask = indexPath.row;
|
||||
}
|
||||
|
||||
cell.textLabel.text = [self.rowTitles objectAtIndex:indexPath.row];
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Table view delegate
|
||||
|
||||
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
|
||||
|
||||
if ([cell isKindOfClass:[HHPanningTableViewCell class]]) {
|
||||
HHPanningTableViewCell *panningTableViewCell = (HHPanningTableViewCell*)cell;
|
||||
|
||||
if ([panningTableViewCell isDrawerRevealed]) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
return indexPath;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
146
HHPanningTableViewCell/HHTableViewController.xib
Normal file
146
HHPanningTableViewCell/HHTableViewController.xib
Normal file
@@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1296</int>
|
||||
<string key="IBDocument.SystemVersion">12A269</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2549</string>
|
||||
<string key="IBDocument.AppKitVersion">1187</string>
|
||||
<string key="IBDocument.HIToolboxVersion">624.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">1498</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUITableView</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUITableView" id="873029372">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIBouncesZoom">NO</bool>
|
||||
<int key="IBUISeparatorStyle">1</int>
|
||||
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
|
||||
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
|
||||
<float key="IBUIRowHeight">74</float>
|
||||
<float key="IBUISectionHeaderHeight">22</float>
|
||||
<float key="IBUISectionFooterHeight">22</float>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="873029372"/>
|
||||
</object>
|
||||
<int key="connectionID">5</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">dataSource</string>
|
||||
<reference key="source" ref="873029372"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">6</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="873029372"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">7</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="873029372"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.CustomClassName">HHTableViewController</string>
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="-2.CustomClassName">UIResponder</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">7</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">HHTableViewController</string>
|
||||
<string key="superclassName">UITableViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/HHTableViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<real value="1296" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">1498</string>
|
||||
</data>
|
||||
</archive>
|
||||
36
HHPanningTableViewCell/TableViewController.h
Normal file
36
HHPanningTableViewCell/TableViewController.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Pierre Bernard & Houdah Software s.à r.l.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
@interface TableViewController : UITableViewController
|
||||
|
||||
- (id)init;
|
||||
|
||||
@end
|
||||
145
HHPanningTableViewCell/TableViewController.m
Normal file
145
HHPanningTableViewCell/TableViewController.m
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Pierre Bernard & Houdah Software s.à r.l.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#import "TableViewController.h"
|
||||
|
||||
#import "HHPanningTableViewCell.h"
|
||||
|
||||
|
||||
@interface TableViewController ()
|
||||
|
||||
@property (nonatomic, retain) NSArray *rowTitles;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation TableViewController
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Initialization
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super initWithNibName:@"TableViewController" bundle:nil];
|
||||
|
||||
if (self != nil) {
|
||||
self.rowTitles = [NSArray arrayWithObjects:@"Pan direction: None", @"Pan direction: Right", @"Pan direction: Left", @"Pan direction: Both", nil];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
// Uncomment the following line to preserve selection between presentations.
|
||||
// self.clearsSelectionOnViewWillAppear = NO;
|
||||
|
||||
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
|
||||
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Accessors
|
||||
|
||||
@synthesize rowTitles = _rowTitles;
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Rotation
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Table view data source
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
// Return the number of sections.
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
// Return the number of rows in the section.
|
||||
return [self.rowTitles count];
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
static NSString *CellIdentifier = @"Cell";
|
||||
HHPanningTableViewCell *cell = (HHPanningTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
||||
|
||||
if (cell == nil) {
|
||||
cell = [[HHPanningTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
|
||||
reuseIdentifier:CellIdentifier];
|
||||
|
||||
UIView *drawerView = [[UIView alloc] initWithFrame:cell.frame];
|
||||
|
||||
// dark_dotted.png obtained from http://subtlepatterns.com/dark-dot/
|
||||
// Made by Tsvetelin Nikolov http://dribbble.com/bscsystem
|
||||
drawerView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"dark_dotted"]];
|
||||
|
||||
cell.drawerView = drawerView;
|
||||
cell.directionMask = indexPath.row;
|
||||
}
|
||||
|
||||
cell.textLabel.text = [self.rowTitles objectAtIndex:indexPath.row];
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Table view delegate
|
||||
|
||||
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
|
||||
|
||||
if ([cell isKindOfClass:[HHPanningTableViewCell class]]) {
|
||||
HHPanningTableViewCell *panningTableViewCell = (HHPanningTableViewCell*)cell;
|
||||
|
||||
if ([panningTableViewCell isDrawerRevealed]) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
return indexPath;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
132
HHPanningTableViewCell/TableViewController.xib
Normal file
132
HHPanningTableViewCell/TableViewController.xib
Normal file
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1296</int>
|
||||
<string key="IBDocument.SystemVersion">12A269</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2549</string>
|
||||
<string key="IBDocument.AppKitVersion">1187</string>
|
||||
<string key="IBDocument.HIToolboxVersion">624.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">1498</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUITableView</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUITableView" id="873029372">
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIBouncesZoom">NO</bool>
|
||||
<int key="IBUISeparatorStyle">1</int>
|
||||
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
|
||||
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
|
||||
<float key="IBUIRowHeight">74</float>
|
||||
<float key="IBUISectionHeaderHeight">22</float>
|
||||
<float key="IBUISectionFooterHeight">22</float>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="873029372"/>
|
||||
</object>
|
||||
<int key="connectionID">5</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">dataSource</string>
|
||||
<reference key="source" ref="873029372"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">6</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="873029372"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">7</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="873029372"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.CustomClassName">TableViewController</string>
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="-2.CustomClassName">UIResponder</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">7</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes"/>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<real value="1296" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">1498</string>
|
||||
</data>
|
||||
</archive>
|
||||
BIN
HHPanningTableViewCell/dark_dotted.png
Normal file
BIN
HHPanningTableViewCell/dark_dotted.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 108 B |
BIN
HHPanningTableViewCell/dark_dotted@2X.png
Normal file
BIN
HHPanningTableViewCell/dark_dotted@2X.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
2
HHPanningTableViewCell/en.lproj/InfoPlist.strings
Normal file
2
HHPanningTableViewCell/en.lproj/InfoPlist.strings
Normal file
@@ -0,0 +1,2 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
BIN
HHPanningTableViewCell/innerShadow.png
Normal file
BIN
HHPanningTableViewCell/innerShadow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 586 B |
38
HHPanningTableViewCell/main.m
Normal file
38
HHPanningTableViewCell/main.m
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Pierre Bernard & Houdah Software s.à r.l.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the <organization> nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user