Skip to content

Commit 828cfa5

Browse files
committed
- Improved structure and clarity of the README to facilitate better understanding for developers integrating with iOS/tvOS projects.
1 parent ce0466c commit 828cfa5

File tree

1 file changed

+32
-27
lines changed

1 file changed

+32
-27
lines changed

Sources/TextureIGListKitExtensions/README.md

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,49 @@ Pure Swift implementation of IGListKit integration for Texture (AsyncDisplayKit)
44

55
## Quick Summary
66

7-
- **What it does:** Connects `IGListAdapter` with `ASCollectionNode` in SPM builds
8-
- **Why needed:** SPM traits don't work with Objective-C `#if` directives
9-
- **What you get:** One Swift extension method + re-exported modules (AsyncDisplayKit, IGListKit, IGListDiffKit)
10-
- **API:** `adapter.setCollectionNode(node)` replaces `[adapter setASDKCollectionNode:node]`
11-
- **Version:** Uses IGListKit 5.0+ (breaking changes from 4.x)
7+
- **What it does:** Connects `IGListAdapter` with `ASCollectionNode` via Swift API
8+
- **Why needed:** SPM cannot export Objective-C categories on classes from other modules
9+
- **What you get:** Swift extension methods + re-exported modules (AsyncDisplayKit, IGListKit, IGListDiffKit)
10+
- **API:** `adapter.setCollectionNode(node)` (Swift-friendly wrapper)
11+
- **Version:** Compatible with IGListKit 5.0+
1212

1313
## Overview
1414

15-
This module provides a single extension method to `IGListAdapter` that enables seamless integration with `ASCollectionNode`.
15+
This module provides Swift extension methods for `IGListAdapter` to enable seamless integration with `ASCollectionNode`.
1616

17-
**Why this exists:** The original Objective-C implementation (`setASDKCollectionNode:` in `IGListAdapter+AsyncDisplayKit.mm`) doesn't compile in SPM builds because Swift Package Manager traits don't work with conditional compilation (`#if AS_IG_LIST_KIT`) in Objective-C code. This is a pure Swift reimplementation of that Objective-C code.
17+
### Why This Exists
18+
19+
**The Problem:** Swift Package Manager cannot export Objective-C categories on classes from other modules. The original Objective-C API `setASDKCollectionNode:` (defined in `IGListAdapter+AsyncDisplayKit.mm`) extends `IGListAdapter` class from the `IGListKit` module, which SPM cannot handle in source builds.
20+
21+
**The Solution:** This is a pure Swift reimplementation that works around SPM's limitation.
1822

1923
**Reference implementation:** This Swift code is based on the existing Objective-C implementation in:
2024
- `Source/IGListAdapter+AsyncDisplayKit.mm`
2125
- `Source/Private/ASIGListAdapterBasedDataSource.mm`
2226
- `Source/Private/ASIGListAdapterBasedDataSource.h`
2327

24-
## ⚠️ Important: IGListKit Version Differences
28+
## ⚠️ Important: IGListKit 5.0+ Updates
29+
30+
**This package uses IGListKit 5.0+ (latest major version)** with important API changes:
31+
32+
### Key Changes from IGListKit 4.x
2533

26-
**SPM uses IGListKit 5.0+ (latest major version)** which includes breaking changes compared to versions used by CocoaPods/Carthage.
34+
- `allowsBackgroundDiffing` (NEW) - enables background thread diffing for better performance
35+
- `allowsBackgroundReloading` (REMOVED) - caused animation issues, automatically handled in 5.0+
2736

28-
- **Not a drop-in replacement** - Migration and testing required
29-
- **API differences** - IGListKit 5.0 has breaking changes from 4.x
30-
- **Different target** - This is specifically for SPM users
31-
- **No Carthage/CocoaPods support planned** - We recommend migrating to SPM
37+
### Updated API Calls
3238

33-
If you're currently using Texture with IGListKit via CocoaPods or Carthage, please thoroughly test your integration when migrating to SPM.
39+
**Old (IGListKit 4.x):**
40+
```swift
41+
updater.allowsBackgroundReloading = false // Removed in 5.0
42+
```
43+
44+
**New (IGListKit 5.0+):**
45+
```swift
46+
updater.allowsBackgroundDiffing = true // Use this instead
47+
```
48+
49+
The Swift implementation (`IGListAdapterDataSourceBridge`) has been updated to use the new API.
3450

3551
## What You Get
3652

@@ -103,15 +119,7 @@ To connect them, you need special bridging code that:
103119

104120
## Using in iOS/tvOS App Projects
105121

106-
### The Problem
107-
108-
As of Xcode 26.0.1, Xcode does not provide a UI for enabling SPM package traits in iOS/tvOS app targets. Traits can only be enabled in Package.swift files, which app projects do not have.
109-
110-
Note: If you are using a newer version of Xcode, check whether Apple has added trait configuration support in the Xcode UI.
111-
112-
### The Solution
113-
114-
Create an intermediate local Swift package to enable the IGListKit trait.
122+
Simply add Texture as a dependency and import both modules:
115123

116124
**Step 1: Create Package Structure**
117125

@@ -150,10 +158,7 @@ let package = Package(
150158
dependencies: [
151159
.package(
152160
url: "https://github.com/TextureGroup/Texture.git",
153-
from: "3.3.0",
154-
traits: [
155-
.init(name: "IGListKit") // Enable IGListKit trait
156-
]
161+
from: "3.3.0"
157162
)
158163
],
159164
targets: [

0 commit comments

Comments
 (0)