I have a UITableView with 1 cell and when the array loads I just want for the user to see the content of the first 5 rows and blur the rest. So, if there is an array with 20 items, the first 5 need to be visible and the remaining 15 with a blur. With the code below, I'm able to just add a blur to row 5 only, I can't figure this out. Any help is greatly appreciated.
Code Block let visualEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .light)) func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return array.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! CustomTableViewCell cell.cellLbl?.text = array[indexPath.row] if indexPath.row == 5 { visualEffectView.frame = cell.bounds visualEffectView.layer.masksToBounds = true cell.addSubview(visualEffectView) } return cell }