Guest User

Untitled

a guest
Jul 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. func customCell(_ cell: UICollectionViewCell, didPressButton: UIButton, indexPathRow: Int, commentPost: String, commentatorImage: UIImageView, commentatorName: UILabel, comments: UITextView) {
  2. DispatchQueue.main.asyncAfter(deadline: .now() + 2.0, execute: {
  3. self.collectionView.reloadData()
  4. self.postComment(commentatorImage: commentatorImage, commentatorName: commentatorName, comments: comments) })
  5. }
  6.  
  7. override func viewDidLayoutSubviews()
  8. {
  9. super.viewDidLayoutSubviews()
  10. let indexPath = IndexPath(item: 12, section: 0)
  11. self.collectionView.scrollToItem(at: indexPath, at: [.centeredVertically, .centeredHorizontally], animated: true)
  12. }
Add Comment
Please, Sign In to add comment