Guest User

Untitled

a guest
Apr 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
  2. guard let cell = collectionView.cellForItem(at: indexPath) as? CustomCell else {return}
  3. cell.label.textColor = .black
  4. indicatorViewLeadingConstraint.constant = (self.view.frame.width / 4) * CGFloat((indexPath.row))
  5. UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 1, options: .curveEaseOut, animations: {
  6. self.customTabBar.layoutIfNeeded()
  7. }, completion: nil)
  8. }
  9.  
  10. func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) {
  11. guard let cell = collectionView.cellForItem(at: indexPath) as? CustomCell else {return}
  12. cell.label.textColor = .lightGray
  13. }
Add Comment
Please, Sign In to add comment