Skip to content

Commit

Permalink
Merge pull request #252 from surfstudio/bugfix/SPT-1564/register_at_i…
Browse files Browse the repository at this point in the history
…nsert

Bugfix/spt 1564/register at insert
  • Loading branch information
NullIsOne authored Jul 19, 2023
2 parents e3f213f + 0205095 commit 9d807df
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Example/targets/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ targetTemplates:
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: ${bundle_id}
MARKETING_VERSION: "7.3.7"
MARKETING_VERSION: "7.3.8"
CURRENT_PROJECT_VERSION: 0
VERSIONING_SYSTEM: "apple-generic"
DEBUG_INFORMATION_FORMAT: dwarf-with-dsym
Expand Down
2 changes: 1 addition & 1 deletion ReactiveDataDisplayManager.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ReactiveDataDisplayManager"
s.version = "7.3.7"
s.version = "7.3.8"
s.summary = "Library with custom events and reusable adapter for scrollable UI Collections"
s.homepage = "https://github.com/surfstudio/ReactiveDataDisplayManager"
s.license = "MIT"
Expand Down
8 changes: 4 additions & 4 deletions Source/Collection/Manager/BaseCollectionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ private extension BaseCollectionManager {

func insert(elements: [(generator: CollectionCellGenerator, sectionIndex: Int, generatorIndex: Int)]) {

elements.forEach { [weak self] element in
elements.forEach { element in
element.generator.registerCell(in: view)
if self?.generators.count == element.sectionIndex {
self?.generators.append([element.generator])
if self.generators.count == element.sectionIndex {
self.generators.append([element.generator])
} else {
self?.generators[element.sectionIndex].insert(element.generator, at: element.generatorIndex)
self.generators[element.sectionIndex].insert(element.generator, at: element.generatorIndex)
}
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Table/Manager/BaseTableManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ extension BaseTableManager {
func insert(elements: [(generator: TableCellGenerator, sectionIndex: Int, generatorIndex: Int)],
with animation: TableRowAnimation) {

elements.forEach { [weak self] element in
elements.forEach { element in
element.generator.registerCell(in: view)
self?.generators[element.sectionIndex].insert(element.generator, at: element.generatorIndex)
self.generators[element.sectionIndex].insert(element.generator, at: element.generatorIndex)
}

let indexPaths = elements.map { IndexPath(row: $0.generatorIndex, section: $0.sectionIndex) }
Expand Down
4 changes: 4 additions & 0 deletions Source/Table/Manager/ManualTableManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ private extension ManualTableManager {
at sectionIndex: Int,
with animation: TableRowAnimation) {

generators.forEach {
$0.registerCell(in: view)
}

self.sections.insert(header, at: sectionIndex)
self.generators.insert(generators, at: sectionIndex)

Expand Down
2 changes: 1 addition & 1 deletion project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ targets:
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: ru.surfstudio.rddm
MARKETING_VERSION: "7.3.7"
MARKETING_VERSION: "7.3.8"
CURRENT_PROJECT_VERSION: 0
VERSIONING_SYSTEM: "apple-generic"
DEBUG_INFORMATION_FORMAT: dwarf-with-dsym
Expand Down

0 comments on commit 9d807df

Please sign in to comment.