From 95f96be31d7760c1e83a05a5b097cd9dec9675b5 Mon Sep 17 00:00:00 2001 From: Nixsm Date: Fri, 6 Apr 2018 11:07:34 -0300 Subject: [PATCH] Removing deprecated flatMap --- Sources/ButtonBarPagerTabStripViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/ButtonBarPagerTabStripViewController.swift b/Sources/ButtonBarPagerTabStripViewController.swift index 016fa24..86addf1 100644 --- a/Sources/ButtonBarPagerTabStripViewController.swift +++ b/Sources/ButtonBarPagerTabStripViewController.swift @@ -259,11 +259,11 @@ open class ButtonBarPagerTabStripViewController: PagerTabStripViewController, Pa if reload { let indexPathsToReload = cells.enumerated() - .flatMap { (arg) -> IndexPath? in + .compactMap { (arg) -> IndexPath? in let (index, cell) = arg return cell == nil ? indexPaths[index] : nil } - .flatMap { (indexPath: IndexPath) -> IndexPath? in + .compactMap { (indexPath: IndexPath) -> IndexPath? in return (indexPath.item >= 0 && indexPath.item < buttonBarView.numberOfItems(inSection: indexPath.section)) ? indexPath : nil }