Skip to content

Commit

Permalink
Corrects test logic in -verifyConfiguration (no functional change)
Browse files Browse the repository at this point in the history
  • Loading branch information
LavaSlider committed Mar 15, 2014
1 parent 3dc0c97 commit 4e65e71
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
6 changes: 1 addition & 5 deletions UITableView+Reorder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
24794CD018C5F57E004AEB34 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0500;
LastUpgradeCheck = 0510;
ORGANIZATIONNAME = Syntonicity;
TargetAttributes = {
24794CFB18C5F57E004AEB34 = {
Expand Down Expand Up @@ -352,7 +352,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -391,7 +390,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -451,7 +449,6 @@
24794D1118C5F57E004AEB34 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/UITableView+Reorder.app/UITableView+Reorder";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
Expand All @@ -474,7 +471,6 @@
24794D1218C5F57E004AEB34 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/UITableView+Reorder.app/UITableView+Reorder";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
Expand Down
1 change: 1 addition & 0 deletions UITableView+Reorder/UITableView+Reorder.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//
// UITableView+Reorder.h
// Version 1.0.3
//
// Created by David W. Stockton on 3/3/14.
// Copyright (c) 2014 Syntonicity, LLC.
Expand Down
19 changes: 14 additions & 5 deletions UITableView+Reorder/UITableView+Reorder.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//
// UITableView+Reorder.m
// Version 1.0.3
//
// Created by David W. Stockton on 3/3/14.
// Copyright (c) 2014 Syntonicity, LLC.
Expand Down Expand Up @@ -954,13 +955,19 @@ - (void) verifyConfiguration {
}
// If there are different heights, try swapping their locations and make sure heights also swap...
if( indexPathForH0 && indexPathForH1 && h0 != h1 ) {
//NSLog( @"The cell at row %d in section %d has a height of %g and row %d in section %d has a height of %g", indexPathForH0.row, indexPathForH0.section, h0, indexPathForH1.row, indexPathForH1.section, h1 );
DLog( @"Before the faked move, the cell at row %d in section %d has a height of %g and row %d in section %d has a height of %g", indexPathForH0.row, indexPathForH0.section, h0, indexPathForH1.row, indexPathForH1.section, h1 );
self.fromIndexPathOfRowBeingMoved = indexPathForH0;
self.toIndexPathForRowBeingMoved = indexPathForH1;
CGFloat h0X = [self.delegate tableView: self heightForRowAtIndexPath: indexPathForH0];
CGFloat h1X = [self.delegate tableView: self heightForRowAtIndexPath: indexPathForH1];
//NSLog( @"With row swap the cell at row %d in section %d has a height of %g and row %d in section %d has a height of %g", indexPathForH0.row, indexPathForH0.section, h0X, indexPathForH1.row, indexPathForH1.section, h1X );
if( h0 != h1X || h1 != h0X ) {
NSIndexPath *newIndexPathForH1;
if( indexPathForH0.section != indexPathForH1.section ) {
newIndexPathForH1 = [NSIndexPath indexPathForRow: indexPathForH1.row + 1 inSection: indexPathForH1.section];
} else {
newIndexPathForH1 = [NSIndexPath indexPathForRow: indexPathForH1.row - 1 inSection: indexPathForH1.section];
}
CGFloat h0X = [self.delegate tableView: self heightForRowAtIndexPath: indexPathForH1];
CGFloat h1X = [self.delegate tableView: self heightForRowAtIndexPath: newIndexPathForH1];
DLog( @"With row swap the cell at row %d in section %d has a height of %g and row %d in section %d has a height of %g", indexPathForH1.row, indexPathForH1.section, h0X, newIndexPathForH1.row, newIndexPathForH1.section, h1X );
if( h0 != h0X || h1 != h1X ) {
NSLog( @" " );
NSLog( @"*** Warning: indexPath does not appear to be adjusted in tableView delegate method" );
NSLog( @" 'tableView:heightForRowAtIndexPath:'. The index path passed to this" );
Expand All @@ -975,6 +982,8 @@ - (void) verifyConfiguration {
}
self.fromIndexPathOfRowBeingMoved = nil;
self.toIndexPathForRowBeingMoved = nil;
} else {
DLog( @"No cells of different heights found." );
}
} else {
NSLog( @" " );
Expand Down
4 changes: 2 additions & 2 deletions UITableView+ReorderDemo/UITableView+Reorder-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<string>1.0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>309</string>
<string>315</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
Expand Down

0 comments on commit 4e65e71

Please sign in to comment.