[iOS] Deselect site after tapping it

This commit is contained in:
Jonathan Schleifer 2016-10-09 18:47:04 +02:00
parent eaa989c64d
commit 3d0856a7e4
No known key found for this signature in database
GPG key ID: 338C3541DB54E169
2 changed files with 7 additions and 4 deletions

View file

@ -330,7 +330,7 @@
<nil key="textColor"/> <nil key="textColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" highlighted="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="DJv-Ey-Hka"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" highlighted="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Required" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="DJv-Ey-Hka">
<nil key="textColor"/> <nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" returnKeyType="done" secureTextEntry="YES"/> <textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" returnKeyType="done" secureTextEntry="YES"/>

View file

@ -65,17 +65,20 @@ clearNSMutableString(NSMutableString *string)
- (void)viewWillAppear: (BOOL)animated - (void)viewWillAppear: (BOOL)animated
{ {
SiteStorage *siteStorage = self.mainViewController.siteStorage; SiteStorage *siteStorage = self.mainViewController.siteStorage;
NSInteger row = NSIndexPath *indexPath =
self.mainViewController.tableView.indexPathForSelectedRow.row; self.mainViewController.tableView.indexPathForSelectedRow;
[_name release]; [_name release];
_name = [siteStorage.sites[row] retain]; _name = [siteStorage.sites[indexPath.row] retain];
_length = [siteStorage lengthForSite: _name]; _length = [siteStorage lengthForSite: _name];
_legacy = [siteStorage isSiteLegacy: _name]; _legacy = [siteStorage isSiteLegacy: _name];
self.nameField.text = [_name NSObject]; self.nameField.text = [_name NSObject];
self.lengthField.text = [NSString stringWithFormat: @"%zu", _length]; self.lengthField.text = [NSString stringWithFormat: @"%zu", _length];
self.legacySwitch.on = _legacy; self.legacySwitch.on = _legacy;
[self.mainViewController.tableView deselectRowAtIndexPath: indexPath
animated: YES];
} }
- (void)viewDidAppear: (BOOL)animated - (void)viewDidAppear: (BOOL)animated