How to create custom UITableViewHeader programmatically using autolayout

Check out How to create custom UITableViewHeader programmatically using autolayout by JR. Here is an excerpt:

Create a new UITableViewCell for the header. Add your autolayout contraints. Then use in ViewController.

TrackHeaderCell.h

#import <UIKit/UIKit.h>

@interface TrackHeaderCell : UITableViewCell
@property (strong, nonatomic) UILabel *titleLabel;
@end

TrackHeaderCell.m

#import...

The full article is available here.