Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions BVReorderTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ - (void)longPress:(UILongPressGestureRecognizer *)gesture {
CGPoint location = [gesture locationInView:self];
NSIndexPath *indexPath = [self indexPathForRowAtPoint:location];

int sections = [self numberOfSections];
NSInteger sections = [self numberOfSections];
int rows = 0;
for(int i = 0; i < sections; i++) {
for(NSInteger i = 0; i < sections; i++) {
rows += [self numberOfRowsInSection:i];
}

Expand Down Expand Up @@ -220,10 +220,10 @@ - (void)longPress:(UILongPressGestureRecognizer *)gesture {
[UIView animateWithDuration:0.3
animations:^{
CGRect rect = [self rectForRowAtIndexPath:indexPath];
draggingView.transform = CGAffineTransformIdentity;
draggingView.frame = CGRectOffset(draggingView.bounds, rect.origin.x, rect.origin.y);
self.draggingView.transform = CGAffineTransformIdentity;
self.draggingView.frame = CGRectOffset(self.draggingView.bounds, rect.origin.x, rect.origin.y);
} completion:^(BOOL finished) {
[draggingView removeFromSuperview];
[self.draggingView removeFromSuperview];

[self beginUpdates];
[self deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
Expand Down Expand Up @@ -312,4 +312,4 @@ - (void)cancelGesture {
longPress.enabled = YES;
}

@end
@end
58 changes: 53 additions & 5 deletions ReorderTest/ReorderTest.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -21,6 +21,7 @@
4551783F16EA9A4E003F168E /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4551783E16EA9A4E003F168E /* DetailViewController.m */; };
45863AB0170D2EDF00CCA0C2 /* GroupedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 45863AAF170D2EDF00CCA0C2 /* GroupedViewController.m */; };
45A4825D17777DF300071C47 /* BVReorderTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 45A4825C17777DF300071C47 /* BVReorderTableView.m */; };
DC6F44891A8D865A00E84E08 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC6F44881A8D865A00E84E08 /* QuartzCore.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -46,13 +47,15 @@
45863AAF170D2EDF00CCA0C2 /* GroupedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GroupedViewController.m; sourceTree = "<group>"; };
45A4825B17777DF300071C47 /* BVReorderTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BVReorderTableView.h; path = ../../BVReorderTableView.h; sourceTree = "<group>"; };
45A4825C17777DF300071C47 /* BVReorderTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BVReorderTableView.m; path = ../../BVReorderTableView.m; sourceTree = "<group>"; };
DC6F44881A8D865A00E84E08 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
4551781816EA9A4E003F168E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
DC6F44891A8D865A00E84E08 /* QuartzCore.framework in Frameworks */,
4551782016EA9A4E003F168E /* UIKit.framework in Frameworks */,
4551782216EA9A4E003F168E /* Foundation.framework in Frameworks */,
4551782416EA9A4E003F168E /* CoreGraphics.framework in Frameworks */,
Expand Down Expand Up @@ -82,6 +85,7 @@
4551781E16EA9A4E003F168E /* Frameworks */ = {
isa = PBXGroup;
children = (
DC6F44881A8D865A00E84E08 /* QuartzCore.framework */,
4551781F16EA9A4E003F168E /* UIKit.framework */,
4551782116EA9A4E003F168E /* Foundation.framework */,
4551782316EA9A4E003F168E /* CoreGraphics.framework */,
Expand Down Expand Up @@ -148,11 +152,11 @@
4551781216EA9A4E003F168E /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = "Ben Vogelzang";
};
buildConfigurationList = 4551781516EA9A4E003F168E /* Build configuration list for PBXProject "ReorderTest" */;
compatibilityVersion = "Xcode 3.2";
compatibilityVersion = "Xcode 9.3";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
Expand Down Expand Up @@ -226,22 +230,43 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
Expand All @@ -253,15 +278,34 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand All @@ -274,6 +318,8 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ReorderTest/ReorderTest-Prefix.pch";
INFOPLIST_FILE = "ReorderTest/ReorderTest-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.benvogelzang.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -285,6 +331,8 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ReorderTest/ReorderTest-Prefix.pch";
INFOPLIST_FILE = "ReorderTest/ReorderTest-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.benvogelzang.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand Down
4 changes: 2 additions & 2 deletions ReorderTest/ReorderTest/ReorderTest-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.benvogelzang.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</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>
<string>7.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down