2016-11-23 20:42:52 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< title > Migration Reference< / title >
< link rel = "stylesheet" type = "text/css" href = "css/jazzy.css" / >
< link rel = "stylesheet" type = "text/css" href = "css/highlight.css" / >
< meta charset = 'utf-8' >
< script src = "js/jquery.min.js" defer > < / script >
< script src = "js/jazzy.js" defer > < / script >
< / head >
< body >
< a title = "Migration Reference" > < / a >
< header >
< div class = "content-wrapper" >
< p > < a href = "index.html" > IGListKit Docs< / a > (100% documented)< / p >
< p class = "header-right" > < a href = "https://github.com/Instagram/IGListKit" > < img src = "img/gh.png" / > View on GitHub< / a > < / p >
< / div >
< / header >
< div class = "content-wrapper" >
< p id = "breadcrumbs" >
< a href = "index.html" > IGListKit Reference< / a >
< img id = "carat" src = "img/carat.png" / >
Migration Reference
< / p >
< / div >
< div class = "content-wrapper" >
< nav class = "sidebar" >
< ul class = "nav-groups" >
< li class = "nav-group-name" >
< a href = "Guides.html" > Guides< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "getting-started.html" > Getting Started< / a >
< / li >
2016-11-28 00:53:20 +00:00
< li class = "nav-group-task" >
< a href = "iglistdiffable-and-equality.html" > IGListDiffable and Equality< / a >
< / li >
2016-12-27 20:37:57 +00:00
< li class = "nav-group-task" >
< a href = "installation.html" > Installation< / a >
< / li >
2016-11-23 20:42:52 +00:00
< li class = "nav-group-task" >
< a href = "migration.html" > Migration< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
< a href = "Categories.html" > Categories< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "Categories.html#/c:objc(cy)NSNumber@IGListDiffable" > NSNumber(IGListDiffable)< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Categories.html#/c:objc(cy)NSString@IGListDiffable" > NSString(IGListDiffable)< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
< a href = "Classes.html" > Classes< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "Classes/IGListAdapter.html" > IGListAdapter< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes/IGListAdapterUpdater.html" > IGListAdapterUpdater< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes/IGListBatchUpdateData.html" > IGListBatchUpdateData< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes.html#/c:objc(cs)IGListCollectionView" > IGListCollectionView< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes/IGListGridCollectionViewLayout.html" > IGListGridCollectionViewLayout< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes/IGListIndexPathResult.html" > IGListIndexPathResult< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes/IGListIndexSetResult.html" > IGListIndexSetResult< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes/IGListMoveIndex.html" > IGListMoveIndex< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes/IGListMoveIndexPath.html" > IGListMoveIndexPath< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes.html#/c:objc(cs)IGListReloadDataUpdater" > IGListReloadDataUpdater< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes/IGListSectionController.html" > IGListSectionController< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes/IGListSingleSectionController.html" > IGListSingleSectionController< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Classes/IGListStackedSectionController.html" > IGListStackedSectionController< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
< a href = "Constants.html" > Constants< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "Constants.html#/c:@IGListKitVersionNumber" > IGListKitVersionNumber< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Constants.html#/c:@IGListKitVersionString" > IGListKitVersionString< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
< a href = "Enums.html" > Enums< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "Enums/IGListDiffOption.html" > IGListDiffOption< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Enums/IGListExperiment.html" > IGListExperiment< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
< a href = "Protocols.html" > Protocols< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "Protocols/IGListAdapterDataSource.html" > IGListAdapterDataSource< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Protocols/IGListAdapterDelegate.html" > IGListAdapterDelegate< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Protocols/IGListAdapterUpdaterDelegate.html" > IGListAdapterUpdaterDelegate< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Protocols/IGListCollectionContext.html" > IGListCollectionContext< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Protocols/IGListDiffable.html" > IGListDiffable< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Protocols/IGListDisplayDelegate.html" > IGListDisplayDelegate< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Protocols/IGListScrollDelegate.html" > IGListScrollDelegate< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Protocols/IGListSectionType.html" > IGListSectionType< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Protocols/IGListSingleSectionControllerDelegate.html" > IGListSingleSectionControllerDelegate< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Protocols/IGListSupplementaryViewSource.html" > IGListSupplementaryViewSource< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Protocols/IGListUpdatingDelegate.html" > IGListUpdatingDelegate< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Protocols/IGListWorkingRangeDelegate.html" > IGListWorkingRangeDelegate< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
< a href = "Type Definitions.html" > Type Definitions< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListItemUpdateBlock" > IGListItemUpdateBlock< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListObjectTransitionBlock" > IGListObjectTransitionBlock< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListReloadUpdateBlock" > IGListReloadUpdateBlock< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellConfigureBlock" > IGListSingleSectionCellConfigureBlock< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Type Definitions.html#/c:IGListSingleSectionController.h@T@IGListSingleSectionCellSizeBlock" > IGListSingleSectionCellSizeBlock< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Type Definitions.html#/c:IGListAdapter.h@T@IGListUpdaterCompletion" > IGListUpdaterCompletion< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Type Definitions.html#/c:IGListUpdatingDelegate.h@T@IGListUpdatingCompletion" > IGListUpdatingCompletion< / a >
< / li >
< / ul >
< / li >
< li class = "nav-group-name" >
< a href = "Functions.html" > Functions< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
< a href = "Functions.html#/c:@F@IGListDiff" > IGListDiff< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Functions.html#/c:@F@IGListDiffExperiment" > IGListDiffExperiment< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Functions.html#/c:@F@IGListDiffPaths" > IGListDiffPaths< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Functions.html#/c:@F@IGListDiffPathsExperiment" > IGListDiffPathsExperiment< / a >
< / li >
< li class = "nav-group-task" >
< a href = "Functions.html#/c:IGListExperiments.h@F@IGListExperimentEnabled" > IGListExperimentEnabled< / a >
< / li >
< / ul >
< / li >
< / ul >
< / nav >
< article class = "main-content" >
< section >
< section class = "section" >
< a href = '#migration' class = 'anchor' aria-hidden = true > < span class = "header-anchor" > < / span > < / a > < h1 id = 'migration' > Migration< / h1 >
< p > This guide provides details for how to migration between major versions of < code > IGListKit< / code > .< / p >
< a href = '#from-1-x-to-2-x' class = 'anchor' aria-hidden = true > < span class = "header-anchor" > < / span > < / a > < h2 id = 'from-1-x-to-2-x' > From 1.x to 2.x< / h2 >
2016-12-09 19:43:09 +00:00
< p > For details on all changes in IGListKit 2.0.0, please see the < a href = "https://github.com/Instagram/IGListKit/releases/tag/2.0.0" > release notes< / a > .< / p >
2016-12-02 14:47:23 +00:00
< a href = '#iglistdiffable-conformance' class = 'anchor' aria-hidden = true > < span class = "header-anchor" > < / span > < / a > < h3 id = 'iglistdiffable-conformance' > IGListDiffable Conformance< / h3 >
< p > If you relied on the default < code > NSObject< IGListDiffable> < / code > category, you will need to add < code > IGListDiffable< / code > conformance to each of your models. To get things working as they did in 1.0, simply add the following to each of your models:< / p >
2016-12-04 19:15:58 +00:00
< p > < strong > Objective-C< / strong > < / p >
< pre class = "highlight objective_c" > < code > < span class = "cp" > #import < IGListKit/IGListDiffable.h>
< / span >
< span class = "c1" > // Header
< / span > < span class = "k" > @interface< / span > < span class = "nc" > MyModel< / span > < span class = "o" > < < / span > < span class = "n" > IGListDiffable< / span > < span class = "o" > > < / span >
2016-12-02 14:47:23 +00:00
2016-12-04 19:15:58 +00:00
< span class = "c1" > // Implementation
< / span > < span class = "o" > -< / span > < span class = "p" > (< / span > < span class = "n" > id< / span > < span class = "o" > < < / span > < span class = "n" > NSObject< / span > < span class = "o" > > < / span > < span class = "p" > )< / span > < span class = "n" > diffIdentifier< / span > < span class = "p" > {< / span >
< span class = "k" > return< / span > < span class = "n" > self< / span > < span class = "p" > ;< / span >
< span class = "p" > }< / span >
2016-12-02 14:47:23 +00:00
2016-12-04 19:15:58 +00:00
< span class = "o" > -< / span > < span class = "p" > (< / span > < span class = "n" > BOOL< / span > < span class = "p" > )< / span > < span class = "n" > isEqualToDiffableObject< / span > < span class = "o" > :< / span > < span class = "p" > (< / span > < span class = "n" > id< / span > < span class = "o" > < < / span > < span class = "n" > IGListDiffable< / span > < span class = "o" > > < / span > < span class = "p" > )< / span > < span class = "n" > object< / span > < span class = "p" > {< / span >
< span class = "k" > return< / span > < span class = "p" > [< / span > < span class = "n" > self< / span > < span class = "nf" > isEqual< / span > < span class = "p" > :< / span > < span class = "n" > object< / span > < span class = "p" > ];< / span >
< span class = "p" > }< / span >
< / code > < / pre >
2016-12-02 14:47:23 +00:00
2016-12-04 19:15:58 +00:00
< p > < strong > Swift< / strong > < / p >
< pre class = "highlight swift" > < code > < span class = "kd" > import< / span > < span class = "kt" > IGListKit< / span >
2016-12-02 14:47:23 +00:00
2016-12-04 19:15:58 +00:00
< span class = "kd" > extension< / span > < span class = "kt" > MyModel< / span > < span class = "p" > :< / span > < span class = "kt" > IGListDiffable< / span > < span class = "p" > {< / span >
< span class = "kd" > func< / span > < span class = "nf" > diffIdentifier< / span > < span class = "p" > ()< / span > < span class = "o" > -> < / span > < span class = "kt" > NSObjectProtocol< / span > < span class = "p" > {< / span >
< span class = "k" > return< / span > < span class = "k" > self< / span >
< span class = "p" > }< / span >
2016-12-02 14:47:23 +00:00
2016-12-04 19:15:58 +00:00
< span class = "kd" > func< / span > < span class = "nf" > isEqual< / span > < span class = "p" > (< / span > < span class = "n" > toDiffableObject< / span > < span class = "nv" > object< / span > < span class = "p" > :< / span > < span class = "kt" > IGListDiffable< / span > < span class = "p" > ?)< / span > < span class = "o" > -> < / span > < span class = "kt" > Bool< / span > < span class = "p" > {< / span >
< span class = "k" > return< / span > < span class = "nf" > isEqual< / span > < span class = "p" > (< / span > < span class = "n" > object< / span > < span class = "p" > )< / span >
< span class = "p" > }< / span >
< span class = "p" > }< / span >
< / code > < / pre >
2016-12-02 14:47:23 +00:00
< p > However we recommend writing more thorough identity and equality checks. Check out our guide to < a href = "https://instagram.github.io/IGListKit/iglistdiffable-and-equality.html" > IGListDiffable and Equality< / a > for more info.< / p >
2016-11-23 20:42:52 +00:00
< / section >
< / section >
< section id = "footer" >
2017-01-04 18:09:57 +00:00
< p > © 2017 < a class = "link" href = "https://twitter.com/fbOpenSource" target = "_blank" rel = "external" > Instagram< / a > . All rights reserved. (Last updated: 2017-01-04)< / p >
2016-12-08 18:03:33 +00:00
< p > Generated by < a class = "link" href = "https://github.com/realm/jazzy" target = "_blank" rel = "external" > jazzy ♪♫ v0.7.3< / a > , a < a class = "link" href = "http://realm.io" target = "_blank" rel = "external" > Realm< / a > project.< / p >
2016-11-23 20:42:52 +00:00
< / section >
< / article >
< / div >
< / body >
< / div >
< / html >