2016-09-07 22:37:59 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< title > IGListDiffable Protocol 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 name = "//apple_ref/objc/Protocol/IGListDiffable" class = "dashAnchor" > < / a >
< a title = "IGListDiffable Protocol Reference" > < / a >
< header >
< div class = "content-wrapper" >
2016-11-21 23:36:26 +00:00
< p > < a href = "../index.html" > IGListKit Docs< / a > (100% documented)< / p >
2016-09-07 22:37:59 +00:00
< 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" / >
IGListDiffable Protocol Reference
< / p >
< / div >
< div class = "content-wrapper" >
< nav class = "sidebar" >
< ul class = "nav-groups" >
< li class = "nav-group-name" >
< a href = "../Categories.html" > Categories< / a >
< ul class = "nav-group-tasks" >
< li class = "nav-group-task" >
2016-11-22 07:18:30 +00:00
< 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 >
2016-09-07 22:37:59 +00:00
< / 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" >
2016-11-21 23:36:26 +00:00
< a href = "../Classes.html#/c:objc(cs)IGListCollectionView" > IGListCollectionView< / a >
2016-09-07 22:37:59 +00:00
< / li >
2016-11-22 07:18:30 +00:00
< li class = "nav-group-task" >
< a href = "../Classes/IGListGridCollectionViewLayout.html" > IGListGridCollectionViewLayout< / a >
< / li >
2016-09-07 22:37:59 +00:00
< 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 >
2016-11-21 23:36:26 +00:00
< 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 >
2016-09-07 22:37:59 +00:00
< 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" >
< h1 > IGListDiffable< / h1 >
< div class = "declaration" >
< div class = "language" >
< pre class = "highlight" > < code > < span class = "k" > @protocol< / span > < span class = "nc" > IGListDiffable< / span > < / code > < / pre >
< / div >
< / div >
2016-11-21 23:36:26 +00:00
< p > The < code > IGListDiffable< / code > protocol provides methods needed to compare the identity and equality of two objects.< / p >
2016-09-07 22:37:59 +00:00
< / section >
< section class = "section task-group-section" >
< div class = "task-group" >
< ul >
< li class = "item" >
< div >
< code >
< a name = "/c:objc(pl)IGListDiffable(im)diffIdentifier" > < / a >
< a name = "//apple_ref/objc/Method/-diffIdentifier" class = "dashAnchor" > < / a >
< a class = "token" href = "#/c:objc(pl)IGListDiffable(im)diffIdentifier" > -diffIdentifier< / a >
< / code >
< / div >
< div class = "height-container" >
< div class = "pointer-container" > < / div >
< section class = "section" >
< div class = "pointer" > < / div >
< div class = "abstract" >
< p > Returns a key that uniquely identifies the object.< / p >
2016-11-21 23:36:26 +00:00
< div class = "aside aside-note" >
< p class = "aside-title" > Note< / p >
< p > Two objects may share the same identifier, but are not equal. A common pattern is to use the < code > NSObject< / code >
category for automatic conformance. However this means that objects will be identified on their
2016-09-07 22:37:59 +00:00
pointer value so finding updates becomes impossible.< / p >
2016-11-21 23:36:26 +00:00
< / div >
2016-09-07 22:37:59 +00:00
< div class = "aside aside-warning" >
< p class = "aside-title" > Warning< / p >
2016-11-21 23:36:26 +00:00
< p > This value should never be mutated.< / p >
2016-09-07 22:37:59 +00:00
< / div >
< / div >
< div class = "declaration" >
< h4 > Declaration< / h4 >
< div class = "language" >
< p class = "aside-title" > Objective-C< / p >
< pre class = "highlight" > < code > < span class = "k" > -< / span > < span class = "p" > (< / span > < span class = "n" > nonnull< / 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 > < / code > < / pre >
< / div >
< div class = "language" >
< p class = "aside-title" > Swift< / p >
< pre class = "highlight" > < code > < span class = "kd" > func< / span > < span class = "nf" > diffIdentifier< / span > < span class = "p" > ()< / span > < span class = "o" > -> < / span > < span class = "kt" > NSObjectProtocol< / span > < / code > < / pre >
< / div >
< / div >
< div >
< h4 > Return Value< / h4 >
< p > A key that can be used to uniquely identify the object.< / p >
< / div >
< / section >
< / div >
< / li >
< li class = "item" >
< div >
< code >
2016-11-21 23:36:26 +00:00
< a name = "/c:objc(pl)IGListDiffable(im)isEqualToDiffableObject:" > < / a >
< a name = "//apple_ref/objc/Method/-isEqualToDiffableObject:" class = "dashAnchor" > < / a >
< a class = "token" href = "#/c:objc(pl)IGListDiffable(im)isEqualToDiffableObject:" > -isEqualToDiffableObject:< / a >
2016-09-07 22:37:59 +00:00
< / code >
< / div >
< div class = "height-container" >
< div class = "pointer-container" > < / div >
< section class = "section" >
< div class = "pointer" > < / div >
< div class = "abstract" >
2016-11-21 23:36:26 +00:00
< p > Returns whether the receiver and a given object are equal.< / p >
2016-09-07 22:37:59 +00:00
< / div >
< div class = "declaration" >
< h4 > Declaration< / h4 >
< div class = "language" >
< p class = "aside-title" > Objective-C< / p >
2016-11-21 23:36:26 +00:00
< pre class = "highlight" > < code > < span class = "k" > -< / span > < span class = "p" > (< / span > < span class = "n" > BOOL< / span > < span class = "p" > )< / span > < span class = "nf" > isEqualToDiffableObject< / span > < span class = "p" > :(< / span > < span class = "n" > nullable< / 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 = "nv" > object< / span > < span class = "p" > ;< / span > < / code > < / pre >
2016-09-07 22:37:59 +00:00
< / div >
< div class = "language" >
< p class = "aside-title" > Swift< / p >
2016-11-21 23:36:26 +00:00
< pre class = "highlight" > < code > < 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 > < / code > < / pre >
2016-09-07 22:37:59 +00:00
< / div >
< / div >
< div >
< h4 > Parameters< / h4 >
< table class = "graybox" >
< tbody >
< tr >
< td >
< code >
< em > object< / em >
< / code >
< / td >
< td >
< div >
< p > The object to be compared to the receiver.< / p >
< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
< div >
< h4 > Return Value< / h4 >
2016-11-21 23:36:26 +00:00
< p > < code > YES< / code > if the receiver and object are equal, otherwise < code > NO< / code > .< / p >
2016-09-07 22:37:59 +00:00
< / div >
< / section >
< / div >
< / li >
< / ul >
< / div >
< / section >
< / section >
< section id = "footer" >
2016-11-21 23:36:26 +00:00
< p > © 2016 < a class = "link" href = "https://twitter.com/fbOpenSource" target = "_blank" rel = "external" > Instagram< / a > . All rights reserved. (Last updated: 2016-11-21)< / p >
2016-09-07 22:37:59 +00:00
< p > Generated by < a class = "link" href = "https://github.com/realm/jazzy" target = "_blank" rel = "external" > jazzy ♪♫ v0.7.2< / a > , a < a class = "link" href = "http://realm.io" target = "_blank" rel = "external" > Realm< / a > project.< / p >
< / section >
< / article >
< / div >
< / body >
< / div >
< / html >