├── readmeAssets
├── demo1.jpeg
├── demo2.jpeg
├── demo3.jpeg
├── demo4.jpeg
├── demo5.jpeg
├── demo6.jpeg
├── demo7.jpeg
└── SampleUsage.swift
├── Demo
├── ASCollectionViewDemo
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Preview Content
│ │ └── Preview Assets.xcassets
│ │ │ └── Contents.json
│ ├── Screens
│ │ ├── Reminders
│ │ │ ├── GroupModel.swift
│ │ │ ├── GroupSmall.swift
│ │ │ ├── GroupLarge.swift
│ │ │ └── RemindersScreen.swift
│ │ ├── InstaFeed
│ │ │ ├── StoryView.swift
│ │ │ ├── PostView.swift
│ │ │ └── InstaFeedScreen.swift
│ │ ├── AppStore
│ │ │ ├── App.swift
│ │ │ ├── AppViews.swift
│ │ │ └── AppStoreScreen.swift
│ │ ├── Tags
│ │ │ ├── TagStore.swift
│ │ │ └── TagsScreen.swift
│ │ ├── MagazineLayout
│ │ │ ├── MagazineLayoutScreen.swift
│ │ │ └── CustomDelegate.swift
│ │ ├── TableViewDragAndDrop
│ │ │ └── TableViewDragAndDropScreen.swift
│ │ ├── AdjustableLayout
│ │ │ └── AdjustableGridScreen.swift
│ │ ├── Waterfall
│ │ │ └── WaterfallScreen.swift
│ │ └── PhotoGrid
│ │ │ └── PhotoGridScreen.swift
│ ├── Support
│ │ ├── ASRemoteImageView.swift
│ │ ├── OnChange.swift
│ │ ├── ASRemoteImageManager.swift
│ │ └── ASCache.swift
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ └── LaunchScreen.storyboard
│ ├── MainView.swift
│ ├── Info.plist
│ ├── SharedModels
│ │ └── Post.swift
│ └── SceneDelegate.swift
├── BuildTools
│ ├── BuildTools.swift
│ ├── Package.resolved
│ └── Package.swift
├── ASCollectionViewDemo.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── swiftpm
│ │ │ └── Package.resolved
│ ├── xcuserdata
│ │ └── tobybrennan.xcuserdatad
│ │ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── ASCollectionViewDemo.xcscheme
│ │ └── ASCollectionViewDemo-ReleaseConfig.xcscheme
└── README code content.swift
├── Sources
└── ASCollectionView
│ ├── Cells
│ ├── ASSupplementaryCellID.swift
│ ├── ASCollectionViewDecoration.swift
│ ├── ASTableViewSupplementaryView.swift
│ ├── ASTableViewCell.swift
│ ├── ASCollectionViewSupplementaryView.swift
│ └── ASCollectionViewCell.swift
│ ├── Support
│ ├── RandomAccessCollection+Safe.swift
│ ├── Binding+Sequence.swift
│ ├── GlobalConvenienceFunctions.swift
│ ├── ASSelfSizingSettings.swift
│ ├── ASOptionalSize.swift
│ ├── ASIndexedDictionary.swift
│ ├── ASPriorityCache.swift
│ └── ShrinkToFitWrapper.swift
│ ├── ASCellContext.swift
│ ├── UIKitExtensions
│ ├── UIView+Convenience.swift
│ ├── UIScrollView+Convenience.swift
│ └── UICollectionView+Convenience.swift
│ ├── Config
│ ├── ClosureTypeAliases.swift
│ └── ASDragDropConfig.swift
│ ├── Environment
│ └── EnvironmentKeys.swift
│ ├── FunctionBuilders
│ ├── ViewArrayBuilder.swift
│ └── SectionArrayBuilder.swift
│ ├── UIKit
│ ├── AS_UITableView.swift
│ └── AS_UICollectionView.swift
│ ├── ASSection+Modifiers.swift
│ ├── Implementation
│ ├── ASSection.swift
│ └── ASHostingController.swift
│ ├── ASCollectionView+Initialisers.swift
│ ├── ASTableView+Initialisers.swift
│ ├── Datasource
│ ├── ASDiffableDataSourceCollectionView.swift
│ ├── ASDiffableDataSource.swift
│ └── ASDiffableDataSourceTableView.swift
│ ├── ASDragDropConfig+Public.swift
│ ├── ASTableView+Modifiers.swift
│ ├── Delegate
│ └── ASCollectionViewDelegate.swift
│ ├── ASCollectionView+Modifiers.swift
│ └── ASSection+Initialisers.swift
├── Package.resolved
├── .github
├── ISSUE_TEMPLATE
│ └── bug_report.md
├── workflows
│ └── build.yml
└── FUNDING.yml
├── .swiftformat
├── Package.swift
├── LICENSE
├── ASCollectionView-SwiftUI.podspec
└── .gitignore
/readmeAssets/demo1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apptekstudios/ASCollectionView/HEAD/readmeAssets/demo1.jpeg
--------------------------------------------------------------------------------
/readmeAssets/demo2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apptekstudios/ASCollectionView/HEAD/readmeAssets/demo2.jpeg
--------------------------------------------------------------------------------
/readmeAssets/demo3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apptekstudios/ASCollectionView/HEAD/readmeAssets/demo3.jpeg
--------------------------------------------------------------------------------
/readmeAssets/demo4.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apptekstudios/ASCollectionView/HEAD/readmeAssets/demo4.jpeg
--------------------------------------------------------------------------------
/readmeAssets/demo5.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apptekstudios/ASCollectionView/HEAD/readmeAssets/demo5.jpeg
--------------------------------------------------------------------------------
/readmeAssets/demo6.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apptekstudios/ASCollectionView/HEAD/readmeAssets/demo6.jpeg
--------------------------------------------------------------------------------
/readmeAssets/demo7.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apptekstudios/ASCollectionView/HEAD/readmeAssets/demo7.jpeg
--------------------------------------------------------------------------------
/Demo/ASCollectionViewDemo/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Demo/ASCollectionViewDemo/Preview Content/Preview Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Demo/BuildTools/BuildTools.swift:
--------------------------------------------------------------------------------
1 | // ASCollectionView. Created by Apptek Studios 2019
2 |
3 | struct BuildTools
4 | {
5 | var text = "Hello, World!"
6 | }
7 |
--------------------------------------------------------------------------------
/Demo/ASCollectionViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sources/ASCollectionView/Cells/ASSupplementaryCellID.swift:
--------------------------------------------------------------------------------
1 | // ASCollectionView. Created by Apptek Studios 2019
2 |
3 | import Foundation
4 |
5 | struct ASSupplementaryCellID: Hashable
6 | {
7 | let sectionIDHash: Int
8 | let supplementaryKind: String
9 | }
10 |
--------------------------------------------------------------------------------
/Demo/ASCollectionViewDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Package.resolved:
--------------------------------------------------------------------------------
1 | {
2 | "object": {
3 | "pins": [
4 | {
5 | "package": "DifferenceKit",
6 | "repositoryURL": "https://github.com/ra1028/DifferenceKit",
7 | "state": {
8 | "branch": null,
9 | "revision": "14c66681e12a38b81045f44c6c29724a0d4b0e72",
10 | "version": "1.1.5"
11 | }
12 | }
13 | ]
14 | },
15 | "version": 1
16 | }
17 |
--------------------------------------------------------------------------------
/Demo/BuildTools/Package.resolved:
--------------------------------------------------------------------------------
1 | {
2 | "object": {
3 | "pins": [
4 | {
5 | "package": "SwiftFormat",
6 | "repositoryURL": "https://github.com/nicklockwood/SwiftFormat",
7 | "state": {
8 | "branch": null,
9 | "revision": "337d787cae2ac7c53f3574c107d12c557002a883",
10 | "version": "0.46.3"
11 | }
12 | }
13 | ]
14 | },
15 | "version": 1
16 | }
17 |
--------------------------------------------------------------------------------
/Demo/BuildTools/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.1
2 | import PackageDescription
3 |
4 | let package = Package(
5 | name: "BuildTools",
6 | platforms: [.macOS(.v10_11)],
7 | dependencies: [// Define any tools you want available from your build phases
8 | // Here's an example with SwiftFormat
9 | .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.41.2")],
10 | targets: [.target(name: "BuildTools", path: "")])
11 |
--------------------------------------------------------------------------------
/Sources/ASCollectionView/Support/RandomAccessCollection+Safe.swift:
--------------------------------------------------------------------------------
1 | // ASCollectionView. Created by Apptek Studios 2019
2 |
3 | import Foundation
4 |
5 | extension RandomAccessCollection
6 | {
7 | public func containsIndex(_ index: Index) -> Bool
8 | {
9 | indices.contains(index)
10 | }
11 |
12 | subscript(safe index: Index) -> Element?
13 | {
14 | guard containsIndex(index) else { return nil }
15 | return self[index]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/ASCollectionView/Support/Binding+Sequence.swift:
--------------------------------------------------------------------------------
1 | // ASCollectionView. Created by Apptek Studios 2019
2 |
3 | import Foundation
4 | import SwiftUI
5 |
6 | @available(iOS 13.0, *)
7 | public extension Binding where Value == [Int: Set]
8 | {
9 | subscript(index: Int) -> Binding>
10 | {
11 | Binding>(get: {
12 | self.wrappedValue[index] ?? []
13 | }, set: {
14 | self.wrappedValue[index] = $0
15 | })
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/ASCollectionView/Support/GlobalConvenienceFunctions.swift:
--------------------------------------------------------------------------------
1 | // ASCollectionView. Created by Apptek Studios 2019
2 |
3 | import Foundation
4 |
5 | @discardableResult
6 | func assignIfChanged(_ object: Object, _ keyPath: ReferenceWritableKeyPath