You can achieve the desired effect by adding a view at the top of your UICollectionView or UITableView - it will scroll along with the contents and will be displayed as part of the background.
override func viewDidLoad() { super.viewDidLoad() let topView = UIView(frame: CGRect(x: 0, y: -collectionView!.bounds.height, width: collectionView!.bounds.width, height: collectionView!.bounds.height)) topView.backgroundColor = .blackColor() collectionView!.addSubview(topView) }
source share