├── .gitignore
├── LICENSE
├── ModelingAndBinding-Starter
├── ModelingAndBinding.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
├── ModelingAndBinding.xcworkspace
│ └── contents.xcworkspacedata
├── ModelingAndBinding
│ ├── ActionCell.swift
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── CommentCell.swift
│ ├── ImageCell.swift
│ ├── Info.plist
│ ├── UserCell.swift
│ └── ViewController.swift
├── Podfile
├── Podfile.lock
└── Pods
│ ├── IGListKit
│ ├── LICENSE.md
│ ├── README.md
│ └── Source
│ │ ├── Common
│ │ ├── IGListAssert.h
│ │ ├── IGListBatchUpdateData.h
│ │ ├── IGListBatchUpdateData.mm
│ │ ├── IGListCompatibility.h
│ │ ├── IGListDiff.h
│ │ ├── IGListDiff.mm
│ │ ├── IGListDiffKit.h
│ │ ├── IGListDiffable.h
│ │ ├── IGListExperiments.h
│ │ ├── IGListIndexPathResult.h
│ │ ├── IGListIndexPathResult.m
│ │ ├── IGListIndexSetResult.h
│ │ ├── IGListIndexSetResult.m
│ │ ├── IGListMacros.h
│ │ ├── IGListMoveIndex.h
│ │ ├── IGListMoveIndex.m
│ │ ├── IGListMoveIndexPath.h
│ │ ├── IGListMoveIndexPath.m
│ │ ├── Internal
│ │ │ ├── IGListIndexPathResultInternal.h
│ │ │ ├── IGListIndexSetResultInternal.h
│ │ │ ├── IGListMoveIndexInternal.h
│ │ │ └── IGListMoveIndexPathInternal.h
│ │ ├── NSNumber+IGListDiffable.h
│ │ ├── NSNumber+IGListDiffable.m
│ │ ├── NSString+IGListDiffable.h
│ │ └── NSString+IGListDiffable.m
│ │ ├── IGListAdapter.h
│ │ ├── IGListAdapter.m
│ │ ├── IGListAdapterDataSource.h
│ │ ├── IGListAdapterDelegate.h
│ │ ├── IGListAdapterUpdater.h
│ │ ├── IGListAdapterUpdater.m
│ │ ├── IGListAdapterUpdaterDelegate.h
│ │ ├── IGListBatchContext.h
│ │ ├── IGListBindable.h
│ │ ├── IGListBindingSectionController.h
│ │ ├── IGListBindingSectionController.m
│ │ ├── IGListBindingSectionControllerDataSource.h
│ │ ├── IGListBindingSectionControllerSelectionDelegate.h
│ │ ├── IGListCollectionContext.h
│ │ ├── IGListCollectionViewLayout.h
│ │ ├── IGListCollectionViewLayout.mm
│ │ ├── IGListDisplayDelegate.h
│ │ ├── IGListGenericSectionController.h
│ │ ├── IGListGenericSectionController.m
│ │ ├── IGListKit.h
│ │ ├── IGListReloadDataUpdater.h
│ │ ├── IGListReloadDataUpdater.m
│ │ ├── IGListScrollDelegate.h
│ │ ├── IGListSectionController.h
│ │ ├── IGListSectionController.m
│ │ ├── IGListSingleSectionController.h
│ │ ├── IGListSingleSectionController.m
│ │ ├── IGListStackedSectionController.h
│ │ ├── IGListStackedSectionController.m
│ │ ├── IGListSupplementaryViewSource.h
│ │ ├── IGListUpdatingDelegate.h
│ │ ├── IGListWorkingRangeDelegate.h
│ │ └── Internal
│ │ ├── IGListAdapter+DebugDescription.h
│ │ ├── IGListAdapter+DebugDescription.m
│ │ ├── IGListAdapter+UICollectionView.h
│ │ ├── IGListAdapter+UICollectionView.m
│ │ ├── IGListAdapterInternal.h
│ │ ├── IGListAdapterProxy.h
│ │ ├── IGListAdapterProxy.m
│ │ ├── IGListAdapterUpdater+DebugDescription.h
│ │ ├── IGListAdapterUpdater+DebugDescription.m
│ │ ├── IGListAdapterUpdaterInternal.h
│ │ ├── IGListBatchUpdateData+DebugDescription.h
│ │ ├── IGListBatchUpdateData+DebugDescription.m
│ │ ├── IGListBatchUpdateState.h
│ │ ├── IGListBatchUpdates.h
│ │ ├── IGListBatchUpdates.m
│ │ ├── IGListBindingSectionController+DebugDescription.h
│ │ ├── IGListBindingSectionController+DebugDescription.m
│ │ ├── IGListCollectionViewLayoutInternal.h
│ │ ├── IGListDebugger.h
│ │ ├── IGListDebugger.m
│ │ ├── IGListDebuggingUtilities.h
│ │ ├── IGListDebuggingUtilities.m
│ │ ├── IGListDisplayHandler.h
│ │ ├── IGListDisplayHandler.m
│ │ ├── IGListReloadIndexPath.h
│ │ ├── IGListReloadIndexPath.m
│ │ ├── IGListSectionControllerInternal.h
│ │ ├── IGListSectionMap+DebugDescription.h
│ │ ├── IGListSectionMap+DebugDescription.m
│ │ ├── IGListSectionMap.h
│ │ ├── IGListSectionMap.m
│ │ ├── IGListStackedSectionControllerInternal.h
│ │ ├── IGListWorkingRangeHandler.h
│ │ ├── IGListWorkingRangeHandler.mm
│ │ ├── UICollectionView+DebugDescription.h
│ │ ├── UICollectionView+DebugDescription.m
│ │ ├── UICollectionView+IGListBatchUpdateData.h
│ │ └── UICollectionView+IGListBatchUpdateData.m
│ ├── Local Podspecs
│ └── IGListKit.podspec.json
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ └── project.pbxproj
│ ├── SDWebImage
│ ├── LICENSE
│ ├── README.md
│ └── SDWebImage
│ │ ├── NSData+ImageContentType.h
│ │ ├── NSData+ImageContentType.m
│ │ ├── NSImage+WebCache.h
│ │ ├── NSImage+WebCache.m
│ │ ├── SDImageCache.h
│ │ ├── SDImageCache.m
│ │ ├── SDImageCacheConfig.h
│ │ ├── SDImageCacheConfig.m
│ │ ├── SDWebImageCompat.h
│ │ ├── SDWebImageCompat.m
│ │ ├── SDWebImageDecoder.h
│ │ ├── SDWebImageDecoder.m
│ │ ├── SDWebImageDownloader.h
│ │ ├── SDWebImageDownloader.m
│ │ ├── SDWebImageDownloaderOperation.h
│ │ ├── SDWebImageDownloaderOperation.m
│ │ ├── SDWebImageManager.h
│ │ ├── SDWebImageManager.m
│ │ ├── SDWebImageOperation.h
│ │ ├── SDWebImagePrefetcher.h
│ │ ├── SDWebImagePrefetcher.m
│ │ ├── UIButton+WebCache.h
│ │ ├── UIButton+WebCache.m
│ │ ├── UIImage+GIF.h
│ │ ├── UIImage+GIF.m
│ │ ├── UIImage+MultiFormat.h
│ │ ├── UIImage+MultiFormat.m
│ │ ├── UIImageView+HighlightedWebCache.h
│ │ ├── UIImageView+HighlightedWebCache.m
│ │ ├── UIImageView+WebCache.h
│ │ ├── UIImageView+WebCache.m
│ │ ├── UIView+WebCache.h
│ │ ├── UIView+WebCache.m
│ │ ├── UIView+WebCacheOperation.h
│ │ └── UIView+WebCacheOperation.m
│ └── Target Support Files
│ ├── IGListKit
│ ├── IGListKit-dummy.m
│ ├── IGListKit-prefix.pch
│ ├── IGListKit-umbrella.h
│ ├── IGListKit.modulemap
│ ├── IGListKit.xcconfig
│ └── Info.plist
│ ├── Pods-ModelingAndBinding
│ ├── Info.plist
│ ├── Pods-ModelingAndBinding-acknowledgements.markdown
│ ├── Pods-ModelingAndBinding-acknowledgements.plist
│ ├── Pods-ModelingAndBinding-dummy.m
│ ├── Pods-ModelingAndBinding-frameworks.sh
│ ├── Pods-ModelingAndBinding-resources.sh
│ ├── Pods-ModelingAndBinding-umbrella.h
│ ├── Pods-ModelingAndBinding.debug.xcconfig
│ ├── Pods-ModelingAndBinding.modulemap
│ └── Pods-ModelingAndBinding.release.xcconfig
│ └── SDWebImage
│ ├── Info.plist
│ ├── SDWebImage-dummy.m
│ ├── SDWebImage-prefix.pch
│ ├── SDWebImage-umbrella.h
│ ├── SDWebImage.modulemap
│ └── SDWebImage.xcconfig
└── ModelingAndBinding
├── ModelingAndBinding.xcodeproj
├── project.pbxproj
└── project.xcworkspace
│ └── contents.xcworkspacedata
├── ModelingAndBinding.xcworkspace
└── contents.xcworkspacedata
├── ModelingAndBinding
├── ActionCell.swift
├── ActionViewModel.swift
├── AppDelegate.swift
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── Comment.swift
├── CommentCell.swift
├── ImageCell.swift
├── ImageViewModel.swift
├── Info.plist
├── Post.swift
├── PostSectionController.swift
├── UserCell.swift
├── UserViewModel.swift
└── ViewController.swift
├── Podfile
├── Podfile.lock
└── Pods
├── IGListKit
├── LICENSE.md
├── README.md
└── Source
│ ├── Common
│ ├── IGListAssert.h
│ ├── IGListBatchUpdateData.h
│ ├── IGListBatchUpdateData.mm
│ ├── IGListCompatibility.h
│ ├── IGListDiff.h
│ ├── IGListDiff.mm
│ ├── IGListDiffKit.h
│ ├── IGListDiffable.h
│ ├── IGListExperiments.h
│ ├── IGListIndexPathResult.h
│ ├── IGListIndexPathResult.m
│ ├── IGListIndexSetResult.h
│ ├── IGListIndexSetResult.m
│ ├── IGListMacros.h
│ ├── IGListMoveIndex.h
│ ├── IGListMoveIndex.m
│ ├── IGListMoveIndexPath.h
│ ├── IGListMoveIndexPath.m
│ ├── Internal
│ │ ├── IGListIndexPathResultInternal.h
│ │ ├── IGListIndexSetResultInternal.h
│ │ ├── IGListMoveIndexInternal.h
│ │ └── IGListMoveIndexPathInternal.h
│ ├── NSNumber+IGListDiffable.h
│ ├── NSNumber+IGListDiffable.m
│ ├── NSString+IGListDiffable.h
│ └── NSString+IGListDiffable.m
│ ├── IGListAdapter.h
│ ├── IGListAdapter.m
│ ├── IGListAdapterDataSource.h
│ ├── IGListAdapterDelegate.h
│ ├── IGListAdapterUpdater.h
│ ├── IGListAdapterUpdater.m
│ ├── IGListAdapterUpdaterDelegate.h
│ ├── IGListBatchContext.h
│ ├── IGListBindable.h
│ ├── IGListBindingSectionController.h
│ ├── IGListBindingSectionController.m
│ ├── IGListBindingSectionControllerDataSource.h
│ ├── IGListBindingSectionControllerSelectionDelegate.h
│ ├── IGListCollectionContext.h
│ ├── IGListCollectionViewLayout.h
│ ├── IGListCollectionViewLayout.mm
│ ├── IGListDisplayDelegate.h
│ ├── IGListGenericSectionController.h
│ ├── IGListGenericSectionController.m
│ ├── IGListKit.h
│ ├── IGListReloadDataUpdater.h
│ ├── IGListReloadDataUpdater.m
│ ├── IGListScrollDelegate.h
│ ├── IGListSectionController.h
│ ├── IGListSectionController.m
│ ├── IGListSingleSectionController.h
│ ├── IGListSingleSectionController.m
│ ├── IGListStackedSectionController.h
│ ├── IGListStackedSectionController.m
│ ├── IGListSupplementaryViewSource.h
│ ├── IGListUpdatingDelegate.h
│ ├── IGListWorkingRangeDelegate.h
│ └── Internal
│ ├── IGListAdapter+DebugDescription.h
│ ├── IGListAdapter+DebugDescription.m
│ ├── IGListAdapter+UICollectionView.h
│ ├── IGListAdapter+UICollectionView.m
│ ├── IGListAdapterInternal.h
│ ├── IGListAdapterProxy.h
│ ├── IGListAdapterProxy.m
│ ├── IGListAdapterUpdater+DebugDescription.h
│ ├── IGListAdapterUpdater+DebugDescription.m
│ ├── IGListAdapterUpdaterInternal.h
│ ├── IGListBatchUpdateData+DebugDescription.h
│ ├── IGListBatchUpdateData+DebugDescription.m
│ ├── IGListBatchUpdateState.h
│ ├── IGListBatchUpdates.h
│ ├── IGListBatchUpdates.m
│ ├── IGListBindingSectionController+DebugDescription.h
│ ├── IGListBindingSectionController+DebugDescription.m
│ ├── IGListCollectionViewLayoutInternal.h
│ ├── IGListDebugger.h
│ ├── IGListDebugger.m
│ ├── IGListDebuggingUtilities.h
│ ├── IGListDebuggingUtilities.m
│ ├── IGListDisplayHandler.h
│ ├── IGListDisplayHandler.m
│ ├── IGListReloadIndexPath.h
│ ├── IGListReloadIndexPath.m
│ ├── IGListSectionControllerInternal.h
│ ├── IGListSectionMap+DebugDescription.h
│ ├── IGListSectionMap+DebugDescription.m
│ ├── IGListSectionMap.h
│ ├── IGListSectionMap.m
│ ├── IGListStackedSectionControllerInternal.h
│ ├── IGListWorkingRangeHandler.h
│ ├── IGListWorkingRangeHandler.mm
│ ├── UICollectionView+DebugDescription.h
│ ├── UICollectionView+DebugDescription.m
│ ├── UICollectionView+IGListBatchUpdateData.h
│ └── UICollectionView+IGListBatchUpdateData.m
├── Local Podspecs
└── IGListKit.podspec.json
├── Manifest.lock
├── Pods.xcodeproj
└── project.pbxproj
├── SDWebImage
├── LICENSE
├── README.md
└── SDWebImage
│ ├── NSData+ImageContentType.h
│ ├── NSData+ImageContentType.m
│ ├── NSImage+WebCache.h
│ ├── NSImage+WebCache.m
│ ├── SDImageCache.h
│ ├── SDImageCache.m
│ ├── SDImageCacheConfig.h
│ ├── SDImageCacheConfig.m
│ ├── SDWebImageCompat.h
│ ├── SDWebImageCompat.m
│ ├── SDWebImageDecoder.h
│ ├── SDWebImageDecoder.m
│ ├── SDWebImageDownloader.h
│ ├── SDWebImageDownloader.m
│ ├── SDWebImageDownloaderOperation.h
│ ├── SDWebImageDownloaderOperation.m
│ ├── SDWebImageManager.h
│ ├── SDWebImageManager.m
│ ├── SDWebImageOperation.h
│ ├── SDWebImagePrefetcher.h
│ ├── SDWebImagePrefetcher.m
│ ├── UIButton+WebCache.h
│ ├── UIButton+WebCache.m
│ ├── UIImage+GIF.h
│ ├── UIImage+GIF.m
│ ├── UIImage+MultiFormat.h
│ ├── UIImage+MultiFormat.m
│ ├── UIImageView+HighlightedWebCache.h
│ ├── UIImageView+HighlightedWebCache.m
│ ├── UIImageView+WebCache.h
│ ├── UIImageView+WebCache.m
│ ├── UIView+WebCache.h
│ ├── UIView+WebCache.m
│ ├── UIView+WebCacheOperation.h
│ └── UIView+WebCacheOperation.m
└── Target Support Files
├── IGListKit
├── IGListKit-dummy.m
├── IGListKit-prefix.pch
├── IGListKit-umbrella.h
├── IGListKit.modulemap
├── IGListKit.xcconfig
└── Info.plist
├── Pods-ModelingAndBinding
├── Info.plist
├── Pods-ModelingAndBinding-acknowledgements.markdown
├── Pods-ModelingAndBinding-acknowledgements.plist
├── Pods-ModelingAndBinding-dummy.m
├── Pods-ModelingAndBinding-frameworks.sh
├── Pods-ModelingAndBinding-resources.sh
├── Pods-ModelingAndBinding-umbrella.h
├── Pods-ModelingAndBinding.debug.xcconfig
├── Pods-ModelingAndBinding.modulemap
└── Pods-ModelingAndBinding.release.xcconfig
└── SDWebImage
├── Info.plist
├── SDWebImage-dummy.m
├── SDWebImage-prefix.pch
├── SDWebImage-umbrella.h
├── SDWebImage.modulemap
└── SDWebImage.xcconfig
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xccheckout
23 | *.xcscmblueprint
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 | *.ipa
28 | *.dSYM.zip
29 | *.dSYM
30 |
31 | ## Playgrounds
32 | timeline.xctimeline
33 | playground.xcworkspace
34 |
35 | # Swift Package Manager
36 | #
37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
38 | # Packages/
39 | # Package.pins
40 | .build/
41 |
42 | # CocoaPods
43 | #
44 | # We recommend against adding the Pods directory to your .gitignore. However
45 | # you should judge for yourself, the pros and cons are mentioned at:
46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
47 | #
48 | # Pods/
49 |
50 | # Carthage
51 | #
52 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
53 | # Carthage/Checkouts
54 |
55 | Carthage/Build
56 |
57 | # fastlane
58 | #
59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
60 | # screenshots whenever they are needed.
61 | # For more information about the recommended setup visit:
62 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
63 |
64 | fastlane/report.xml
65 | fastlane/Preview.html
66 | fastlane/screenshots
67 | fastlane/test_output
68 |
69 | .DS_Store
70 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Ryan Nystrom
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/ModelingAndBinding.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/ModelingAndBinding.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/ModelingAndBinding/ActionCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ActionCell.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | final class ActionCell: UICollectionViewCell {
12 |
13 | @IBOutlet weak var likesLabel: UILabel!
14 | @IBOutlet weak var likeButton: UIButton!
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/ModelingAndBinding/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/ModelingAndBinding/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/ModelingAndBinding/CommentCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CommentCell.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | final class CommentCell: UICollectionViewCell {
12 |
13 | @IBOutlet weak var usernameLabel: UILabel!
14 | @IBOutlet weak var commentLabel: UILabel!
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/ModelingAndBinding/ImageCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ImageCell.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SDWebImage
11 |
12 | final class ImageCell: UICollectionViewCell {
13 |
14 | @IBOutlet weak var imageView: UIImageView!
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/ModelingAndBinding/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/ModelingAndBinding/UserCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UserCell.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | final class UserCell: UICollectionViewCell {
12 |
13 | @IBOutlet weak var usernameLabel: UILabel!
14 | @IBOutlet weak var dateLabel: UILabel!
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/ModelingAndBinding/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import IGListKit
11 |
12 | class ViewController: UIViewController, ListAdapterDataSource {
13 |
14 | var data = [ListDiffable]()
15 | @IBOutlet weak var collectionView: UICollectionView!
16 | lazy var adapter: ListAdapter = { return ListAdapter(updater: ListAdapterUpdater(), viewController: self) }()
17 |
18 | override func viewDidLoad() {
19 | super.viewDidLoad()
20 | adapter.dataSource = self
21 | adapter.collectionView = self.collectionView
22 | }
23 |
24 | // MARK: ListAdapterDataSource
25 |
26 | func objects(for listAdapter: ListAdapter) -> [ListDiffable] {
27 | return data
28 | }
29 |
30 | func listAdapter(_ listAdapter: ListAdapter, sectionControllerFor object: Any) -> ListSectionController {
31 | return ListSectionController()
32 | }
33 |
34 | func emptyView(for listAdapter: ListAdapter) -> UIView? { return nil }
35 |
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | platform :ios, '10.0'
3 |
4 | use_frameworks!
5 |
6 | target 'ModelingAndBinding' do
7 | pod 'IGListKit', :git => 'https://github.com/Instagram/IGListKit.git', :branch => 'master'
8 | pod 'SDWebImage', '~> 4.0.0'
9 | end
10 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - IGListKit (3.0.0):
3 | - IGListKit/Default (= 3.0.0)
4 | - IGListKit/Default (3.0.0):
5 | - IGListKit/Diffing
6 | - IGListKit/Diffing (3.0.0)
7 | - SDWebImage (4.0.0):
8 | - SDWebImage/Core (= 4.0.0)
9 | - SDWebImage/Core (4.0.0)
10 |
11 | DEPENDENCIES:
12 | - IGListKit (from `https://github.com/Instagram/IGListKit.git`, branch `master`)
13 | - SDWebImage (~> 4.0.0)
14 |
15 | EXTERNAL SOURCES:
16 | IGListKit:
17 | :branch: master
18 | :git: https://github.com/Instagram/IGListKit.git
19 |
20 | CHECKOUT OPTIONS:
21 | IGListKit:
22 | :commit: 5ca167806b9db66ff119a5f8ae698e623a495b02
23 | :git: https://github.com/Instagram/IGListKit.git
24 |
25 | SPEC CHECKSUMS:
26 | IGListKit: 9eab6856a15fa25ad72018ff9d9eb2178c240fff
27 | SDWebImage: 76a6348bdc74eb5a55dd08a091ef298e56b55e41
28 |
29 | PODFILE CHECKSUM: d409b24843b44d944925d2f6614e388b3c25fa81
30 |
31 | COCOAPODS: 1.3.1
32 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/LICENSE.md:
--------------------------------------------------------------------------------
1 | BSD License
2 |
3 | For `IGListKit` software
4 |
5 | Copyright (c) 2016, Facebook, Inc. All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without modification,
8 | are permitted provided that the following conditions are met:
9 |
10 | * Redistributions of source code must retain the above copyright notice, this
11 | list of conditions and the following disclaimer.
12 |
13 | * Redistributions in binary form must reproduce the above copyright notice,
14 | this list of conditions and the following disclaimer in the documentation
15 | and/or other materials provided with the distribution.
16 |
17 | * Neither the name Facebook nor the names of its contributors may be used to
18 | endorse or promote products derived from this software without specific
19 | prior written permission.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/IGListAssert.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #ifndef IGAssert
11 | #define IGAssert( condition, ... ) NSCAssert( (condition) , ##__VA_ARGS__)
12 | #endif // IGAssert
13 |
14 | #ifndef IGFailAssert
15 | #define IGFailAssert( ... ) IGAssert( (NO) , ##__VA_ARGS__)
16 | #endif // IGFailAssert
17 |
18 | #ifndef IGParameterAssert
19 | #define IGParameterAssert( condition ) IGAssert( (condition) , @"Invalid parameter not satisfying: %@", @#condition)
20 | #endif // IGParameterAssert
21 |
22 | #ifndef IGAssertMainThread
23 | #define IGAssertMainThread() IGAssert( ([NSThread isMainThread] == YES), @"Must be on the main thread")
24 | #endif // IGAssertMainThread
25 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/IGListCompatibility.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR
13 | #import
14 | #else
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/IGListDiffKit.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | /**
13 | * Project version number for IGListKit.
14 | */
15 | FOUNDATION_EXPORT double IGListKitVersionNumber;
16 |
17 | /**
18 | * Project version string for IGListKit.
19 | */
20 | FOUNDATION_EXPORT const unsigned char IGListKitVersionString[];
21 |
22 | #import
23 | #import
24 | #import
25 | #import
26 | #import
27 | #import
28 | #import
29 | #import
30 | #import
31 | #import
32 | #import
33 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/IGListDiffable.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | /**
13 | The `IGListDiffable` protocol provides methods needed to compare the identity and equality of two objects.
14 | */
15 | NS_SWIFT_NAME(ListDiffable)
16 | @protocol IGListDiffable
17 |
18 | /**
19 | Returns a key that uniquely identifies the object.
20 |
21 | @return A key that can be used to uniquely identify the object.
22 |
23 | @note Two objects may share the same identifier, but are not equal. A common pattern is to use the `NSObject`
24 | category for automatic conformance. However this means that objects will be identified on their
25 | pointer value so finding updates becomes impossible.
26 |
27 | @warning This value should never be mutated.
28 | */
29 | - (nonnull id)diffIdentifier;
30 |
31 | /**
32 | Returns whether the receiver and a given object are equal.
33 |
34 | @param object The object to be compared to the receiver.
35 |
36 | @return `YES` if the receiver and object are equal, otherwise `NO`.
37 | */
38 | - (BOOL)isEqualToDiffableObject:(nullable id)object;
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/IGListMacros.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #ifndef IGLK_SUBCLASSING_RESTRICTED
11 | #if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted)
12 | #define IGLK_SUBCLASSING_RESTRICTED __attribute__((objc_subclassing_restricted))
13 | #else
14 | #define IGLK_SUBCLASSING_RESTRICTED
15 | #endif // #if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted)
16 | #endif // #ifndef IGLK_SUBCLASSING_RESTRICTED
17 |
18 | #ifndef IGLK_UNAVAILABLE
19 | #define IGLK_UNAVAILABLE(message) __attribute__((unavailable(message)))
20 | #endif // #ifndef IGLK_UNAVAILABLE
21 |
22 | #if IGLK_LOGGING_ENABLED
23 | #define IGLKLog( s, ... ) do { NSLog( @"IGListKit: %@", [NSString stringWithFormat: (s), ##__VA_ARGS__] ); } while(0)
24 | #else
25 | #define IGLKLog( s, ... )
26 | #endif
27 |
28 | #ifndef IGLK_DEBUG_DESCRIPTION_ENABLED
29 | #define IGLK_DEBUG_DESCRIPTION_ENABLED DEBUG
30 | #endif // #ifndef IGLK_DEBUG_DESCRIPTION_ENABLED
31 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/IGListMoveIndex.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | /**
15 | An object representing a move between indexes.
16 | */
17 | NS_SWIFT_NAME(ListMoveIndex)
18 | @interface IGListMoveIndex : NSObject
19 |
20 | /**
21 | An index in the old collection.
22 | */
23 | @property (nonatomic, assign, readonly) NSInteger from;
24 |
25 | /**
26 | An index in the new collection.
27 | */
28 | @property (nonatomic, assign, readonly) NSInteger to;
29 |
30 | /**
31 | :nodoc:
32 | */
33 | - (instancetype)init NS_UNAVAILABLE;
34 |
35 | /**
36 | :nodoc:
37 | */
38 | + (instancetype)new NS_UNAVAILABLE;
39 |
40 | @end
41 |
42 | NS_ASSUME_NONNULL_END
43 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/IGListMoveIndex.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListMoveIndex.h"
11 | #import "IGListMoveIndexInternal.h"
12 |
13 | @implementation IGListMoveIndex
14 |
15 | - (instancetype)initWithFrom:(NSInteger)from to:(NSInteger)to {
16 | if (self = [super init]) {
17 | _from = from;
18 | _to = to;
19 | }
20 | return self;
21 | }
22 |
23 | - (NSUInteger)hash {
24 | return _from ^ _to;
25 | }
26 |
27 | - (BOOL)isEqual:(id)object {
28 | if (object == self) {
29 | return YES;
30 | }
31 | if ([object isKindOfClass:[IGListMoveIndex class]]) {
32 | const NSInteger f1 = self.from, f2 = [object from];
33 | const NSInteger t1 = self.to, t2 = [object to];
34 | return f1 == f2 && t1 == t2;
35 | }
36 | return NO;
37 | }
38 |
39 | - (NSComparisonResult)compare:(id)object {
40 | const NSInteger right = [object from];
41 | const NSInteger left = [self from];
42 | if (left == right) {
43 | return NSOrderedSame;
44 | } else if (left < right) {
45 | return NSOrderedAscending;
46 | } else {
47 | return NSOrderedDescending;
48 | }
49 | }
50 |
51 | - (NSString *)description {
52 | return [NSString stringWithFormat:@"<%@ %p; from: %zi; to: %zi;>", NSStringFromClass(self.class), self, self.from, self.to];
53 | }
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/IGListMoveIndexPath.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | /**
15 | An object representing a move between indexes.
16 | */
17 | NS_SWIFT_NAME(ListMoveIndexPath)
18 | @interface IGListMoveIndexPath : NSObject
19 |
20 | /**
21 | An index path in the old collection.
22 | */
23 | @property (nonatomic, strong, readonly) NSIndexPath *from;
24 |
25 | /**
26 | An index path in the new collection.
27 | */
28 | @property (nonatomic, strong, readonly) NSIndexPath *to;
29 |
30 | /**
31 | :nodoc:
32 | */
33 | - (instancetype)init NS_UNAVAILABLE;
34 |
35 | /**
36 | :nodoc:
37 | */
38 | + (instancetype)new NS_UNAVAILABLE;
39 |
40 | @end
41 |
42 | NS_ASSUME_NONNULL_END
43 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/IGListMoveIndexPath.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListMoveIndexPath.h"
11 | #import "IGListMoveIndexPathInternal.h"
12 |
13 | #import
14 |
15 | @implementation IGListMoveIndexPath
16 |
17 | - (instancetype)initWithFrom:(NSIndexPath *)from to:(NSIndexPath *)to {
18 | NSParameterAssert(from != nil);
19 | NSParameterAssert(to != nil);
20 | if (self = [super init]) {
21 | _from = from;
22 | _to = to;
23 | }
24 | return self;
25 | }
26 |
27 | - (NSUInteger)hash {
28 | return [_from hash] ^ [_to hash];
29 | }
30 |
31 | - (BOOL)isEqual:(id)object {
32 | if (object == self) {
33 | return YES;
34 | }
35 | if ([object isKindOfClass:[IGListMoveIndexPath class]]) {
36 | NSIndexPath *f1 = self.from, *f2 = [object from];
37 | NSIndexPath *t1 = self.to, *t2 = [object to];
38 | return [f1 isEqual:f2] && [t1 isEqual:t2];
39 | }
40 | return NO;
41 | }
42 |
43 | - (NSComparisonResult)compare:(id)object {
44 | return [[self from] compare:[object from]];
45 | }
46 |
47 | - (NSString *)description {
48 | return [NSString stringWithFormat:@"<%@ %p; from: %@; to: %@;>", NSStringFromClass(self.class), self, self.from, self.to];
49 | }
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/Internal/IGListIndexPathResultInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | @interface IGListIndexPathResult()
17 |
18 | - (instancetype)initWithInserts:(NSArray *)inserts
19 | deletes:(NSArray *)deletes
20 | updates:(NSArray *)updates
21 | moves:(NSArray *)moves
22 | oldIndexPathMap:(NSMapTable, NSIndexPath *> *)oldIndexPathMap
23 | newIndexPathMap:(NSMapTable, NSIndexPath *> *)newIndexPathMap;
24 |
25 | @property (nonatomic, assign, readonly) NSInteger changeCount;
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/Internal/IGListIndexSetResultInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | @interface IGListIndexSetResult()
17 |
18 | - (instancetype)initWithInserts:(NSIndexSet *)inserts
19 | deletes:(NSIndexSet *)deletes
20 | updates:(NSIndexSet *)updates
21 | moves:(NSArray *)moves
22 | oldIndexMap:(NSMapTable, NSNumber *> *)oldIndexMap
23 | newIndexMap:(NSMapTable, NSNumber *> *)newIndexMap;
24 |
25 | @property (nonatomic, assign, readonly) NSInteger changeCount;
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/Internal/IGListMoveIndexInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | @interface IGListMoveIndex ()
17 |
18 | - (instancetype)initWithFrom:(NSInteger)from to:(NSInteger)to NS_DESIGNATED_INITIALIZER;
19 |
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/Internal/IGListMoveIndexPathInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface IGListMoveIndexPath ()
15 |
16 | - (instancetype)initWithFrom:(NSIndexPath *)from to:(NSIndexPath *)to NS_DESIGNATED_INITIALIZER;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/NSNumber+IGListDiffable.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | /**
15 | This category provides default `IGListDiffable` conformance for `NSNumber`.
16 | */
17 | @interface NSNumber (IGListDiffable)
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/NSNumber+IGListDiffable.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "NSNumber+IGListDiffable.h"
11 |
12 | @implementation NSNumber (IGListDiffable)
13 |
14 | - (id)diffIdentifier {
15 | return self;
16 | }
17 |
18 | - (BOOL)isEqualToDiffableObject:(id)object {
19 | return [self isEqual:object];
20 | }
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/NSString+IGListDiffable.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | /**
15 | This category provides default `IGListDiffable` conformance for `NSString`.
16 | */
17 | @interface NSString (IGListDiffable)
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Common/NSString+IGListDiffable.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "NSString+IGListDiffable.h"
11 |
12 | @implementation NSString (IGListDiffable)
13 |
14 | - (id)diffIdentifier {
15 | return self;
16 | }
17 |
18 | - (BOOL)isEqualToDiffableObject:(id)object {
19 | return [self isEqual:object];
20 | }
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/IGListAdapterDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListAdapter;
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | Conform to `IGListAdapterDelegate` to receive display events for objects in a list.
18 | */
19 | @protocol IGListAdapterDelegate
20 |
21 | /**
22 | Notifies the delegate that a list object is about to be displayed.
23 |
24 | @param listAdapter The list adapter sending this information.
25 | @param object The object that will display.
26 | @param index The index of the object in the list.
27 | */
28 | - (void)listAdapter:(IGListAdapter *)listAdapter willDisplayObject:(id)object atIndex:(NSInteger)index;
29 |
30 | /**
31 | Notifies the delegate that a list object is no longer being displayed.
32 |
33 | @param listAdapter The list adapter sending this information.
34 | @param object The object that ended display.
35 | @param index The index of the object in the list.
36 | */
37 | - (void)listAdapter:(IGListAdapter *)listAdapter didEndDisplayingObject:(id)object atIndex:(NSInteger)index;
38 |
39 | @end
40 |
41 | NS_ASSUME_NONNULL_END
42 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/IGListBindable.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | /**
15 | A protocol for cells that configure themselves given a view model.
16 | */
17 | NS_SWIFT_NAME(ListBindable)
18 | @protocol IGListBindable
19 |
20 | /**
21 | Tells the cell to configure itself with the given view model.
22 |
23 | @param viewModel The view model for the cell.
24 |
25 | @note The view model can change many times throughout the lifetime of a cell as the model values change and the cell
26 | is reused. Implementations should use only this method to do their configuration.
27 | */
28 | - (void)bindViewModel:(id)viewModel;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/IGListBindingSectionControllerSelectionDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListBindingSectionController;
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | A protocol that handles cell selection events in an `IGListBindingSectionController`.
18 | */
19 | NS_SWIFT_NAME(ListBindingSectionControllerSelectionDelegate)
20 | @protocol IGListBindingSectionControllerSelectionDelegate
21 |
22 | /**
23 | Tells the delegate that a cell at a given index was selected.
24 |
25 | @param sectionController The section controller the selection occurred in.
26 | @param index The index of the selected cell.
27 | @param viewModel The view model that was bound to the cell.
28 | */
29 | - (void)sectionController:(IGListBindingSectionController *)sectionController
30 | didSelectItemAtIndex:(NSInteger)index
31 | viewModel:(id)viewModel;
32 |
33 | /**
34 | Tells the delegate that a cell at a given index was deselected.
35 |
36 | @param sectionController The section controller the deselection occurred in.
37 | @param index The index of the deselected cell.
38 | @param viewModel The view model that was bound to the cell.
39 |
40 | @note Method is `@optional` until the 4.0.0 release where it will become required.
41 | */
42 | @optional
43 | - (void)sectionController:(IGListBindingSectionController *)sectionController
44 | didDeselectItemAtIndex:(NSInteger)index
45 | viewModel:(id)viewModel;
46 |
47 | @end
48 |
49 | NS_ASSUME_NONNULL_END
50 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/IGListGenericSectionController.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | /**
15 | This class adds a helper layer to `IGListSectionController` to automatically store a generic object in
16 | `didUpdateToObject:`.
17 | */
18 | NS_SWIFT_NAME(ListGenericSectionController)
19 | @interface IGListGenericSectionController<__covariant ObjectType> : IGListSectionController
20 |
21 | /**
22 | The object mapped to this section controller. Matches the object provided in
23 | `[IGListAdapterDataSource listAdapter:sectionControllerForObject:]` when this section controller was created and
24 | returned.
25 |
26 | @note This object is briefly `nil` between initialization and the first call to `didUpdateToObject:`. After that, it is
27 | safe to assume that this is non-`nil`.
28 | */
29 | @property (nonatomic, strong, nullable, readonly) ObjectType object;
30 |
31 | /**
32 | Updates the section controller to a new object.
33 |
34 | @param object The object mapped to this section controller.
35 |
36 | @note This `IGListSectionController` subclass sets its object in this method, so any overrides **must call super**.
37 | */
38 | - (void)didUpdateToObject:(id)object NS_REQUIRES_SUPER;
39 |
40 | @end
41 |
42 | NS_ASSUME_NONNULL_END
43 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/IGListGenericSectionController.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListGenericSectionController.h"
11 |
12 | @implementation IGListGenericSectionController
13 |
14 | - (void)didUpdateToObject:(id)object {
15 | _object = object;
16 | }
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/IGListReloadDataUpdater.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 | #import
14 |
15 | NS_ASSUME_NONNULL_BEGIN
16 |
17 | /**
18 | An `IGListReloadDataUpdater` is a concrete type that conforms to `IGListUpdatingDelegate`.
19 | It is an out-of-box updater for `IGListAdapter` objects to use.
20 |
21 | @note This updater performs simple, synchronous updates using `-[UICollectionView reloadData]`.
22 | */
23 | IGLK_SUBCLASSING_RESTRICTED
24 | NS_SWIFT_NAME(ListReloadDataUpdater)
25 | @interface IGListReloadDataUpdater : NSObject
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/IGListScrollDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListAdapter;
13 | @class IGListSectionController;
14 |
15 |
16 |
17 | NS_ASSUME_NONNULL_BEGIN
18 |
19 | /**
20 | Implement this protocol to receive display events for a section controller when it is on screen.
21 | */
22 | NS_SWIFT_NAME(ListScrollDelegate)
23 | @protocol IGListScrollDelegate
24 |
25 | /**
26 | Tells the delegate that the section controller was scrolled on screen.
27 |
28 | @param listAdapter The list adapter whose collection view was scrolled.
29 | @param sectionController The visible section controller that was scrolled.
30 | */
31 | - (void)listAdapter:(IGListAdapter *)listAdapter didScrollSectionController:(IGListSectionController *)sectionController;
32 |
33 | /**
34 | Tells the delegate that the section controller will be dragged on screen.
35 |
36 | @param listAdapter The list adapter whose collection view will drag.
37 | @param sectionController The visible section controller that will drag.
38 | */
39 | - (void)listAdapter:(IGListAdapter *)listAdapter willBeginDraggingSectionController:(IGListSectionController *)sectionController;
40 |
41 | /**
42 | Tells the delegate that the section controller did end dragging on screen.
43 |
44 | @param listAdapter The list adapter whose collection view ended dragging.
45 | @param sectionController The visible section controller that ended dragging.
46 | */
47 | - (void)listAdapter:(IGListAdapter *)listAdapter didEndDraggingSectionController:(IGListSectionController *)sectionController willDecelerate:(BOOL)decelerate;
48 |
49 | @end
50 |
51 | NS_ASSUME_NONNULL_END
52 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/IGListStackedSectionController.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | An instance of `IGListStackedSectionController` is a clustered section controller, composed of many child section
18 | controllers. It constructs and routes item-level indexes to the appropriate child section controller with a local
19 | index. This lets you build section controllers made up of individual units that can be shared and reused with other
20 | section controllers.
21 |
22 | For example, you can create a "Comments" section controller that displays lists of text that is used alongside photo,
23 | video, or slideshow section controllers. You then have four small and manageable section controllers instead of one
24 | huge class.
25 | */
26 | IGLK_SUBCLASSING_RESTRICTED
27 | NS_SWIFT_NAME(ListStackedSectionController)
28 | @interface IGListStackedSectionController : IGListSectionController
29 |
30 | /**
31 | Creates a new stacked section controller.
32 |
33 | @param sectionControllers An array of section controllers that make up the stack.
34 |
35 | @note The order of the section controllers dictates the order in which they appear.
36 |
37 | @warning The first section controller that is the supplementary source decides which supplementary views get displayed.
38 | */
39 | - (instancetype)initWithSectionControllers:(NSArray *)sectionControllers NS_DESIGNATED_INITIALIZER;
40 |
41 | /**
42 | :nodoc:
43 | */
44 | - (instancetype)init NS_UNAVAILABLE;
45 |
46 | /**
47 | :nodoc:
48 | */
49 | + (instancetype)new NS_UNAVAILABLE;
50 |
51 | @end
52 |
53 | NS_ASSUME_NONNULL_END
54 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/IGListWorkingRangeDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListAdapter;
13 | @class IGListSectionController;
14 |
15 |
16 |
17 | NS_ASSUME_NONNULL_BEGIN
18 |
19 | /**
20 | Implement this protocol to receive working range events for a list.
21 |
22 | The working range is a range *near* the viewport in which you can begin preparing content for display. For example,
23 | you could begin decoding images, or warming text caches.
24 | */
25 | NS_SWIFT_NAME(ListWorkingRangeDelegate)
26 | @protocol IGListWorkingRangeDelegate
27 |
28 | /**
29 | Notifies the delegate that an section controller will enter the working range.
30 |
31 | @param listAdapter The adapter controlling the list.
32 | @param sectionController The section controller entering the range.
33 | */
34 | - (void)listAdapter:(IGListAdapter *)listAdapter sectionControllerWillEnterWorkingRange:(IGListSectionController *)sectionController;
35 |
36 | /**
37 | Notifies the delegate that an section controller exited the working range.
38 |
39 | @param listAdapter The adapter controlling the list.
40 | @param sectionController The section controller that exited the range.
41 | */
42 | - (void)listAdapter:(IGListAdapter *)listAdapter sectionControllerDidExitWorkingRange:(IGListSectionController *)sectionController;
43 |
44 | @end
45 |
46 | NS_ASSUME_NONNULL_END
47 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListAdapter+DebugDescription.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface IGListAdapter (DebugDescription)
13 |
14 | - (NSArray *)debugDescriptionLines;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListAdapter+UICollectionView.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | @interface IGListAdapter (UICollectionView)
15 | <
16 | UICollectionViewDataSource,
17 | UICollectionViewDelegateFlowLayout
18 | >
19 | @end
20 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListAdapterProxy.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | @class IGListAdapter;
15 |
16 | NS_ASSUME_NONNULL_BEGIN
17 |
18 | /**
19 | A proxy that sends a custom set of selectors to an IGListAdapter object and the rest to a UICollectionViewDelegate
20 | target.
21 | */
22 | IGLK_SUBCLASSING_RESTRICTED
23 | @interface IGListAdapterProxy : NSProxy
24 |
25 | /**
26 | Create a new proxy object with targets and interceptor.
27 |
28 | @param collectionViewTarget A UICollectionViewDelegate conforming object that receives non-intercepted messages.
29 | @param scrollViewTarget A UIScrollViewDelegate conforming object that receives non-intercepted messages.
30 | @param interceptor An IGListAdapter object that intercepts a set of messages.
31 |
32 | @return A new IGListAdapterProxy object.
33 | */
34 | - (instancetype)initWithCollectionViewTarget:(nullable id)collectionViewTarget
35 | scrollViewTarget:(nullable id)scrollViewTarget
36 | interceptor:(IGListAdapter *)interceptor;
37 |
38 | /**
39 | :nodoc:
40 | */
41 | - (instancetype)init NS_UNAVAILABLE;
42 |
43 | /**
44 | :nodoc:
45 | */
46 | + (instancetype)new NS_UNAVAILABLE;
47 |
48 | @end
49 |
50 | NS_ASSUME_NONNULL_END
51 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListAdapterUpdater+DebugDescription.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface IGListAdapterUpdater (DebugDescription)
13 |
14 | - (NSArray *)debugDescriptionLines;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListBatchUpdateData+DebugDescription.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface IGListBatchUpdateData (DebugDescription)
13 |
14 | - (NSArray *)debugDescriptionLines;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListBatchUpdateData+DebugDescription.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListBatchUpdateData+DebugDescription.h"
11 |
12 | @implementation IGListBatchUpdateData (DebugDescription)
13 |
14 | - (NSArray *)debugDescriptionLines {
15 | NSMutableArray *debug = [NSMutableArray new];
16 | #if IGLK_DEBUG_DESCRIPTION_ENABLED
17 | [debug addObject:[NSString stringWithFormat:@"Insert sections: %@", self.insertSections]];
18 | [debug addObject:[NSString stringWithFormat:@"Delete sections: %@", self.deleteSections]];
19 |
20 | for (IGListMoveIndex *move in self.moveSections) {
21 | [debug addObject:[NSString stringWithFormat:@"Move from section %zi to %zi", move.from, move.to]];
22 | }
23 |
24 | for (NSIndexPath *path in self.deleteIndexPaths) {
25 | [debug addObject:[NSString stringWithFormat:@"Delete section %zi item %zi", path.section, path.item]];
26 | }
27 |
28 | for (NSIndexPath *path in self.insertIndexPaths) {
29 | [debug addObject:[NSString stringWithFormat:@"Insert section %zi item %zi", path.section, path.item]];
30 | }
31 |
32 | for (IGListMoveIndexPath *move in self.moveIndexPaths) {
33 | [debug addObject:[NSString stringWithFormat:@"Move from section %zi item %zi to section %zi item %zi",
34 | move.from.section, move.from.item, move.to.section, move.to.item]];
35 | }
36 | #endif // #if IGLK_DEBUG_DESCRIPTION_ENABLED
37 | return debug;
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListBatchUpdateState.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | typedef NS_ENUM (NSInteger, IGListBatchUpdateState) {
13 | IGListBatchUpdateStateIdle,
14 | IGListBatchUpdateStateQueuedBatchUpdate,
15 | IGListBatchUpdateStateExecutingBatchUpdateBlock,
16 | IGListBatchUpdateStateExecutedBatchUpdateBlock,
17 | };
18 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListBatchUpdates.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | @class IGListMoveIndexPath;
15 | @class IGListReloadIndexPath;
16 |
17 | IGLK_SUBCLASSING_RESTRICTED
18 | @interface IGListBatchUpdates : NSObject
19 |
20 | @property (nonatomic, strong, readonly) NSMutableIndexSet *sectionReloads;
21 | @property (nonatomic, strong, readonly) NSMutableArray *itemInserts;
22 | @property (nonatomic, strong, readonly) NSMutableArray *itemDeletes;
23 | @property (nonatomic, strong, readonly) NSMutableArray *itemReloads;
24 | @property (nonatomic, strong, readonly) NSMutableArray *itemMoves;
25 |
26 | @property (nonatomic, strong, readonly) NSMutableArray *itemUpdateBlocks;
27 | @property (nonatomic, strong, readonly) NSMutableArray *itemCompletionBlocks;
28 |
29 | - (BOOL)hasChanges;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListBatchUpdates.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListBatchUpdates.h"
11 |
12 | @implementation IGListBatchUpdates
13 |
14 | - (instancetype)init {
15 | if (self = [super init]) {
16 | _sectionReloads = [NSMutableIndexSet new];
17 | _itemInserts = [NSMutableArray new];
18 | _itemMoves = [NSMutableArray new];
19 | _itemDeletes = [NSMutableArray new];
20 | _itemReloads = [NSMutableArray new];
21 | _itemUpdateBlocks = [NSMutableArray new];
22 | _itemCompletionBlocks = [NSMutableArray new];
23 | }
24 | return self;
25 | }
26 |
27 | - (BOOL)hasChanges {
28 | return [self.itemUpdateBlocks count] > 0
29 | || [self.sectionReloads count] > 0
30 | || [self.itemInserts count] > 0
31 | || [self.itemMoves count] > 0
32 | || [self.itemReloads count] > 0
33 | || [self.itemDeletes count] > 0;
34 | }
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListBindingSectionController+DebugDescription.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface IGListBindingSectionController (DebugDescription)
13 |
14 | - (NSArray *)debugDescriptionLines;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListCollectionViewLayoutInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | static CGRect IGListRectIntegralScaled(CGRect rect) {
11 | CGFloat scale = [[UIScreen mainScreen] scale];
12 | return CGRectMake(floorf(rect.origin.x * scale) / scale,
13 | floorf(rect.origin.y * scale) / scale,
14 | ceilf(rect.size.width * scale) / scale,
15 | ceilf(rect.size.height * scale) / scale);
16 | }
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListDebugger.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | @class IGListAdapter;
15 |
16 | IGLK_SUBCLASSING_RESTRICTED
17 | @interface IGListDebugger : NSObject
18 |
19 | + (void)trackAdapter:(IGListAdapter *)adapter;
20 |
21 | + (NSArray *)adapterDescriptions;
22 |
23 | + (NSString *)dump;
24 |
25 | - (instancetype)init NS_UNAVAILABLE;
26 | + (instancetype)new NS_UNAVAILABLE;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListDebugger.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListDebugger.h"
11 |
12 | #import "IGListDebuggingUtilities.h"
13 | #import "IGListAdapter+DebugDescription.h"
14 |
15 | @implementation IGListDebugger
16 |
17 | static NSHashTable *livingAdaptersTable = nil;
18 |
19 | + (void)trackAdapter:(IGListAdapter *)adapter {
20 | #if IGLK_DEBUG_DESCRIPTION_ENABLED
21 | if (livingAdaptersTable == nil) {
22 | livingAdaptersTable = [NSHashTable weakObjectsHashTable];
23 | }
24 | [livingAdaptersTable addObject:adapter];
25 | #endif // #if IGLK_DEBUG_DESCRIPTION_ENABLED
26 | }
27 |
28 | + (NSArray *)adapterDescriptions {
29 | NSMutableArray *descriptions = [NSMutableArray new];
30 | for (IGListAdapter *adapter in livingAdaptersTable) {
31 | [descriptions addObject:[adapter debugDescription]];
32 | }
33 | return descriptions;
34 | }
35 |
36 | + (NSString *)dump {
37 | return [[self adapterDescriptions] componentsJoinedByString:@"\n"];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListDebuggingUtilities.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListAdapter;
13 |
14 | extern NSString *IGListDebugBOOL(BOOL b);
15 |
16 | extern NSArray *IGListDebugIndentedLines(NSArray *lines);
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListDebuggingUtilities.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListDebuggingUtilities.h"
11 |
12 | NSString *IGListDebugBOOL(BOOL b) {
13 | return b ? @"Yes" : @"No";
14 | }
15 |
16 | NSArray *IGListDebugIndentedLines(NSArray *lines) {
17 | NSMutableArray *newLines = [NSMutableArray new];
18 | for (NSString *line in lines) {
19 | [newLines addObject:[NSString stringWithFormat:@" %@", line]];
20 | }
21 | return newLines;
22 | }
23 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListReloadIndexPath.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | An object with index path information for reloading an item during a batch update.
18 | */
19 | IGLK_SUBCLASSING_RESTRICTED
20 | @interface IGListReloadIndexPath : NSObject
21 |
22 | /**
23 | The index path of the item before batch updates are applied.
24 | */
25 | @property (nonatomic, strong, readonly) NSIndexPath *fromIndexPath;
26 |
27 | /**
28 | The index path of the item after batch updates are applied.
29 | */
30 | @property (nonatomic, strong, readonly) NSIndexPath *toIndexPath;
31 |
32 | /**
33 | Creates a new reload object.
34 |
35 | @param fromIndexPath The index path of the item before batch updates.
36 | @param toIndexPath The index path of the item after batch updates.
37 | @return A new reload object.
38 | */
39 | - (instancetype)initWithFromIndexPath:(NSIndexPath *)fromIndexPath
40 | toIndexPath:(NSIndexPath *)toIndexPath NS_DESIGNATED_INITIALIZER;
41 |
42 | /**
43 | :nodoc:
44 | */
45 | - (instancetype)init NS_UNAVAILABLE;
46 |
47 | /**
48 | :nodoc:
49 | */
50 | + (instancetype)new NS_UNAVAILABLE;
51 |
52 | @end
53 |
54 | NS_ASSUME_NONNULL_END
55 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListReloadIndexPath.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListReloadIndexPath.h"
11 |
12 | @implementation IGListReloadIndexPath
13 |
14 | - (instancetype)initWithFromIndexPath:(NSIndexPath *)fromIndexPath
15 | toIndexPath:(NSIndexPath *)toIndexPath {
16 | if (self = [super init]) {
17 | _fromIndexPath = fromIndexPath;
18 | _toIndexPath = toIndexPath;
19 | }
20 | return self;
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListSectionControllerInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListSectionController.h"
11 |
12 | FOUNDATION_EXTERN void IGListSectionControllerPushThread(UIViewController *viewController, id collectionContext);
13 |
14 | FOUNDATION_EXTERN void IGListSectionControllerPopThread(void);
15 |
16 | @interface IGListSectionController()
17 |
18 | @property (nonatomic, weak, readwrite) id collectionContext;
19 |
20 | @property (nonatomic, weak, readwrite) UIViewController *viewController;
21 |
22 | @property (nonatomic, assign, readwrite) NSInteger section;
23 |
24 | @property (nonatomic, assign, readwrite) BOOL isFirstSection;
25 |
26 | @property (nonatomic, assign, readwrite) BOOL isLastSection;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListSectionMap+DebugDescription.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "IGListSectionMap.h"
13 |
14 | @interface IGListSectionMap (DebugDescription)
15 |
16 | - (NSArray *)debugDescriptionLines;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListSectionMap+DebugDescription.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListSectionMap+DebugDescription.h"
11 | #import "IGListBindingSectionController.h"
12 |
13 | @implementation IGListSectionMap (DebugDescription)
14 |
15 | - (NSArray *)debugDescriptionLines {
16 | NSMutableArray *debug = [NSMutableArray new];
17 | #if IGLK_DEBUG_DESCRIPTION_ENABLED
18 | [self enumerateUsingBlock:^(id object, IGListSectionController *sectionController, NSInteger section, BOOL *stop) {
19 | if ([sectionController isKindOfClass:[IGListBindingSectionController class]]) {
20 | [debug addObject:[sectionController debugDescription]];
21 | } else {
22 | [debug addObject:[NSString stringWithFormat:@"Object and section controller at section: %zi:", section]];
23 | [debug addObject:[NSString stringWithFormat:@" %@", object]];
24 | [debug addObject:[NSString stringWithFormat:@" %@", sectionController]];
25 | }
26 | }];
27 | #endif // #if IGLK_DEBUG_DESCRIPTION_ENABLED
28 | return debug;
29 | }
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListStackedSectionControllerInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "IGListStackedSectionController.h"
13 |
14 | @interface IGListStackedSectionController ()
15 | <
16 | IGListBatchContext,
17 | IGListCollectionContext,
18 | IGListDisplayDelegate,
19 | IGListScrollDelegate,
20 | IGListWorkingRangeDelegate
21 | >
22 |
23 | @property (nonatomic, strong, readonly) NSOrderedSet<__kindof IGListSectionController *> *sectionControllers;
24 |
25 | /// An array the length of the total number of items in the stack, pointing to a section controller for the item index.
26 | @property (nonatomic, copy) NSArray *sectionControllersForItems;
27 |
28 | /// An array of index offsets for each item in the flattened stack.
29 | @property (nonatomic, copy) NSArray *sectionControllerOffsets;
30 |
31 | /// A cached collection of the number of items summed from each section controller in the stack.
32 | @property (nonatomic, assign) NSInteger flattenedNumberOfItems;
33 |
34 | /// A counted set of the visible section controllers, used to forward granular display events to child section controllers
35 | @property (nonatomic, strong, readonly) NSCountedSet *visibleSectionControllers;
36 |
37 | /// Temporary batch context so the stack controller can transform child indices within the stack before updating.
38 | @property (nonatomic, strong) id forwardingBatchContext;
39 |
40 | - (IGListSectionController *)sectionControllerForObjectIndex:(NSInteger)itemIndex;
41 | - (NSInteger)offsetForSectionController:(IGListSectionController *)sectionController;
42 | - (void)reloadData;
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/IGListWorkingRangeHandler.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListAdapter;
13 |
14 |
15 |
16 | @interface IGListWorkingRangeHandler : NSObject
17 |
18 | /**
19 | Initializes the working range handler.
20 |
21 | @param workingRangeSize the number of sections beyond the visible viewport that should be considered within the working
22 | range. Applies equally in both directions above and below the viewport.
23 | */
24 | - (instancetype)initWithWorkingRangeSize:(NSInteger)workingRangeSize;
25 |
26 | /**
27 | Tells the handler that a cell will be displayed in the IGListKit infra.
28 |
29 | @param indexPath The index path of the cell in the UICollectionView.
30 | @param listAdapter The adapter managing the infra.
31 | */
32 | - (void)willDisplayItemAtIndexPath:(NSIndexPath *)indexPath
33 | forListAdapter:(IGListAdapter *)listAdapter;
34 |
35 | /**
36 | Tells the handler that a cell did end display in the IGListKit infra.
37 |
38 | @param indexPath The index path of the cell in the UICollectionView.
39 | @param listAdapter The adapter managing the infra.
40 | */
41 | - (void)didEndDisplayingItemAtIndexPath:(NSIndexPath *)indexPath
42 | forListAdapter:(IGListAdapter *)listAdapter;
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/UICollectionView+DebugDescription.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface UICollectionView (DebugDescription)
13 |
14 | - (NSArray *)debugDescriptionLines;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/UICollectionView+DebugDescription.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "UICollectionView+DebugDescription.h"
11 |
12 | #import
13 |
14 | @implementation UICollectionView (DebugDescription)
15 |
16 | - (NSArray *)debugDescriptionLines {
17 | NSMutableArray *debug = [NSMutableArray new];
18 | #if IGLK_DEBUG_DESCRIPTION_ENABLED
19 | [debug addObject:[NSString stringWithFormat:@"Class: %@, instance: %p", NSStringFromClass(self.class), self]];
20 | [debug addObject:[NSString stringWithFormat:@"Data source: %@", self.dataSource]];
21 | [debug addObject:[NSString stringWithFormat:@"Delegate: %@", self.delegate]];
22 | [debug addObject:[NSString stringWithFormat:@"Layout: %@", self.collectionViewLayout]];
23 | [debug addObject:[NSString stringWithFormat:@"Frame: %@, bounds: %@",
24 | NSStringFromCGRect(self.frame), NSStringFromCGRect(self.bounds)]];
25 |
26 | const NSInteger sections = [self numberOfSections];
27 | [debug addObject:[NSString stringWithFormat:@"Number of sections: %zi", sections]];
28 |
29 | for (NSInteger section = 0; section < sections; section++) {
30 | [debug addObject:[NSString stringWithFormat:@" %zi items in section %zi",
31 | [self numberOfItemsInSection:section], section]];
32 | }
33 |
34 | [debug addObject:@"Visible cell details:"];
35 | NSArray *visibleIndexPaths = [[self indexPathsForVisibleItems] sortedArrayUsingSelector:@selector(compare:)];
36 | for (NSIndexPath *path in visibleIndexPaths) {
37 | [debug addObject:[NSString stringWithFormat:@" Visible cell at section %zi, item %zi:",
38 | path.section, path.item]];
39 | [debug addObject:[NSString stringWithFormat:@" %@", [[self cellForItemAtIndexPath:path] description] ?: @""]];
40 | }
41 | #endif // #if IGLK_DEBUG_DESCRIPTION_ENABLED
42 | return debug;
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/UICollectionView+IGListBatchUpdateData.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListBatchUpdateData;
13 |
14 | @interface UICollectionView (IGListBatchUpdateData)
15 |
16 | - (void)ig_applyBatchUpdateData:(IGListBatchUpdateData *)updateData;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/IGListKit/Source/Internal/UICollectionView+IGListBatchUpdateData.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "UICollectionView+IGListBatchUpdateData.h"
11 |
12 | #import "IGListBatchUpdateData.h"
13 |
14 | @implementation UICollectionView (IGListBatchUpdateData)
15 |
16 | - (void)ig_applyBatchUpdateData:(IGListBatchUpdateData *)updateData {
17 | [self deleteItemsAtIndexPaths:updateData.deleteIndexPaths];
18 | [self insertItemsAtIndexPaths:updateData.insertIndexPaths];
19 |
20 | for (IGListMoveIndexPath *move in updateData.moveIndexPaths) {
21 | [self moveItemAtIndexPath:move.from toIndexPath:move.to];
22 | }
23 |
24 | for (IGListMoveIndex *move in updateData.moveSections) {
25 | [self moveSection:move.from toSection:move.to];
26 | }
27 |
28 | [self deleteSections:updateData.deleteSections];
29 | [self insertSections:updateData.insertSections];
30 | }
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Local Podspecs/IGListKit.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "IGListKit",
3 | "version": "3.0.0",
4 | "summary": "A data-driven UICollectionView framework.",
5 | "homepage": "https://github.com/Instagram/IGListKit",
6 | "documentation_url": "https://instagram.github.io/IGListKit",
7 | "description": "A data-driven UICollectionView framework for building fast and flexible lists.",
8 | "license": {
9 | "type": "BSD"
10 | },
11 | "authors": "Instagram",
12 | "social_media_url": "https://twitter.com/fbOpenSource",
13 | "source": {
14 | "git": "https://github.com/Instagram/IGListKit.git",
15 | "tag": "3.0.0",
16 | "branch": "stable"
17 | },
18 | "default_subspecs": "Default",
19 | "requires_arc": true,
20 | "platforms": {
21 | "ios": "8.0",
22 | "tvos": "9.0",
23 | "osx": "10.10"
24 | },
25 | "ios": {
26 | "frameworks": "UIKit"
27 | },
28 | "tvos": {
29 | "frameworks": "UIKit"
30 | },
31 | "osx": {
32 | "frameworks": "Cocoa"
33 | },
34 | "libraries": "c++",
35 | "pod_target_xcconfig": {
36 | "CLANG_CXX_LANGUAGE_STANDARD": "c++11",
37 | "CLANG_CXX_LIBRARY": "libc++"
38 | },
39 | "subspecs": [
40 | {
41 | "name": "Diffing",
42 | "source_files": "Source/Common/**/*.{h,m,mm}",
43 | "private_header_files": "Source/Common/Internal/*.h"
44 | },
45 | {
46 | "name": "Default",
47 | "dependencies": {
48 | "IGListKit/Diffing": [
49 |
50 | ]
51 | },
52 | "ios": {
53 | "source_files": "Source/**/*.{h,m,mm}",
54 | "private_header_files": [
55 | "Source/Internal/*.h",
56 | "Source/Common/Internal/*.h"
57 | ]
58 | },
59 | "tvos": {
60 | "source_files": "Source/**/*.{h,m,mm}",
61 | "private_header_files": [
62 | "Source/Internal/*.h",
63 | "Source/Common/Internal/*.h"
64 | ]
65 | }
66 | }
67 | ]
68 | }
69 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - IGListKit (3.0.0):
3 | - IGListKit/Default (= 3.0.0)
4 | - IGListKit/Default (3.0.0):
5 | - IGListKit/Diffing
6 | - IGListKit/Diffing (3.0.0)
7 | - SDWebImage (4.0.0):
8 | - SDWebImage/Core (= 4.0.0)
9 | - SDWebImage/Core (4.0.0)
10 |
11 | DEPENDENCIES:
12 | - IGListKit (from `https://github.com/Instagram/IGListKit.git`, branch `master`)
13 | - SDWebImage (~> 4.0.0)
14 |
15 | EXTERNAL SOURCES:
16 | IGListKit:
17 | :branch: master
18 | :git: https://github.com/Instagram/IGListKit.git
19 |
20 | CHECKOUT OPTIONS:
21 | IGListKit:
22 | :commit: 5ca167806b9db66ff119a5f8ae698e623a495b02
23 | :git: https://github.com/Instagram/IGListKit.git
24 |
25 | SPEC CHECKSUMS:
26 | IGListKit: 9eab6856a15fa25ad72018ff9d9eb2178c240fff
27 | SDWebImage: 76a6348bdc74eb5a55dd08a091ef298e56b55e41
28 |
29 | PODFILE CHECKSUM: d409b24843b44d944925d2f6614e388b3c25fa81
30 |
31 | COCOAPODS: 1.3.1
32 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016 Olivier Poitrey rs@dailymotion.com
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is furnished
8 | to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) Fabrice Aneche
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import
11 | #import "SDWebImageCompat.h"
12 |
13 | typedef NS_ENUM(NSInteger, SDImageFormat) {
14 | SDImageFormatUndefined = -1,
15 | SDImageFormatJPEG = 0,
16 | SDImageFormatPNG,
17 | SDImageFormatGIF,
18 | SDImageFormatTIFF,
19 | SDImageFormatWebP
20 | };
21 |
22 | @interface NSData (ImageContentType)
23 |
24 | /**
25 | * Return image format
26 | *
27 | * @param data the input image data
28 | *
29 | * @return the image format as `SDImageFormat` (enum)
30 | */
31 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) Fabrice Aneche
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import "NSData+ImageContentType.h"
11 |
12 |
13 | @implementation NSData (ImageContentType)
14 |
15 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data {
16 | if (!data) {
17 | return SDImageFormatUndefined;
18 | }
19 |
20 | uint8_t c;
21 | [data getBytes:&c length:1];
22 | switch (c) {
23 | case 0xFF:
24 | return SDImageFormatJPEG;
25 | case 0x89:
26 | return SDImageFormatPNG;
27 | case 0x47:
28 | return SDImageFormatGIF;
29 | case 0x49:
30 | case 0x4D:
31 | return SDImageFormatTIFF;
32 | case 0x52:
33 | // R as RIFF for WEBP
34 | if (data.length < 12) {
35 | return SDImageFormatUndefined;
36 | }
37 |
38 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding];
39 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) {
40 | return SDImageFormatWebP;
41 | }
42 | }
43 | return SDImageFormatUndefined;
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCompat.h"
10 |
11 | #if SD_MAC
12 |
13 | #import
14 |
15 | @interface NSImage (WebCache)
16 |
17 | - (CGImageRef)CGImage;
18 | - (NSArray *)images;
19 | - (BOOL)isGIF;
20 |
21 | @end
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "NSImage+WebCache.h"
10 |
11 | #if SD_MAC
12 |
13 | @implementation NSImage (WebCache)
14 |
15 | - (CGImageRef)CGImage {
16 | NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height);
17 | CGImageRef cgImage = [self CGImageForProposedRect:&imageRect context:NULL hints:nil];
18 | return cgImage;
19 | }
20 |
21 | - (NSArray *)images {
22 | return nil;
23 | }
24 |
25 | - (BOOL)isGIF {
26 | return NO;
27 | }
28 |
29 | @end
30 |
31 | #endif
32 |
33 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h:
--------------------------------------------------------------------------------
1 | //
2 | // SDImageCacheConfig.h
3 | // SDWebImage
4 | //
5 | // Created by Bogdan on 09/09/16.
6 | // Copyright © 2016 Dailymotion. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "SDWebImageCompat.h"
11 |
12 | @interface SDImageCacheConfig : NSObject
13 |
14 | /**
15 | * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory.
16 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption.
17 | */
18 | @property (assign, nonatomic) BOOL shouldDecompressImages;
19 |
20 | /**
21 | * disable iCloud backup [defaults to YES]
22 | */
23 | @property (assign, nonatomic) BOOL shouldDisableiCloud;
24 |
25 | /**
26 | * use memory cache [defaults to YES]
27 | */
28 | @property (assign, nonatomic) BOOL shouldCacheImagesInMemory;
29 |
30 | /**
31 | * The maximum length of time to keep an image in the cache, in seconds
32 | */
33 | @property (assign, nonatomic) NSInteger maxCacheAge;
34 |
35 | /**
36 | * The maximum size of the cache, in bytes.
37 | */
38 | @property (assign, nonatomic) NSUInteger maxCacheSize;
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDImageCacheConfig.m
3 | // SDWebImage
4 | //
5 | // Created by Bogdan on 09/09/16.
6 | // Copyright © 2016 Dailymotion. All rights reserved.
7 | //
8 |
9 | #import "SDImageCacheConfig.h"
10 |
11 | static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
12 |
13 | @implementation SDImageCacheConfig
14 |
15 | - (instancetype)init {
16 | if (self = [super init]) {
17 | _shouldDecompressImages = YES;
18 | _shouldDisableiCloud = YES;
19 | _shouldCacheImagesInMemory = YES;
20 | _maxCacheAge = kDefaultCacheMaxCacheAge;
21 | _maxCacheSize = 0;
22 | }
23 | return self;
24 | }
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCompat.h"
10 |
11 | #if !__has_feature(objc_arc)
12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag
13 | #endif
14 |
15 | inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) {
16 | if (!image) {
17 | return nil;
18 | }
19 |
20 | #if SD_MAC
21 | return image;
22 | #elif SD_UIKIT || SD_WATCH
23 | if ((image.images).count > 0) {
24 | NSMutableArray *scaledImages = [NSMutableArray array];
25 |
26 | for (UIImage *tempImage in image.images) {
27 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)];
28 | }
29 |
30 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration];
31 | }
32 | else {
33 | #if SD_WATCH
34 | if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) {
35 | #elif SD_UIKIT
36 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
37 | #endif
38 | CGFloat scale = 1;
39 | if (key.length >= 8) {
40 | NSRange range = [key rangeOfString:@"@2x."];
41 | if (range.location != NSNotFound) {
42 | scale = 2.0;
43 | }
44 |
45 | range = [key rangeOfString:@"@3x."];
46 | if (range.location != NSNotFound) {
47 | scale = 3.0;
48 | }
49 | }
50 |
51 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation];
52 | image = scaledImage;
53 | }
54 | return image;
55 | }
56 | #endif
57 | }
58 |
59 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain";
60 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) james
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import
11 | #import "SDWebImageCompat.h"
12 |
13 | @interface UIImage (ForceDecode)
14 |
15 | + (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image;
16 |
17 | + (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 |
11 | @protocol SDWebImageOperation
12 |
13 | - (void)cancel;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) Laurin Brandner
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import "SDWebImageCompat.h"
11 |
12 | @interface UIImage (GIF)
13 |
14 | /**
15 | * Compatibility method - creates an animated UIImage from an NSData, it will only contain the 1st frame image
16 | */
17 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data;
18 |
19 | /**
20 | * Checks if an UIImage instance is a GIF. Will use the `images` array
21 | */
22 | - (BOOL)isGIF;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/UIImage+GIF.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) Laurin Brandner
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import "UIImage+GIF.h"
11 | #import
12 | #import "objc/runtime.h"
13 | #import "NSImage+WebCache.h"
14 |
15 | @implementation UIImage (GIF)
16 |
17 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data {
18 | if (!data) {
19 | return nil;
20 | }
21 |
22 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
23 |
24 | size_t count = CGImageSourceGetCount(source);
25 |
26 | UIImage *staticImage;
27 |
28 | if (count <= 1) {
29 | staticImage = [[UIImage alloc] initWithData:data];
30 | } else {
31 | // we will only retrieve the 1st frame. the full GIF support is available via the FLAnimatedImageView category.
32 | // this here is only code to allow drawing animated images as static ones
33 | #if SD_WATCH
34 | CGFloat scale = 1;
35 | scale = [WKInterfaceDevice currentDevice].screenScale;
36 | #elif SD_UIKIT
37 | CGFloat scale = 1;
38 | scale = [UIScreen mainScreen].scale;
39 | #endif
40 |
41 | CGImageRef CGImage = CGImageSourceCreateImageAtIndex(source, 0, NULL);
42 | #if SD_UIKIT || SD_WATCH
43 | UIImage *frameImage = [UIImage imageWithCGImage:CGImage scale:scale orientation:UIImageOrientationUp];
44 | staticImage = [UIImage animatedImageWithImages:@[frameImage] duration:0.0f];
45 | #elif SD_MAC
46 | staticImage = [[UIImage alloc] initWithCGImage:CGImage size:NSZeroSize];
47 | #endif
48 | CGImageRelease(CGImage);
49 | }
50 |
51 | CFRelease(source);
52 |
53 | return staticImage;
54 | }
55 |
56 | - (BOOL)isGIF {
57 | return (self.images != nil);
58 | }
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCompat.h"
10 | #import "NSData+ImageContentType.h"
11 |
12 | @interface UIImage (MultiFormat)
13 |
14 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data;
15 | - (nullable NSData *)sd_imageData;
16 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCompat.h"
10 |
11 | #if SD_UIKIT || SD_MAC
12 |
13 | #import "SDWebImageManager.h"
14 |
15 | @interface UIView (WebCacheOperation)
16 |
17 | /**
18 | * Set the image load operation (storage in a UIView based dictionary)
19 | *
20 | * @param operation the operation
21 | * @param key key for storing the operation
22 | */
23 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key;
24 |
25 | /**
26 | * Cancel all operations for the current UIView and key
27 | *
28 | * @param key key for identifying the operations
29 | */
30 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key;
31 |
32 | /**
33 | * Just remove the operations corresponding to the current UIView and key without cancelling them
34 | *
35 | * @param key key for identifying the operations
36 | */
37 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key;
38 |
39 | @end
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/IGListKit/IGListKit-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_IGListKit : NSObject
3 | @end
4 | @implementation PodsDummy_IGListKit
5 | @end
6 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/IGListKit/IGListKit-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/IGListKit/IGListKit.modulemap:
--------------------------------------------------------------------------------
1 | framework module IGListKit {
2 | umbrella header "IGListKit-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/IGListKit/IGListKit.xcconfig:
--------------------------------------------------------------------------------
1 | CLANG_CXX_LANGUAGE_STANDARD = c++11
2 | CLANG_CXX_LIBRARY = libc++
3 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/IGListKit
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
6 | OTHER_LDFLAGS = -l"c++" -framework "UIKit"
7 | PODS_BUILD_DIR = $BUILD_DIR
8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
9 | PODS_ROOT = ${SRCROOT}
10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/IGListKit
11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
12 | SKIP_INSTALL = YES
13 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/IGListKit/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 3.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/Pods-ModelingAndBinding/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/Pods-ModelingAndBinding/Pods-ModelingAndBinding-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_ModelingAndBinding : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_ModelingAndBinding
5 | @end
6 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/Pods-ModelingAndBinding/Pods-ModelingAndBinding-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_ModelingAndBindingVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_ModelingAndBindingVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/Pods-ModelingAndBinding/Pods-ModelingAndBinding.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/IGListKit" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/IGListKit/IGListKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage/SDWebImage.framework/Headers"
5 | OTHER_LDFLAGS = $(inherited) -framework "IGListKit" -framework "SDWebImage"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/Pods-ModelingAndBinding/Pods-ModelingAndBinding.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_ModelingAndBinding {
2 | umbrella header "Pods-ModelingAndBinding-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/Pods-ModelingAndBinding/Pods-ModelingAndBinding.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/IGListKit" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/IGListKit/IGListKit.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage/SDWebImage.framework/Headers"
5 | OTHER_LDFLAGS = $(inherited) -framework "IGListKit" -framework "SDWebImage"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/SDWebImage/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 4.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SDWebImage : NSObject
3 | @end
4 | @implementation PodsDummy_SDWebImage
5 | @end
6 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "NSData+ImageContentType.h"
14 | #import "NSImage+WebCache.h"
15 | #import "SDImageCache.h"
16 | #import "SDImageCacheConfig.h"
17 | #import "SDWebImageCompat.h"
18 | #import "SDWebImageDecoder.h"
19 | #import "SDWebImageDownloader.h"
20 | #import "SDWebImageDownloaderOperation.h"
21 | #import "SDWebImageManager.h"
22 | #import "SDWebImageOperation.h"
23 | #import "SDWebImagePrefetcher.h"
24 | #import "UIButton+WebCache.h"
25 | #import "UIImage+GIF.h"
26 | #import "UIImage+MultiFormat.h"
27 | #import "UIImageView+HighlightedWebCache.h"
28 | #import "UIImageView+WebCache.h"
29 | #import "UIView+WebCache.h"
30 | #import "UIView+WebCacheOperation.h"
31 |
32 | FOUNDATION_EXPORT double SDWebImageVersionNumber;
33 | FOUNDATION_EXPORT const unsigned char SDWebImageVersionString[];
34 |
35 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap:
--------------------------------------------------------------------------------
1 | framework module SDWebImage {
2 | umbrella header "SDWebImage-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/ModelingAndBinding-Starter/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SDWebImage
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
4 | OTHER_LDFLAGS = -framework "ImageIO"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/ActionCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ActionCell.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import IGListKit
11 |
12 | protocol ActionCellDelegate: class {
13 | func didTapHeart(cell: ActionCell)
14 | }
15 |
16 | final class ActionCell: UICollectionViewCell, ListBindable {
17 |
18 | @IBOutlet weak var likesLabel: UILabel!
19 | @IBOutlet weak var likeButton: UIButton!
20 | weak var delegate: ActionCellDelegate? = nil
21 |
22 | override func awakeFromNib() {
23 | super.awakeFromNib()
24 | likeButton.addTarget(self, action: #selector(ActionCell.onHeart), for: .touchUpInside)
25 | }
26 |
27 | func onHeart() {
28 | delegate?.didTapHeart(cell: self)
29 | }
30 |
31 | // MARK: ListBindable
32 |
33 | func bindViewModel(_ viewModel: Any) {
34 | guard let viewModel = viewModel as? ActionViewModel else { return }
35 | likesLabel.text = "\(viewModel.likes)"
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/ActionViewModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ActionViewModel.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import IGListKit
11 |
12 | final class ActionViewModel: ListDiffable {
13 |
14 | let likes: Int
15 |
16 | init(likes: Int) {
17 | self.likes = likes
18 | }
19 |
20 | // MARK: ListDiffable
21 |
22 | func diffIdentifier() -> NSObjectProtocol {
23 | return "action" as NSObjectProtocol
24 | }
25 |
26 | func isEqual(toDiffableObject object: ListDiffable?) -> Bool {
27 | guard let object = object as? ActionViewModel else { return false }
28 | return likes == object.likes
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/Comment.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Comment.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import IGListKit
11 |
12 | final class Comment: ListDiffable {
13 |
14 | let username: String
15 | let text: String
16 |
17 | init(username: String, text: String) {
18 | self.username = username
19 | self.text = text
20 | }
21 |
22 | // MARK: ListDiffable
23 |
24 | func diffIdentifier() -> NSObjectProtocol {
25 | return (username + text) as NSObjectProtocol
26 | }
27 |
28 | func isEqual(toDiffableObject object: ListDiffable?) -> Bool {
29 | return true
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/CommentCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CommentCell.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import IGListKit
11 |
12 | final class CommentCell: UICollectionViewCell, ListBindable {
13 |
14 | @IBOutlet weak var usernameLabel: UILabel!
15 | @IBOutlet weak var commentLabel: UILabel!
16 |
17 | // MARK: ListBindable
18 |
19 | func bindViewModel(_ viewModel: Any) {
20 | guard let viewModel = viewModel as? Comment else { return }
21 | usernameLabel.text = viewModel.username
22 | commentLabel.text = viewModel.text
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/ImageCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ImageCell.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SDWebImage
11 | import IGListKit
12 |
13 | final class ImageCell: UICollectionViewCell, ListBindable {
14 |
15 | @IBOutlet weak var imageView: UIImageView!
16 |
17 | // MARK: ListBindable
18 |
19 | func bindViewModel(_ viewModel: Any) {
20 | guard let viewModel = viewModel as? ImageViewModel else { return }
21 | imageView.sd_setImage(with: viewModel.url)
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/ImageViewModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ImageViewModel.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import IGListKit
11 |
12 | final class ImageViewModel: ListDiffable {
13 |
14 | let url: URL
15 |
16 | init(url: URL) {
17 | self.url = url
18 | }
19 |
20 | // MARK: ListDiffable
21 |
22 | func diffIdentifier() -> NSObjectProtocol {
23 | return "image" as NSObjectProtocol
24 | }
25 |
26 | func isEqual(toDiffableObject object: ListDiffable?) -> Bool {
27 | guard let object = object as? ImageViewModel else { return false }
28 | return url == object.url
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/Post.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Post.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import IGListKit
11 |
12 | final class Post: ListDiffable {
13 |
14 | let username: String
15 | let timestamp: String
16 | let imageURL: URL
17 | let likes: Int
18 | let comments: [Comment]
19 |
20 | init(username: String, timestamp: String, imageURL: URL, likes: Int, comments: [Comment]) {
21 | self.username = username
22 | self.timestamp = timestamp
23 | self.imageURL = imageURL
24 | self.likes = likes
25 | self.comments = comments
26 | }
27 |
28 | // MARK: ListDiffable
29 |
30 | func diffIdentifier() -> NSObjectProtocol {
31 | return (username + timestamp) as NSObjectProtocol
32 | }
33 |
34 | func isEqual(toDiffableObject object: ListDiffable?) -> Bool {
35 | return true
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/UserCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UserCell.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import IGListKit
11 |
12 | final class UserCell: UICollectionViewCell, ListBindable {
13 |
14 | @IBOutlet weak var usernameLabel: UILabel!
15 | @IBOutlet weak var dateLabel: UILabel!
16 |
17 | // MARK: ListBindable
18 |
19 | func bindViewModel(_ viewModel: Any) {
20 | guard let viewModel = viewModel as? UserViewModel else { return }
21 | usernameLabel.text = viewModel.username
22 | dateLabel.text = viewModel.timestamp
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/UserViewModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UserViewModel.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import IGListKit
11 |
12 | final class UserViewModel: ListDiffable {
13 |
14 | let username: String
15 | let timestamp: String
16 |
17 | init(username: String, timestamp: String) {
18 | self.username = username
19 | self.timestamp = timestamp
20 | }
21 |
22 | // MARK: ListDiffable
23 |
24 | func diffIdentifier() -> NSObjectProtocol {
25 | return "user" as NSObjectProtocol
26 | }
27 |
28 | func isEqual(toDiffableObject object: ListDiffable?) -> Bool {
29 | guard let object = object as? UserViewModel else { return false }
30 | return username == object.username
31 | && timestamp == object.timestamp
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/ModelingAndBinding/ModelingAndBinding/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // ModelingAndBinding
4 | //
5 | // Created by Ryan Nystrom on 8/18/17.
6 | // Copyright © 2017 Ryan Nystrom. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import IGListKit
11 |
12 | class ViewController: UIViewController, ListAdapterDataSource {
13 |
14 | var data = [ListDiffable]()
15 | @IBOutlet weak var collectionView: UICollectionView!
16 | lazy var adapter: ListAdapter = { return ListAdapter(updater: ListAdapterUpdater(), viewController: self) }()
17 |
18 | override func viewDidLoad() {
19 | super.viewDidLoad()
20 |
21 | data.append(Post(
22 | username: "@janedoe",
23 | timestamp: "15min",
24 | imageURL: URL(string: "https://placekitten.com/g/375/250")!,
25 | likes: 384,
26 | comments: [
27 | Comment(username: "@ryan", text: "this is beautiful!"),
28 | Comment(username: "@jsq", text: "😱"),
29 | Comment(username: "@caitlin", text: "#blessed"),
30 | ]
31 | ))
32 |
33 | adapter.dataSource = self
34 | adapter.collectionView = self.collectionView
35 | }
36 |
37 | // MARK: ListAdapterDataSource
38 |
39 | func objects(for listAdapter: ListAdapter) -> [ListDiffable] {
40 | return data
41 | }
42 |
43 | func listAdapter(
44 | _ listAdapter: ListAdapter,
45 | sectionControllerFor object: Any
46 | ) -> ListSectionController {
47 | return PostSectionController()
48 | }
49 |
50 | func emptyView(for listAdapter: ListAdapter) -> UIView? { return nil }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | platform :ios, '10.0'
3 |
4 | use_frameworks!
5 |
6 | target 'ModelingAndBinding' do
7 | pod 'IGListKit', :git => 'https://github.com/Instagram/IGListKit.git', :branch => 'master'
8 | pod 'SDWebImage', '~> 4.0.0'
9 | end
10 |
11 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - IGListKit (3.0.0):
3 | - IGListKit/Default (= 3.0.0)
4 | - IGListKit/Default (3.0.0):
5 | - IGListKit/Diffing
6 | - IGListKit/Diffing (3.0.0)
7 | - SDWebImage (4.0.0):
8 | - SDWebImage/Core (= 4.0.0)
9 | - SDWebImage/Core (4.0.0)
10 |
11 | DEPENDENCIES:
12 | - IGListKit (from `https://github.com/Instagram/IGListKit.git`, branch `master`)
13 | - SDWebImage (~> 4.0.0)
14 |
15 | EXTERNAL SOURCES:
16 | IGListKit:
17 | :branch: master
18 | :git: https://github.com/Instagram/IGListKit.git
19 |
20 | CHECKOUT OPTIONS:
21 | IGListKit:
22 | :commit: 5ca167806b9db66ff119a5f8ae698e623a495b02
23 | :git: https://github.com/Instagram/IGListKit.git
24 |
25 | SPEC CHECKSUMS:
26 | IGListKit: 9eab6856a15fa25ad72018ff9d9eb2178c240fff
27 | SDWebImage: 76a6348bdc74eb5a55dd08a091ef298e56b55e41
28 |
29 | PODFILE CHECKSUM: eb00e38c136123051b9c6c11828b6883d0d823f9
30 |
31 | COCOAPODS: 1.3.1
32 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/LICENSE.md:
--------------------------------------------------------------------------------
1 | BSD License
2 |
3 | For `IGListKit` software
4 |
5 | Copyright (c) 2016, Facebook, Inc. All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without modification,
8 | are permitted provided that the following conditions are met:
9 |
10 | * Redistributions of source code must retain the above copyright notice, this
11 | list of conditions and the following disclaimer.
12 |
13 | * Redistributions in binary form must reproduce the above copyright notice,
14 | this list of conditions and the following disclaimer in the documentation
15 | and/or other materials provided with the distribution.
16 |
17 | * Neither the name Facebook nor the names of its contributors may be used to
18 | endorse or promote products derived from this software without specific
19 | prior written permission.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/IGListAssert.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #ifndef IGAssert
11 | #define IGAssert( condition, ... ) NSCAssert( (condition) , ##__VA_ARGS__)
12 | #endif // IGAssert
13 |
14 | #ifndef IGFailAssert
15 | #define IGFailAssert( ... ) IGAssert( (NO) , ##__VA_ARGS__)
16 | #endif // IGFailAssert
17 |
18 | #ifndef IGParameterAssert
19 | #define IGParameterAssert( condition ) IGAssert( (condition) , @"Invalid parameter not satisfying: %@", @#condition)
20 | #endif // IGParameterAssert
21 |
22 | #ifndef IGAssertMainThread
23 | #define IGAssertMainThread() IGAssert( ([NSThread isMainThread] == YES), @"Must be on the main thread")
24 | #endif // IGAssertMainThread
25 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/IGListCompatibility.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR
13 | #import
14 | #else
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/IGListDiffKit.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | /**
13 | * Project version number for IGListKit.
14 | */
15 | FOUNDATION_EXPORT double IGListKitVersionNumber;
16 |
17 | /**
18 | * Project version string for IGListKit.
19 | */
20 | FOUNDATION_EXPORT const unsigned char IGListKitVersionString[];
21 |
22 | #import
23 | #import
24 | #import
25 | #import
26 | #import
27 | #import
28 | #import
29 | #import
30 | #import
31 | #import
32 | #import
33 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/IGListDiffable.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | /**
13 | The `IGListDiffable` protocol provides methods needed to compare the identity and equality of two objects.
14 | */
15 | NS_SWIFT_NAME(ListDiffable)
16 | @protocol IGListDiffable
17 |
18 | /**
19 | Returns a key that uniquely identifies the object.
20 |
21 | @return A key that can be used to uniquely identify the object.
22 |
23 | @note Two objects may share the same identifier, but are not equal. A common pattern is to use the `NSObject`
24 | category for automatic conformance. However this means that objects will be identified on their
25 | pointer value so finding updates becomes impossible.
26 |
27 | @warning This value should never be mutated.
28 | */
29 | - (nonnull id)diffIdentifier;
30 |
31 | /**
32 | Returns whether the receiver and a given object are equal.
33 |
34 | @param object The object to be compared to the receiver.
35 |
36 | @return `YES` if the receiver and object are equal, otherwise `NO`.
37 | */
38 | - (BOOL)isEqualToDiffableObject:(nullable id)object;
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/IGListMacros.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #ifndef IGLK_SUBCLASSING_RESTRICTED
11 | #if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted)
12 | #define IGLK_SUBCLASSING_RESTRICTED __attribute__((objc_subclassing_restricted))
13 | #else
14 | #define IGLK_SUBCLASSING_RESTRICTED
15 | #endif // #if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted)
16 | #endif // #ifndef IGLK_SUBCLASSING_RESTRICTED
17 |
18 | #ifndef IGLK_UNAVAILABLE
19 | #define IGLK_UNAVAILABLE(message) __attribute__((unavailable(message)))
20 | #endif // #ifndef IGLK_UNAVAILABLE
21 |
22 | #if IGLK_LOGGING_ENABLED
23 | #define IGLKLog( s, ... ) do { NSLog( @"IGListKit: %@", [NSString stringWithFormat: (s), ##__VA_ARGS__] ); } while(0)
24 | #else
25 | #define IGLKLog( s, ... )
26 | #endif
27 |
28 | #ifndef IGLK_DEBUG_DESCRIPTION_ENABLED
29 | #define IGLK_DEBUG_DESCRIPTION_ENABLED DEBUG
30 | #endif // #ifndef IGLK_DEBUG_DESCRIPTION_ENABLED
31 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/IGListMoveIndex.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | /**
15 | An object representing a move between indexes.
16 | */
17 | NS_SWIFT_NAME(ListMoveIndex)
18 | @interface IGListMoveIndex : NSObject
19 |
20 | /**
21 | An index in the old collection.
22 | */
23 | @property (nonatomic, assign, readonly) NSInteger from;
24 |
25 | /**
26 | An index in the new collection.
27 | */
28 | @property (nonatomic, assign, readonly) NSInteger to;
29 |
30 | /**
31 | :nodoc:
32 | */
33 | - (instancetype)init NS_UNAVAILABLE;
34 |
35 | /**
36 | :nodoc:
37 | */
38 | + (instancetype)new NS_UNAVAILABLE;
39 |
40 | @end
41 |
42 | NS_ASSUME_NONNULL_END
43 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/IGListMoveIndex.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListMoveIndex.h"
11 | #import "IGListMoveIndexInternal.h"
12 |
13 | @implementation IGListMoveIndex
14 |
15 | - (instancetype)initWithFrom:(NSInteger)from to:(NSInteger)to {
16 | if (self = [super init]) {
17 | _from = from;
18 | _to = to;
19 | }
20 | return self;
21 | }
22 |
23 | - (NSUInteger)hash {
24 | return _from ^ _to;
25 | }
26 |
27 | - (BOOL)isEqual:(id)object {
28 | if (object == self) {
29 | return YES;
30 | }
31 | if ([object isKindOfClass:[IGListMoveIndex class]]) {
32 | const NSInteger f1 = self.from, f2 = [object from];
33 | const NSInteger t1 = self.to, t2 = [object to];
34 | return f1 == f2 && t1 == t2;
35 | }
36 | return NO;
37 | }
38 |
39 | - (NSComparisonResult)compare:(id)object {
40 | const NSInteger right = [object from];
41 | const NSInteger left = [self from];
42 | if (left == right) {
43 | return NSOrderedSame;
44 | } else if (left < right) {
45 | return NSOrderedAscending;
46 | } else {
47 | return NSOrderedDescending;
48 | }
49 | }
50 |
51 | - (NSString *)description {
52 | return [NSString stringWithFormat:@"<%@ %p; from: %zi; to: %zi;>", NSStringFromClass(self.class), self, self.from, self.to];
53 | }
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/IGListMoveIndexPath.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | /**
15 | An object representing a move between indexes.
16 | */
17 | NS_SWIFT_NAME(ListMoveIndexPath)
18 | @interface IGListMoveIndexPath : NSObject
19 |
20 | /**
21 | An index path in the old collection.
22 | */
23 | @property (nonatomic, strong, readonly) NSIndexPath *from;
24 |
25 | /**
26 | An index path in the new collection.
27 | */
28 | @property (nonatomic, strong, readonly) NSIndexPath *to;
29 |
30 | /**
31 | :nodoc:
32 | */
33 | - (instancetype)init NS_UNAVAILABLE;
34 |
35 | /**
36 | :nodoc:
37 | */
38 | + (instancetype)new NS_UNAVAILABLE;
39 |
40 | @end
41 |
42 | NS_ASSUME_NONNULL_END
43 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/IGListMoveIndexPath.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListMoveIndexPath.h"
11 | #import "IGListMoveIndexPathInternal.h"
12 |
13 | #import
14 |
15 | @implementation IGListMoveIndexPath
16 |
17 | - (instancetype)initWithFrom:(NSIndexPath *)from to:(NSIndexPath *)to {
18 | NSParameterAssert(from != nil);
19 | NSParameterAssert(to != nil);
20 | if (self = [super init]) {
21 | _from = from;
22 | _to = to;
23 | }
24 | return self;
25 | }
26 |
27 | - (NSUInteger)hash {
28 | return [_from hash] ^ [_to hash];
29 | }
30 |
31 | - (BOOL)isEqual:(id)object {
32 | if (object == self) {
33 | return YES;
34 | }
35 | if ([object isKindOfClass:[IGListMoveIndexPath class]]) {
36 | NSIndexPath *f1 = self.from, *f2 = [object from];
37 | NSIndexPath *t1 = self.to, *t2 = [object to];
38 | return [f1 isEqual:f2] && [t1 isEqual:t2];
39 | }
40 | return NO;
41 | }
42 |
43 | - (NSComparisonResult)compare:(id)object {
44 | return [[self from] compare:[object from]];
45 | }
46 |
47 | - (NSString *)description {
48 | return [NSString stringWithFormat:@"<%@ %p; from: %@; to: %@;>", NSStringFromClass(self.class), self, self.from, self.to];
49 | }
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/Internal/IGListIndexPathResultInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | @interface IGListIndexPathResult()
17 |
18 | - (instancetype)initWithInserts:(NSArray *)inserts
19 | deletes:(NSArray *)deletes
20 | updates:(NSArray *)updates
21 | moves:(NSArray *)moves
22 | oldIndexPathMap:(NSMapTable, NSIndexPath *> *)oldIndexPathMap
23 | newIndexPathMap:(NSMapTable, NSIndexPath *> *)newIndexPathMap;
24 |
25 | @property (nonatomic, assign, readonly) NSInteger changeCount;
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/Internal/IGListIndexSetResultInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | @interface IGListIndexSetResult()
17 |
18 | - (instancetype)initWithInserts:(NSIndexSet *)inserts
19 | deletes:(NSIndexSet *)deletes
20 | updates:(NSIndexSet *)updates
21 | moves:(NSArray *)moves
22 | oldIndexMap:(NSMapTable, NSNumber *> *)oldIndexMap
23 | newIndexMap:(NSMapTable, NSNumber *> *)newIndexMap;
24 |
25 | @property (nonatomic, assign, readonly) NSInteger changeCount;
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/Internal/IGListMoveIndexInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | @interface IGListMoveIndex ()
17 |
18 | - (instancetype)initWithFrom:(NSInteger)from to:(NSInteger)to NS_DESIGNATED_INITIALIZER;
19 |
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/Internal/IGListMoveIndexPathInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface IGListMoveIndexPath ()
15 |
16 | - (instancetype)initWithFrom:(NSIndexPath *)from to:(NSIndexPath *)to NS_DESIGNATED_INITIALIZER;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/NSNumber+IGListDiffable.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | /**
15 | This category provides default `IGListDiffable` conformance for `NSNumber`.
16 | */
17 | @interface NSNumber (IGListDiffable)
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/NSNumber+IGListDiffable.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "NSNumber+IGListDiffable.h"
11 |
12 | @implementation NSNumber (IGListDiffable)
13 |
14 | - (id)diffIdentifier {
15 | return self;
16 | }
17 |
18 | - (BOOL)isEqualToDiffableObject:(id)object {
19 | return [self isEqual:object];
20 | }
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/NSString+IGListDiffable.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | /**
15 | This category provides default `IGListDiffable` conformance for `NSString`.
16 | */
17 | @interface NSString (IGListDiffable)
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Common/NSString+IGListDiffable.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "NSString+IGListDiffable.h"
11 |
12 | @implementation NSString (IGListDiffable)
13 |
14 | - (id)diffIdentifier {
15 | return self;
16 | }
17 |
18 | - (BOOL)isEqualToDiffableObject:(id)object {
19 | return [self isEqual:object];
20 | }
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/IGListAdapterDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListAdapter;
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | Conform to `IGListAdapterDelegate` to receive display events for objects in a list.
18 | */
19 | @protocol IGListAdapterDelegate
20 |
21 | /**
22 | Notifies the delegate that a list object is about to be displayed.
23 |
24 | @param listAdapter The list adapter sending this information.
25 | @param object The object that will display.
26 | @param index The index of the object in the list.
27 | */
28 | - (void)listAdapter:(IGListAdapter *)listAdapter willDisplayObject:(id)object atIndex:(NSInteger)index;
29 |
30 | /**
31 | Notifies the delegate that a list object is no longer being displayed.
32 |
33 | @param listAdapter The list adapter sending this information.
34 | @param object The object that ended display.
35 | @param index The index of the object in the list.
36 | */
37 | - (void)listAdapter:(IGListAdapter *)listAdapter didEndDisplayingObject:(id)object atIndex:(NSInteger)index;
38 |
39 | @end
40 |
41 | NS_ASSUME_NONNULL_END
42 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/IGListBindable.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | /**
15 | A protocol for cells that configure themselves given a view model.
16 | */
17 | NS_SWIFT_NAME(ListBindable)
18 | @protocol IGListBindable
19 |
20 | /**
21 | Tells the cell to configure itself with the given view model.
22 |
23 | @param viewModel The view model for the cell.
24 |
25 | @note The view model can change many times throughout the lifetime of a cell as the model values change and the cell
26 | is reused. Implementations should use only this method to do their configuration.
27 | */
28 | - (void)bindViewModel:(id)viewModel;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/IGListBindingSectionControllerSelectionDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListBindingSectionController;
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | A protocol that handles cell selection events in an `IGListBindingSectionController`.
18 | */
19 | NS_SWIFT_NAME(ListBindingSectionControllerSelectionDelegate)
20 | @protocol IGListBindingSectionControllerSelectionDelegate
21 |
22 | /**
23 | Tells the delegate that a cell at a given index was selected.
24 |
25 | @param sectionController The section controller the selection occurred in.
26 | @param index The index of the selected cell.
27 | @param viewModel The view model that was bound to the cell.
28 | */
29 | - (void)sectionController:(IGListBindingSectionController *)sectionController
30 | didSelectItemAtIndex:(NSInteger)index
31 | viewModel:(id)viewModel;
32 |
33 | /**
34 | Tells the delegate that a cell at a given index was deselected.
35 |
36 | @param sectionController The section controller the deselection occurred in.
37 | @param index The index of the deselected cell.
38 | @param viewModel The view model that was bound to the cell.
39 |
40 | @note Method is `@optional` until the 4.0.0 release where it will become required.
41 | */
42 | @optional
43 | - (void)sectionController:(IGListBindingSectionController *)sectionController
44 | didDeselectItemAtIndex:(NSInteger)index
45 | viewModel:(id)viewModel;
46 |
47 | @end
48 |
49 | NS_ASSUME_NONNULL_END
50 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/IGListGenericSectionController.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | /**
15 | This class adds a helper layer to `IGListSectionController` to automatically store a generic object in
16 | `didUpdateToObject:`.
17 | */
18 | NS_SWIFT_NAME(ListGenericSectionController)
19 | @interface IGListGenericSectionController<__covariant ObjectType> : IGListSectionController
20 |
21 | /**
22 | The object mapped to this section controller. Matches the object provided in
23 | `[IGListAdapterDataSource listAdapter:sectionControllerForObject:]` when this section controller was created and
24 | returned.
25 |
26 | @note This object is briefly `nil` between initialization and the first call to `didUpdateToObject:`. After that, it is
27 | safe to assume that this is non-`nil`.
28 | */
29 | @property (nonatomic, strong, nullable, readonly) ObjectType object;
30 |
31 | /**
32 | Updates the section controller to a new object.
33 |
34 | @param object The object mapped to this section controller.
35 |
36 | @note This `IGListSectionController` subclass sets its object in this method, so any overrides **must call super**.
37 | */
38 | - (void)didUpdateToObject:(id)object NS_REQUIRES_SUPER;
39 |
40 | @end
41 |
42 | NS_ASSUME_NONNULL_END
43 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/IGListGenericSectionController.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListGenericSectionController.h"
11 |
12 | @implementation IGListGenericSectionController
13 |
14 | - (void)didUpdateToObject:(id)object {
15 | _object = object;
16 | }
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/IGListReloadDataUpdater.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 | #import
14 |
15 | NS_ASSUME_NONNULL_BEGIN
16 |
17 | /**
18 | An `IGListReloadDataUpdater` is a concrete type that conforms to `IGListUpdatingDelegate`.
19 | It is an out-of-box updater for `IGListAdapter` objects to use.
20 |
21 | @note This updater performs simple, synchronous updates using `-[UICollectionView reloadData]`.
22 | */
23 | IGLK_SUBCLASSING_RESTRICTED
24 | NS_SWIFT_NAME(ListReloadDataUpdater)
25 | @interface IGListReloadDataUpdater : NSObject
26 |
27 | @end
28 |
29 | NS_ASSUME_NONNULL_END
30 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/IGListScrollDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListAdapter;
13 | @class IGListSectionController;
14 |
15 |
16 |
17 | NS_ASSUME_NONNULL_BEGIN
18 |
19 | /**
20 | Implement this protocol to receive display events for a section controller when it is on screen.
21 | */
22 | NS_SWIFT_NAME(ListScrollDelegate)
23 | @protocol IGListScrollDelegate
24 |
25 | /**
26 | Tells the delegate that the section controller was scrolled on screen.
27 |
28 | @param listAdapter The list adapter whose collection view was scrolled.
29 | @param sectionController The visible section controller that was scrolled.
30 | */
31 | - (void)listAdapter:(IGListAdapter *)listAdapter didScrollSectionController:(IGListSectionController *)sectionController;
32 |
33 | /**
34 | Tells the delegate that the section controller will be dragged on screen.
35 |
36 | @param listAdapter The list adapter whose collection view will drag.
37 | @param sectionController The visible section controller that will drag.
38 | */
39 | - (void)listAdapter:(IGListAdapter *)listAdapter willBeginDraggingSectionController:(IGListSectionController *)sectionController;
40 |
41 | /**
42 | Tells the delegate that the section controller did end dragging on screen.
43 |
44 | @param listAdapter The list adapter whose collection view ended dragging.
45 | @param sectionController The visible section controller that ended dragging.
46 | */
47 | - (void)listAdapter:(IGListAdapter *)listAdapter didEndDraggingSectionController:(IGListSectionController *)sectionController willDecelerate:(BOOL)decelerate;
48 |
49 | @end
50 |
51 | NS_ASSUME_NONNULL_END
52 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/IGListStackedSectionController.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | An instance of `IGListStackedSectionController` is a clustered section controller, composed of many child section
18 | controllers. It constructs and routes item-level indexes to the appropriate child section controller with a local
19 | index. This lets you build section controllers made up of individual units that can be shared and reused with other
20 | section controllers.
21 |
22 | For example, you can create a "Comments" section controller that displays lists of text that is used alongside photo,
23 | video, or slideshow section controllers. You then have four small and manageable section controllers instead of one
24 | huge class.
25 | */
26 | IGLK_SUBCLASSING_RESTRICTED
27 | NS_SWIFT_NAME(ListStackedSectionController)
28 | @interface IGListStackedSectionController : IGListSectionController
29 |
30 | /**
31 | Creates a new stacked section controller.
32 |
33 | @param sectionControllers An array of section controllers that make up the stack.
34 |
35 | @note The order of the section controllers dictates the order in which they appear.
36 |
37 | @warning The first section controller that is the supplementary source decides which supplementary views get displayed.
38 | */
39 | - (instancetype)initWithSectionControllers:(NSArray *)sectionControllers NS_DESIGNATED_INITIALIZER;
40 |
41 | /**
42 | :nodoc:
43 | */
44 | - (instancetype)init NS_UNAVAILABLE;
45 |
46 | /**
47 | :nodoc:
48 | */
49 | + (instancetype)new NS_UNAVAILABLE;
50 |
51 | @end
52 |
53 | NS_ASSUME_NONNULL_END
54 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/IGListSupplementaryViewSource.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | /**
15 | Conform to this protocol to provide information about a list's supplementary views. This data is used in
16 | `IGListAdapter` which then configures and maintains a `UICollectionView`. The supplementary API reflects that in
17 | `UICollectionView`, `UICollectionViewLayout`, and `UICollectionViewDataSource`.
18 | */
19 | NS_SWIFT_NAME(ListSupplementaryViewSource)
20 | @protocol IGListSupplementaryViewSource
21 |
22 | /**
23 | Asks the SupplementaryViewSource for an array of supported element kinds.
24 |
25 | @return An array of element kind strings that the supplementary source handles.
26 | */
27 | - (NSArray *)supportedElementKinds;
28 |
29 | /**
30 | Asks the SupplementaryViewSource for a configured supplementary view for the specified kind and index.
31 |
32 | @param elementKind The kind of supplementary view being requested
33 | @param index The index for the supplementary veiw being requested.
34 |
35 | @note This is your opportunity to do any supplementary view setup and configuration.
36 |
37 | @warning You should never allocate new views in this method. Instead deque a view from the `IGListCollectionContext`.
38 | */
39 | - (__kindof UICollectionReusableView *)viewForSupplementaryElementOfKind:(NSString *)elementKind
40 | atIndex:(NSInteger)index;
41 |
42 | /**
43 | Asks the SupplementaryViewSource for the size of a supplementary view for the given kind and index path.
44 |
45 | @param elementKind The kind of supplementary view.
46 | @param index The index of the requested view.
47 |
48 | @return The size for the supplementary view.
49 | */
50 | - (CGSize)sizeForSupplementaryViewOfKind:(NSString *)elementKind
51 | atIndex:(NSInteger)index;
52 |
53 | @end
54 |
55 | NS_ASSUME_NONNULL_END
56 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/IGListWorkingRangeDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListAdapter;
13 | @class IGListSectionController;
14 |
15 |
16 |
17 | NS_ASSUME_NONNULL_BEGIN
18 |
19 | /**
20 | Implement this protocol to receive working range events for a list.
21 |
22 | The working range is a range *near* the viewport in which you can begin preparing content for display. For example,
23 | you could begin decoding images, or warming text caches.
24 | */
25 | NS_SWIFT_NAME(ListWorkingRangeDelegate)
26 | @protocol IGListWorkingRangeDelegate
27 |
28 | /**
29 | Notifies the delegate that an section controller will enter the working range.
30 |
31 | @param listAdapter The adapter controlling the list.
32 | @param sectionController The section controller entering the range.
33 | */
34 | - (void)listAdapter:(IGListAdapter *)listAdapter sectionControllerWillEnterWorkingRange:(IGListSectionController *)sectionController;
35 |
36 | /**
37 | Notifies the delegate that an section controller exited the working range.
38 |
39 | @param listAdapter The adapter controlling the list.
40 | @param sectionController The section controller that exited the range.
41 | */
42 | - (void)listAdapter:(IGListAdapter *)listAdapter sectionControllerDidExitWorkingRange:(IGListSectionController *)sectionController;
43 |
44 | @end
45 |
46 | NS_ASSUME_NONNULL_END
47 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListAdapter+DebugDescription.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface IGListAdapter (DebugDescription)
13 |
14 | - (NSArray *)debugDescriptionLines;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListAdapter+UICollectionView.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | @interface IGListAdapter (UICollectionView)
15 | <
16 | UICollectionViewDataSource,
17 | UICollectionViewDelegateFlowLayout
18 | >
19 | @end
20 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListAdapterProxy.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | @class IGListAdapter;
15 |
16 | NS_ASSUME_NONNULL_BEGIN
17 |
18 | /**
19 | A proxy that sends a custom set of selectors to an IGListAdapter object and the rest to a UICollectionViewDelegate
20 | target.
21 | */
22 | IGLK_SUBCLASSING_RESTRICTED
23 | @interface IGListAdapterProxy : NSProxy
24 |
25 | /**
26 | Create a new proxy object with targets and interceptor.
27 |
28 | @param collectionViewTarget A UICollectionViewDelegate conforming object that receives non-intercepted messages.
29 | @param scrollViewTarget A UIScrollViewDelegate conforming object that receives non-intercepted messages.
30 | @param interceptor An IGListAdapter object that intercepts a set of messages.
31 |
32 | @return A new IGListAdapterProxy object.
33 | */
34 | - (instancetype)initWithCollectionViewTarget:(nullable id)collectionViewTarget
35 | scrollViewTarget:(nullable id)scrollViewTarget
36 | interceptor:(IGListAdapter *)interceptor;
37 |
38 | /**
39 | :nodoc:
40 | */
41 | - (instancetype)init NS_UNAVAILABLE;
42 |
43 | /**
44 | :nodoc:
45 | */
46 | + (instancetype)new NS_UNAVAILABLE;
47 |
48 | @end
49 |
50 | NS_ASSUME_NONNULL_END
51 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListAdapterUpdater+DebugDescription.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface IGListAdapterUpdater (DebugDescription)
13 |
14 | - (NSArray *)debugDescriptionLines;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListBatchUpdateData+DebugDescription.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface IGListBatchUpdateData (DebugDescription)
13 |
14 | - (NSArray *)debugDescriptionLines;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListBatchUpdateData+DebugDescription.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListBatchUpdateData+DebugDescription.h"
11 |
12 | @implementation IGListBatchUpdateData (DebugDescription)
13 |
14 | - (NSArray *)debugDescriptionLines {
15 | NSMutableArray *debug = [NSMutableArray new];
16 | #if IGLK_DEBUG_DESCRIPTION_ENABLED
17 | [debug addObject:[NSString stringWithFormat:@"Insert sections: %@", self.insertSections]];
18 | [debug addObject:[NSString stringWithFormat:@"Delete sections: %@", self.deleteSections]];
19 |
20 | for (IGListMoveIndex *move in self.moveSections) {
21 | [debug addObject:[NSString stringWithFormat:@"Move from section %zi to %zi", move.from, move.to]];
22 | }
23 |
24 | for (NSIndexPath *path in self.deleteIndexPaths) {
25 | [debug addObject:[NSString stringWithFormat:@"Delete section %zi item %zi", path.section, path.item]];
26 | }
27 |
28 | for (NSIndexPath *path in self.insertIndexPaths) {
29 | [debug addObject:[NSString stringWithFormat:@"Insert section %zi item %zi", path.section, path.item]];
30 | }
31 |
32 | for (IGListMoveIndexPath *move in self.moveIndexPaths) {
33 | [debug addObject:[NSString stringWithFormat:@"Move from section %zi item %zi to section %zi item %zi",
34 | move.from.section, move.from.item, move.to.section, move.to.item]];
35 | }
36 | #endif // #if IGLK_DEBUG_DESCRIPTION_ENABLED
37 | return debug;
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListBatchUpdateState.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | typedef NS_ENUM (NSInteger, IGListBatchUpdateState) {
13 | IGListBatchUpdateStateIdle,
14 | IGListBatchUpdateStateQueuedBatchUpdate,
15 | IGListBatchUpdateStateExecutingBatchUpdateBlock,
16 | IGListBatchUpdateStateExecutedBatchUpdateBlock,
17 | };
18 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListBatchUpdates.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | @class IGListMoveIndexPath;
15 | @class IGListReloadIndexPath;
16 |
17 | IGLK_SUBCLASSING_RESTRICTED
18 | @interface IGListBatchUpdates : NSObject
19 |
20 | @property (nonatomic, strong, readonly) NSMutableIndexSet *sectionReloads;
21 | @property (nonatomic, strong, readonly) NSMutableArray *itemInserts;
22 | @property (nonatomic, strong, readonly) NSMutableArray *itemDeletes;
23 | @property (nonatomic, strong, readonly) NSMutableArray *itemReloads;
24 | @property (nonatomic, strong, readonly) NSMutableArray *itemMoves;
25 |
26 | @property (nonatomic, strong, readonly) NSMutableArray *itemUpdateBlocks;
27 | @property (nonatomic, strong, readonly) NSMutableArray *itemCompletionBlocks;
28 |
29 | - (BOOL)hasChanges;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListBatchUpdates.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListBatchUpdates.h"
11 |
12 | @implementation IGListBatchUpdates
13 |
14 | - (instancetype)init {
15 | if (self = [super init]) {
16 | _sectionReloads = [NSMutableIndexSet new];
17 | _itemInserts = [NSMutableArray new];
18 | _itemMoves = [NSMutableArray new];
19 | _itemDeletes = [NSMutableArray new];
20 | _itemReloads = [NSMutableArray new];
21 | _itemUpdateBlocks = [NSMutableArray new];
22 | _itemCompletionBlocks = [NSMutableArray new];
23 | }
24 | return self;
25 | }
26 |
27 | - (BOOL)hasChanges {
28 | return [self.itemUpdateBlocks count] > 0
29 | || [self.sectionReloads count] > 0
30 | || [self.itemInserts count] > 0
31 | || [self.itemMoves count] > 0
32 | || [self.itemReloads count] > 0
33 | || [self.itemDeletes count] > 0;
34 | }
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListBindingSectionController+DebugDescription.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface IGListBindingSectionController (DebugDescription)
13 |
14 | - (NSArray *)debugDescriptionLines;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListCollectionViewLayoutInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | static CGRect IGListRectIntegralScaled(CGRect rect) {
11 | CGFloat scale = [[UIScreen mainScreen] scale];
12 | return CGRectMake(floorf(rect.origin.x * scale) / scale,
13 | floorf(rect.origin.y * scale) / scale,
14 | ceilf(rect.size.width * scale) / scale,
15 | ceilf(rect.size.height * scale) / scale);
16 | }
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListDebugger.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | @class IGListAdapter;
15 |
16 | IGLK_SUBCLASSING_RESTRICTED
17 | @interface IGListDebugger : NSObject
18 |
19 | + (void)trackAdapter:(IGListAdapter *)adapter;
20 |
21 | + (NSArray *)adapterDescriptions;
22 |
23 | + (NSString *)dump;
24 |
25 | - (instancetype)init NS_UNAVAILABLE;
26 | + (instancetype)new NS_UNAVAILABLE;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListDebugger.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListDebugger.h"
11 |
12 | #import "IGListDebuggingUtilities.h"
13 | #import "IGListAdapter+DebugDescription.h"
14 |
15 | @implementation IGListDebugger
16 |
17 | static NSHashTable *livingAdaptersTable = nil;
18 |
19 | + (void)trackAdapter:(IGListAdapter *)adapter {
20 | #if IGLK_DEBUG_DESCRIPTION_ENABLED
21 | if (livingAdaptersTable == nil) {
22 | livingAdaptersTable = [NSHashTable weakObjectsHashTable];
23 | }
24 | [livingAdaptersTable addObject:adapter];
25 | #endif // #if IGLK_DEBUG_DESCRIPTION_ENABLED
26 | }
27 |
28 | + (NSArray *)adapterDescriptions {
29 | NSMutableArray *descriptions = [NSMutableArray new];
30 | for (IGListAdapter *adapter in livingAdaptersTable) {
31 | [descriptions addObject:[adapter debugDescription]];
32 | }
33 | return descriptions;
34 | }
35 |
36 | + (NSString *)dump {
37 | return [[self adapterDescriptions] componentsJoinedByString:@"\n"];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListDebuggingUtilities.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @class IGListAdapter;
13 |
14 | extern NSString *IGListDebugBOOL(BOOL b);
15 |
16 | extern NSArray *IGListDebugIndentedLines(NSArray *lines);
17 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListDebuggingUtilities.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListDebuggingUtilities.h"
11 |
12 | NSString *IGListDebugBOOL(BOOL b) {
13 | return b ? @"Yes" : @"No";
14 | }
15 |
16 | NSArray *IGListDebugIndentedLines(NSArray *lines) {
17 | NSMutableArray *newLines = [NSMutableArray new];
18 | for (NSString *line in lines) {
19 | [newLines addObject:[NSString stringWithFormat:@" %@", line]];
20 | }
21 | return newLines;
22 | }
23 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListReloadIndexPath.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import
13 |
14 | NS_ASSUME_NONNULL_BEGIN
15 |
16 | /**
17 | An object with index path information for reloading an item during a batch update.
18 | */
19 | IGLK_SUBCLASSING_RESTRICTED
20 | @interface IGListReloadIndexPath : NSObject
21 |
22 | /**
23 | The index path of the item before batch updates are applied.
24 | */
25 | @property (nonatomic, strong, readonly) NSIndexPath *fromIndexPath;
26 |
27 | /**
28 | The index path of the item after batch updates are applied.
29 | */
30 | @property (nonatomic, strong, readonly) NSIndexPath *toIndexPath;
31 |
32 | /**
33 | Creates a new reload object.
34 |
35 | @param fromIndexPath The index path of the item before batch updates.
36 | @param toIndexPath The index path of the item after batch updates.
37 | @return A new reload object.
38 | */
39 | - (instancetype)initWithFromIndexPath:(NSIndexPath *)fromIndexPath
40 | toIndexPath:(NSIndexPath *)toIndexPath NS_DESIGNATED_INITIALIZER;
41 |
42 | /**
43 | :nodoc:
44 | */
45 | - (instancetype)init NS_UNAVAILABLE;
46 |
47 | /**
48 | :nodoc:
49 | */
50 | + (instancetype)new NS_UNAVAILABLE;
51 |
52 | @end
53 |
54 | NS_ASSUME_NONNULL_END
55 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListReloadIndexPath.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListReloadIndexPath.h"
11 |
12 | @implementation IGListReloadIndexPath
13 |
14 | - (instancetype)initWithFromIndexPath:(NSIndexPath *)fromIndexPath
15 | toIndexPath:(NSIndexPath *)toIndexPath {
16 | if (self = [super init]) {
17 | _fromIndexPath = fromIndexPath;
18 | _toIndexPath = toIndexPath;
19 | }
20 | return self;
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListSectionControllerInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListSectionController.h"
11 |
12 | FOUNDATION_EXTERN void IGListSectionControllerPushThread(UIViewController *viewController, id collectionContext);
13 |
14 | FOUNDATION_EXTERN void IGListSectionControllerPopThread(void);
15 |
16 | @interface IGListSectionController()
17 |
18 | @property (nonatomic, weak, readwrite) id collectionContext;
19 |
20 | @property (nonatomic, weak, readwrite) UIViewController *viewController;
21 |
22 | @property (nonatomic, assign, readwrite) NSInteger section;
23 |
24 | @property (nonatomic, assign, readwrite) BOOL isFirstSection;
25 |
26 | @property (nonatomic, assign, readwrite) BOOL isLastSection;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListSectionMap+DebugDescription.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "IGListSectionMap.h"
13 |
14 | @interface IGListSectionMap (DebugDescription)
15 |
16 | - (NSArray *)debugDescriptionLines;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListSectionMap+DebugDescription.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "IGListSectionMap+DebugDescription.h"
11 | #import "IGListBindingSectionController.h"
12 |
13 | @implementation IGListSectionMap (DebugDescription)
14 |
15 | - (NSArray *)debugDescriptionLines {
16 | NSMutableArray *debug = [NSMutableArray new];
17 | #if IGLK_DEBUG_DESCRIPTION_ENABLED
18 | [self enumerateUsingBlock:^(id object, IGListSectionController *sectionController, NSInteger section, BOOL *stop) {
19 | if ([sectionController isKindOfClass:[IGListBindingSectionController class]]) {
20 | [debug addObject:[sectionController debugDescription]];
21 | } else {
22 | [debug addObject:[NSString stringWithFormat:@"Object and section controller at section: %zi:", section]];
23 | [debug addObject:[NSString stringWithFormat:@" %@", object]];
24 | [debug addObject:[NSString stringWithFormat:@" %@", sectionController]];
25 | }
26 | }];
27 | #endif // #if IGLK_DEBUG_DESCRIPTION_ENABLED
28 | return debug;
29 | }
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/ModelingAndBinding/Pods/IGListKit/Source/Internal/IGListStackedSectionControllerInternal.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import