ios8
Changing text color of datepicker
Still Works, Swift 4 Update datePicker.setValue(UIColor.white, forKeyPath: “textColor”) This works for me. datePicker.setValue(UIColor.whiteColor(), forKeyPath: “textColor”)
swift : Enum constant with type and value
You need to give the enum a type and then set values, in the example below North is set as 100, the rest will be 101, 102 etc, just like in C and Objective-C. enum CompassPoint: Int { case North = 100, South, East, West } let rawNorth = CompassPoint.North.rawValue // => 100 let rawSouth … Read more
How to populate UITableView from the bottom upwards?
To populate UITableView from the bottom: – (void)updateTableContentInset { NSInteger numRows = [self.tableView numberOfRowsInSection:0]; CGFloat contentInsetTop = self.tableView.bounds.size.height; for (NSInteger i = 0; i < numRows; i++) { contentInsetTop -= [self tableView:self.tableView heightForRowAtIndexPath:[NSIndexPath indexPathForItem:i inSection:0]]; if (contentInsetTop <= 0) { contentInsetTop = 0; break; } } self.tableView.contentInset = UIEdgeInsetsMake(contentInsetTop, 0, 0, 0); } To reverse … Read more
UISearchController: show results even when search bar is empty
You can simply implement the UISearchResultsUpdating protocol and set the results controller view to always show in updateSearchResultsForSearchController: func updateSearchResultsForSearchController(searchController: UISearchController) { // Always show the search result controller searchController.searchResultsController?.view.hidden = false // Update your search results data and reload data .. } This works because the method is called even when the search bar … Read more
nil object in iOS8 delegate methods – custom keyboards
Good question. But it seems that UITextInputDelegate is not a protocol that you implement. From Apple Docs titled Lower Level Text-Handling Technologies: When changes occur in the text view due to external reasons—that is, they aren’t caused by calls from the text input system—the UITextInput object should send textWillChange:, textDidChange:, selectionWillChange:, and selectionDidChange: messages to … Read more