UITableView: hide header from empty section

You have to set tableView:heightForHeaderInSection: to 0 for the appropriate sections. This is something which changed fairly recently and got me in a couple places. From UITableViewDelegate it says… Prior to iOS 5.0, table views would automatically resize the heights of headers to 0 for sections where tableView:viewForHeaderInSection: returned a nil view. In iOS 5.0 … Read more

How to change height of grouped UITableView header?

Return CGFLOAT_MIN instead of 0 for your desired section height. Returning 0 causes UITableView to use a default value. This is undocumented behavior. If you return a very small number, you effectively get a zero-height header. Swift 3: func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { if section == 0 { return CGFloat.leastNormalMagnitude … Read more

How to get UITableView from UITableViewCell?

To avoid checking the iOS version, iteratively walk up the superviews from the cell’s view until a UITableView is found: Objective-C id view = [cellInstance superview]; while (view && [view isKindOfClass:[UITableView class]] == NO) { view = [view superview]; } UITableView *tableView = (UITableView *)view; Swift var view = cellInstance.superview while (view != nil && … Read more

SplitView like Facebook app on iPhone

Facebook guys have done brilliant job in the new version of the app. The similar open source code can be found from here – JTRevealSidebarDemo. Please note that as of June 2014, this project has been discontinued, so you’ll probably have better luck with a project from the list below. It reveals technique behind doing … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)