Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding features

 - Save button to detail view
 - Tapping outside the fields hides the keyboard
  • Loading branch information...
commit 3679cf1a791c2be764e9f824cd525b4e5ad4d4a4 1 parent 2806c9c
Ryan Blunden authored
View
50 Homepwner/Homepwner/DetailViewController.m
@@ -20,11 +20,37 @@ @interface DetailViewController ()
@implementation DetailViewController
+- (id)init {
+ self = [super init];
+ if (self) {
+ // Create a new bar button item that will send done to DetailViewController
+ UIBarButtonItem *bbi = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave
+ target:self action:@selector(finishEditing)];
+ [[self navigationItem] setRightBarButtonItem:bbi];
+ }
+
+ return self;
+}
+
- (void)setItem:(BNRItem *)item {
_item = item;
[[self navigationItem] setTitle:[[self item] itemName]];
}
+- (void)viewWasSingleFingerTapped {
+ //[self findAndResignFirstResponder];
+ [[self view] endEditing:YES];
+
+}
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+ UIGestureRecognizer *singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self
+ action:@selector
+ (viewWasSingleFingerTapped)];
+ [[self view] addGestureRecognizer:singleFingerTap];
+}
+
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
@@ -44,14 +70,32 @@ - (void)viewWillAppear:(BOOL)animated {
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillAppear:animated];
+ [self finishEditing];
+}
- // Clear the first responder
- [[self view] endEditing:YES];
-
+- (void)saveItem {
// Save changes to item
BNRItem *item = [self item];
[item setItemName:[[self nameField] text]];
[item setSerialNumber:[[self serialField] text]];
[item setValueInDollars:[[[self valueField] text] intValue]];
}
+
+- (void)finishEditing {
+ [self saveItem];
+ [[self view] endEditing:YES];
+ [[self navigationController] popToRootViewControllerAnimated:YES];
+}
+
+- (BOOL)findAndResignFirstResponder {
+ if (self.view.isFirstResponder) {
+ [self resignFirstResponder];
+ return YES;
+ }
+ for (UIView *subView in [[self view] subviews]) {
+ if ([subView resignFirstResponder])
+ return YES;
+ }
+ return NO;
+}
@end
View
228 Homepwner/Homepwner/DetailViewController.xib
@@ -40,7 +40,7 @@
<object class="IBUILabel" id="495392417">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 27}, {51, 21}}</string>
+ <string key="NSFrame">{{20, 31}, {51, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="413388111"/>
@@ -72,10 +72,10 @@
<object class="IBUILabel" id="413388111">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 56}, {49, 39}}</string>
+ <string key="NSFrame">{{20, 60}, {49, 39}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="1042163765"/>
+ <reference key="NSNextKeyView" ref="502220831"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -93,10 +93,10 @@
<object class="IBUILabel" id="1042163765">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{22, 102}, {49, 21}}</string>
+ <string key="NSFrame">{{22, 107}, {49, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
+ <reference key="NSNextKeyView" ref="416645607"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -117,6 +117,7 @@
<string key="NSFrame">{{79, 65}, {146, 30}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="1042163765"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -152,6 +153,7 @@
<string key="NSFrame">{{79, 103}, {146, 30}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="832563259"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -167,6 +169,7 @@
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
+ <int key="IBUIKeyboardType">4</int>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<reference key="IBUIFontDescription" ref="209724400"/>
@@ -178,6 +181,7 @@
<string key="NSFrame">{{79, 27}, {223, 30}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="34754621"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -204,6 +208,7 @@
<string key="NSFrame">{{131, 141}, {42, 21}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -328,7 +333,6 @@
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children">
- <reference ref="495392417"/>
<object class="IBNSLayoutConstraint" id="15551498">
<reference key="firstItem" ref="832563259"/>
<int key="firstAttribute">9</int>
@@ -425,37 +429,21 @@
<float key="scoringTypeFloat">24</float>
<int key="contentType">3</int>
</object>
- <object class="IBNSLayoutConstraint" id="334451628">
+ <object class="IBNSLayoutConstraint" id="109182038">
<reference key="firstItem" ref="1042163765"/>
<int key="firstAttribute">3</int>
<int key="relation">0</int>
- <reference key="secondItem" ref="191373211"/>
- <int key="secondAttribute">3</int>
- <float key="multiplier">1</float>
- <object class="IBLayoutConstant" key="constant">
- <double key="value">102</double>
- </object>
- <float key="priority">1000</float>
- <reference key="containingView" ref="191373211"/>
- <int key="scoringType">3</int>
- <float key="scoringTypeFloat">9</float>
- <int key="contentType">3</int>
- </object>
- <object class="IBNSLayoutConstraint" id="47131556">
- <reference key="firstItem" ref="34754621"/>
- <int key="firstAttribute">4</int>
- <int key="relation">0</int>
<reference key="secondItem" ref="413388111"/>
<int key="secondAttribute">4</int>
<float key="multiplier">1</float>
- <object class="IBLayoutConstant" key="constant">
- <double key="value">0.0</double>
+ <object class="IBNSLayoutSymbolicConstant" key="constant">
+ <double key="value">8</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="191373211"/>
<int key="scoringType">6</int>
<float key="scoringTypeFloat">24</float>
- <int key="contentType">2</int>
+ <int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="1047436144">
<reference key="firstItem" ref="34754621"/>
@@ -489,44 +477,28 @@
<float key="scoringTypeFloat">24</float>
<int key="contentType">3</int>
</object>
- <object class="IBNSLayoutConstraint" id="146158607">
- <reference key="firstItem" ref="502220831"/>
- <int key="firstAttribute">5</int>
- <int key="relation">0</int>
- <reference key="secondItem" ref="495392417"/>
- <int key="secondAttribute">6</int>
- <float key="multiplier">1</float>
- <object class="IBNSLayoutSymbolicConstant" key="constant">
- <double key="value">8</double>
- </object>
- <float key="priority">1000</float>
- <reference key="containingView" ref="191373211"/>
- <int key="scoringType">6</int>
- <float key="scoringTypeFloat">24</float>
- <int key="contentType">3</int>
- </object>
- <object class="IBNSLayoutConstraint" id="604438620">
+ <object class="IBNSLayoutConstraint" id="477227682">
<reference key="firstItem" ref="502220831"/>
<int key="firstAttribute">3</int>
<int key="relation">0</int>
- <reference key="secondItem" ref="495392417"/>
+ <reference key="secondItem" ref="191373211"/>
<int key="secondAttribute">3</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
- <double key="value">0.0</double>
+ <double key="value">27</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="191373211"/>
- <int key="scoringType">6</int>
- <float key="scoringTypeFloat">24</float>
- <int key="contentType">2</int>
+ <int key="scoringType">3</int>
+ <float key="scoringTypeFloat">9</float>
+ <int key="contentType">3</int>
</object>
- <object class="IBNSLayoutConstraint" id="109182038">
- <reference key="firstItem" ref="413388111"/>
- <int key="firstAttribute">3</int>
+ <object class="IBNSLayoutConstraint" id="146158607">
+ <reference key="firstItem" ref="502220831"/>
+ <int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="495392417"/>
- <int key="secondAttribute">4</int>
+ <int key="secondAttribute">6</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">8</double>
@@ -553,7 +525,23 @@
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
- <object class="IBNSLayoutConstraint" id="477227682">
+ <object class="IBNSLayoutConstraint" id="597457225">
+ <reference key="firstItem" ref="413388111"/>
+ <int key="firstAttribute">3</int>
+ <int key="relation">0</int>
+ <reference key="secondItem" ref="495392417"/>
+ <int key="secondAttribute">4</int>
+ <float key="multiplier">1</float>
+ <object class="IBNSLayoutSymbolicConstant" key="constant">
+ <double key="value">8</double>
+ </object>
+ <float key="priority">1000</float>
+ <reference key="containingView" ref="191373211"/>
+ <int key="scoringType">6</int>
+ <float key="scoringTypeFloat">24</float>
+ <int key="contentType">3</int>
+ </object>
+ <object class="IBNSLayoutConstraint" id="269331941">
<reference key="firstItem" ref="495392417"/>
<int key="firstAttribute">3</int>
<int key="relation">0</int>
@@ -561,7 +549,7 @@
<int key="secondAttribute">3</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
- <double key="value">27</double>
+ <double key="value">31</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="191373211"/>
@@ -585,12 +573,13 @@
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
- <reference ref="1042163765"/>
<reference ref="502220831"/>
<reference ref="34754621"/>
<reference ref="416645607"/>
- <reference ref="413388111"/>
<reference ref="832563259"/>
+ <reference ref="495392417"/>
+ <reference ref="413388111"/>
+ <reference ref="1042163765"/>
</array>
<reference key="parent" ref="0"/>
</object>
@@ -608,19 +597,30 @@
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="495392417"/>
+ <array class="NSMutableArray" key="children"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="115606387"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="413388111"/>
<array class="NSMutableArray" key="children">
- <object class="IBNSLayoutConstraint" id="90789692">
- <reference key="firstItem" ref="495392417"/>
+ <object class="IBNSLayoutConstraint" id="710268364">
+ <reference key="firstItem" ref="413388111"/>
<int key="firstAttribute">8</int>
<int key="relation">0</int>
<nil key="secondItem"/>
<int key="secondAttribute">0</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
- <double key="value">21</double>
+ <double key="value">39</double>
</object>
<float key="priority">1000</float>
- <reference key="containingView" ref="495392417"/>
+ <reference key="containingView" ref="413388111"/>
<int key="scoringType">3</int>
<float key="scoringTypeFloat">9</float>
<int key="contentType">1</int>
@@ -629,22 +629,6 @@
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">5</int>
- <reference key="object" ref="115606387"/>
- <reference key="parent" ref="191373211"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">8</int>
- <reference key="object" ref="413388111"/>
- <array class="NSMutableArray" key="children"/>
- <reference key="parent" ref="191373211"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">11</int>
- <reference key="object" ref="291395524"/>
- <reference key="parent" ref="191373211"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">14</int>
<reference key="object" ref="1042163765"/>
<reference key="parent" ref="191373211"/>
@@ -701,21 +685,6 @@
<reference key="parent" ref="502220831"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">45</int>
- <reference key="object" ref="334451628"/>
- <reference key="parent" ref="191373211"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">50</int>
- <reference key="object" ref="477227682"/>
- <reference key="parent" ref="191373211"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">53</int>
- <reference key="object" ref="604438620"/>
- <reference key="parent" ref="191373211"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">54</int>
<reference key="object" ref="146158607"/>
<reference key="parent" ref="191373211"/>
@@ -752,26 +721,11 @@
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">65</int>
- <reference key="object" ref="109182038"/>
- <reference key="parent" ref="191373211"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">66</int>
- <reference key="object" ref="90789692"/>
- <reference key="parent" ref="495392417"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">68</int>
<reference key="object" ref="18050981"/>
<reference key="parent" ref="34754621"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">69</int>
- <reference key="object" ref="47131556"/>
- <reference key="parent" ref="191373211"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">70</int>
<reference key="object" ref="812215864"/>
<reference key="parent" ref="191373211"/>
@@ -791,6 +745,36 @@
<reference key="object" ref="15551498"/>
<reference key="parent" ref="191373211"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">81</int>
+ <reference key="object" ref="710268364"/>
+ <reference key="parent" ref="413388111"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">82</int>
+ <reference key="object" ref="269331941"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">83</int>
+ <reference key="object" ref="477227682"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">84</int>
+ <reference key="object" ref="597457225"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">86</int>
+ <reference key="object" ref="291395524"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">88</int>
+ <reference key="object" ref="109182038"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -799,17 +783,16 @@
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <array key="1.IBViewMetadataConstraints">
+ <array class="NSMutableArray" key="1.IBViewMetadataConstraints">
<reference ref="115606387"/>
- <reference ref="477227682"/>
+ <reference ref="269331941"/>
+ <reference ref="597457225"/>
<reference ref="291395524"/>
- <reference ref="109182038"/>
- <reference ref="604438620"/>
<reference ref="146158607"/>
+ <reference ref="477227682"/>
<reference ref="918428249"/>
<reference ref="1047436144"/>
- <reference ref="47131556"/>
- <reference ref="334451628"/>
+ <reference ref="109182038"/>
<reference ref="87027404"/>
<reference ref="584038152"/>
<reference ref="856166807"/>
@@ -817,7 +800,6 @@
<reference ref="431436095"/>
<reference ref="15551498"/>
</array>
- <string key="11.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="14.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<boolean value="NO" key="14.IBViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="24.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -832,14 +814,8 @@
<boolean value="NO" key="30.IBViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="31.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <array key="4.IBViewMetadataConstraints">
- <reference ref="90789692"/>
- </array>
<boolean value="NO" key="4.IBViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
- <string key="45.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="50.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="53.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="54.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="55.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="56.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -848,23 +824,29 @@
<string key="61.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="62.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="63.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="65.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="66.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="68.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="69.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="70.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="71.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<boolean value="NO" key="71.IBViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="72.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="73.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <array key="8.IBViewMetadataConstraints">
+ <reference ref="710268364"/>
+ </array>
<boolean value="NO" key="8.IBViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
+ <string key="81.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="82.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="83.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="84.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="86.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="88.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">80</int>
+ <int key="maxID">88</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
View
38 Homepwner/Homepwner/ItemsViewController.m
@@ -16,8 +16,6 @@ @interface ItemsViewController ()
- (IBAction)addNewItem:(id)sender;
-- (IBAction)toggleEditingMode:(id)sender;
-
@end
@implementation ItemsViewController
@@ -71,42 +69,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}
-- (UIView *)headerView {
- // If we haven't loaded the header view yet
- if (!_headerView) {
- [[NSBundle mainBundle] loadNibNamed:@"HeaderView" owner:self options:nil];
- }
-
- return _headerView;
-}
-
-- (UIView *)tableView:(UITableView *)tv viewForHeaderInSection:(NSInteger)sec {
- return [self headerView];
-}
-
-- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
- // The height of the header view should be determined from the height of the view in the XIB file
- return [[self headerView] bounds].size.height;
-}
-
-- (IBAction)toggleEditingMode:(id)sender {
- // If we are curently in editing mode...
- if ([self isEditing]) {
- // Change text of button to inform user of state
- [sender setTitle:@"Edit" forState:UIControlStateNormal];
-
- // Turn off editing mode
- [self setEditing:NO animated:YES];
- }
- else {
- // Change text of button to inform user of state
- [sender setTitle:@"Done" forState:UIControlStateNormal];
-
- // Enter editing mode
- [self setEditing:YES animated:YES];
- }
-}
-
- (IBAction)addNewItem:(id)sender {
/// Create a new BNRItem and add it to the store
BNRItem *newItem = [[BNRItemStore sharedStore] createItem];
Please sign in to comment.
Something went wrong with that request. Please try again.