Merge pull request #570 from Nixsm/master

Removing deprecated flatMap
This commit is contained in:
Martin Barreto 2018-04-10 14:22:33 -03:00 committed by GitHub
commit 2351f06987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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
}