Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 972 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scroll UICollectionView to bottom

#11
For **Swift 3** and **multiple sections**


/**

This method scrolls the *UICollectionView* to the last item in the last section

*/

func scrollToLastItem() {

let lastSection = collectionView.numberOfSections - 1

let lastRow = collectionView.numberOfItems(inSection: lastSection)

let indexPath = IndexPath(row: lastRow - 1, section: lastSection)

self.collectionView.scrollToItem(at: indexPath, at: .right, animated: true)

}
Reply

#12
Update for Swift 3

func viewScrollButton() {
let lastItem = collectionView(self.collectionView!, numberOfRowsInSection: 0) - 1
let indexPath: NSIndexPath = NSIndexPath.init(item: lastItem, section: 0)
self.collectionView.scrollToRow(at: indexPath as IndexPath, at: .bottom, animated: false)
}
Reply

#13
**Updated for Swift 3:**

let item = self.collectionView(self.collectionView!, numberOfItemsInSection: 0) - 1
let lastItemIndex = IndexPath(item: item, section: 0)
collectionView?.scrollToItem(at: lastItemIndex, at: UICollectionViewScrollPosition.top, animated: true)
Reply

#14
lstMessages.reloadData()
let item = self.collectionView(lstMessages, numberOfItemsInSection: 0) - 1
let lastItemIndex = NSIndexPath(forItem: item, inSection: 0)
lstMessages.scrollToItemAtIndexPath(lastItemIndex, atScrollPosition: UICollectionViewScrollPosition.Top, animated: false)

Where lstMessages is my collectionView
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through