Permalink
Browse files

More TableUIView

  • Loading branch information...
Ryan Blunden
Ryan Blunden committed Jan 15, 2013
1 parent 85dcd17 commit 089d49680637c11a8fb8b40e1af50566e4c90ff5
@@ -11,6 +11,7 @@
41585C21C3D1586569F389DC /* BNRItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 415854AD59503F7C1B76969B /* BNRItem.m */; };
41585C32B261FB9F967064A5 /* BNRItemStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 41585FCF8851023AD2ADAB63 /* BNRItemStore.m */; };
41585D673CF76412A901C41D /* ItemsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 41585C2442C449CD9820748A /* ItemsViewController.m */; };
+ 41585FECDA2C695C0366F23B /* HeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 41585AA16B8AC169D7F7DCCE /* HeaderView.xib */; };
A839FCF816A4CC910048E3BC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A839FCF716A4CC910048E3BC /* UIKit.framework */; };
A839FCFA16A4CC910048E3BC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A839FCF916A4CC910048E3BC /* Foundation.framework */; };
A839FCFC16A4CC910048E3BC /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A839FCFB16A4CC910048E3BC /* CoreGraphics.framework */; };
@@ -28,6 +29,7 @@
415854AD59503F7C1B76969B /* BNRItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BNRItem.m; sourceTree = "<group>"; };
415856DB55574812310903C0 /* BNRItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BNRItem.h; sourceTree = "<group>"; };
4158582136161385D66F6958 /* Constants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Constants.m; sourceTree = "<group>"; };
+ 41585AA16B8AC169D7F7DCCE /* HeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HeaderView.xib; sourceTree = "<group>"; };
41585C2442C449CD9820748A /* ItemsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemsViewController.m; sourceTree = "<group>"; };
41585F67BB6A8E96699EF368 /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = "<group>"; };
41585FCF8851023AD2ADAB63 /* BNRItemStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BNRItemStore.m; sourceTree = "<group>"; };
@@ -101,6 +103,7 @@
415853BE894CF163873B73F4 /* BNRItemStore.h */,
4158582136161385D66F6958 /* Constants.m */,
41585F67BB6A8E96699EF368 /* Constants.h */,
+ 41585AA16B8AC169D7F7DCCE /* HeaderView.xib */,
);
path = Homepwner;
sourceTree = "<group>";
@@ -175,6 +178,7 @@
A839FD0A16A4CC920048E3BC /* Default.png in Resources */,
A839FD0C16A4CC920048E3BC /* Default@2x.png in Resources */,
A839FD0E16A4CC920048E3BC /* Default-568h@2x.png in Resources */,
+ 41585FECDA2C695C0366F23B /* HeaderView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -16,4 +16,8 @@
- (BNRItem *)createItem;
+- (void)removeItem:(BNRItem *)item;
+
+- (void)moveItemAtIndex:(int)from toIndex:(int)to;
+
@end
@@ -47,4 +47,22 @@ - (BNRItem *)createItem {
return p;
}
+- (void)removeItem:(BNRItem *)item {
+ // We don't use "removeObject" here as that the message "isEqual" is sent to each object which the object can override
+ // Using removeObjectIdenticalTo ensures we're removing the same object passed in
+ [_allItems removeObjectIdenticalTo:item];
+}
+
+- (void)moveItemAtIndex:(int)from toIndex:(int)to {
+ if (from == to) {
+ return;
+ }
+
+ // Get item
+ BNRItem *p = [_allItems objectAtIndex:from];
+ [_allItems removeObjectAtIndex:from];
+ [_allItems insertObject:p atIndex:to];
+
+}
+
@end
Oops, something went wrong.

0 comments on commit 089d496

Please sign in to comment.