Skip to content

Commit 30224c1

Browse files
committed
move wrapped cell and context implementations into core module
1 parent 4cfd920 commit 30224c1

File tree

14 files changed

+62
-67
lines changed

14 files changed

+62
-67
lines changed

Components/Sources/Collection/Extensions/CollectionContext+CollectionWrappedCell.swift

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// StackView+CollectionContext.swift
3+
// ReactiveChat_iOS
4+
//
5+
// Created by Никита Коробейников on 28.07.2023.
6+
//
7+
8+
import ReactiveDataDisplayManager
9+
10+
public extension CollectionContext {
11+
12+
static func stack(model: StackView.Model) -> CollectionCellGenerator {
13+
StackView.rddm.collectionGenerator(with: model)
14+
}
15+
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// StackView+TableContext.swift
3+
// ReactiveChat_iOS
4+
//
5+
// Created by Никита Коробейников on 28.07.2023.
6+
//
7+
8+
import ReactiveDataDisplayManager
9+
10+
public extension TableContext {
11+
12+
static func stack(model: StackView.Model) -> TableCellGenerator {
13+
StackView.rddm.tableGenerator(with: model)
14+
}
15+
16+
}

Components/Sources/Table/Extensions/TableContext+TableWrappedCell.swift

Lines changed: 0 additions & 30 deletions
This file was deleted.

Source/Collection/Generators/CollectionContext.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,18 @@
88
import UIKit
99
import Foundation
1010

11-
public struct CollectionContext { }
11+
public struct CollectionContext: BuilderContext {
12+
13+
public typealias ViewType = UICollectionViewCell
14+
public typealias GeneratorType = CollectionCellGenerator
15+
16+
public static func gen<Item>(_ type: Item.Type, model: Item.Model) -> GeneratorType where Item: BaseItem {
17+
Item.rddm.collectionGenerator(with: model)
18+
}
19+
20+
public static func gen<Item>(_ type: Item.Type, model: Item.Model) -> GeneratorType where Item: ViewType,
21+
Item: BaseItem {
22+
Item.rddm.baseGenerator(with: model, and: Item.prefferedRegistration)
23+
}
24+
25+
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// Created by Никита Коробейников on 05.06.2023.
66
//
77

8-
import ReactiveDataDisplayManager
98
import UIKit
109

1110
public extension StaticDataDisplayWrapper where Base: UIView & BaseItem {

Components/Sources/Collection/CollectionWrappedCell.swift renamed to Source/Collection/Wrapper/CollectionWrappedCell.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
import UIKit
9-
import ReactiveDataDisplayManager
109

1110
/// Empty collection cell with `View`. Configuration is implemented within `ViewWrapper`.
1211
public final class CollectionWrappedCell<View: BaseItem>: UICollectionViewCell, ViewWrapper {

Components/Sources/Common/Utils/ViewWrapper.swift renamed to Source/Common/Wrapper/ViewWrapper.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
import UIKit
9-
import ReactiveDataDisplayManager
109

1110
public protocol ViewWrapper: ConfigurableItem {
1211

File renamed without changes.

0 commit comments

Comments
 (0)