SectionReactor
A ReactorKit extension for managing table view and collection view sections with RxDataSources
Install / Use
/learn @devxoul/SectionReactorREADME
SectionReactor
SectionReactor is a ReactorKit extension for managing table view and collection view sections with RxDataSources.
Getting Started
This is a draft. I have no idea how would I explain this concept 🤦♂️ It would be better to see the ArticleFeed example.
ArticleViewSection.swift
enum ArticleViewSection: SectionModelType {
case article(ArticleSectionReactor)
var items: [ArticleViewSection] {
switch self {
case let .article(sectionReactor):
return sectionReactor.currentState.sectionItems
}
}
}
ArticleSectionReactor.swift
import SectionReactor
final class ArticleSectionItem: SectionReactor {
struct State: SectionReactorState {
var sectionItems: [ArticleSectionItem]
}
}
ArticleListViewReactor.swift
final class ArticleListViewReactor: Reactor {
struct State {
var articleSectionReactors: [ArticleSectionReactor]
var sections: [ArticleViewSection] {
return self.articleSectionReactors.map(ArticleViewSection.article)
}
}
func transform(state: Observable<State>) -> Observable<State> {
return state.merge(sections: [
{ $0.articleSectionReactors },
])
}
}
Dependencies
- ReactorKit >= 0
- RxDataSources >= 2.0
Installation
pod 'SectionReactor'
License
SectionReactor is under MIT license. See the LICENSE for more info.
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
