This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
func toDouble() -> Double? { | |
var formatter = NSNumberFormatter() | |
let number = formatter.numberFromString(self) | |
if number == nil { | |
return nil | |
} | |
return number.doubleValue | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using the workaround in a UITableViewController: | |
// If UITableViewController, do this in viewDidLoad: | |
// self.clearsSelectionOnViewWillAppear = NO; | |
// Then add: | |
//- (void)viewDidAppear:(BOOL)animated | |
//{ | |
// [super viewDidAppear:animated]; | |
// [self deselectWorkaroundForSelector:_cmd]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// If UITableViewController, otherwise comment out (make sure to name your tableview ivar tableView if so). | |
self.clearsSelectionOnViewWillAppear = NO; | |
} | |
// Use the workaround: | |
- (void)viewDidAppear:(BOOL)animated |