Interface UIDataSourceTranslating

  • All Known Implementing Classes:
    UICollectionView, UITableView

    public interface UIDataSourceTranslating
    For advanced clients with data model centric layouts (i.e. the layout refers to the data source to gather information in order to create UICollectionViewLayoutAttributes) this protocol allows translation between the data source index path into the presentation index path (i.e. layout) state.
    • Method Detail

      • dataSourceIndexPathForPresentationIndexPath

        NSIndexPath dataSourceIndexPathForPresentationIndexPath​(NSIndexPath presentationIndexPath)
        Translate (if needed) a Presentation index path to the Data Source index path. If the item was inserted at the index path, this will return nil. If no effective change took place, will return passed value.
      • dataSourceSectionIndexForPresentationSectionIndex

        long dataSourceSectionIndexForPresentationSectionIndex​(long presentationSectionIndex)
        Translate (if needed) a Presentation section index to its Data Source section index value. If section was inserted and not known the Data Source, this will return NSNotFound. If no effective change took place, will return passed value.
      • performUsingPresentationValues

        void performUsingPresentationValues​(UIDataSourceTranslating.Block_performUsingPresentationValues actionsToTranslate)
        Arguments passed to actions performed inside the scope of this block will be interpreted as values in the presentation state, and the values returned from these actions will also be in the presentation state.
      • presentationIndexPathForDataSourceIndexPath

        NSIndexPath presentationIndexPathForDataSourceIndexPath​(NSIndexPath dataSourceIndexPath)
        Translate (if needed) a Data Source index path to the Presentation index path. If the item was deleted at the index path, this will return nil. If no effective change took place, will return passed value.
      • presentationSectionIndexForDataSourceSectionIndex

        long presentationSectionIndexForDataSourceSectionIndex​(long dataSourceSectionIndex)
        Translate (if needed) a Data Source section index to its Presentation section index value. If section was deleted during a transaction, this will return NSNotFound. If no effective change took place, will return passed value.