-
Notifications
You must be signed in to change notification settings - Fork 13
[SPT-1555] Universal StackView #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
SwiftLint found issues
Generated by 🚫 Danger Swift against b75c607 |
b4f619b to
40be511
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #253 +/- ##
===========================================
- Coverage 72.66% 72.22% -0.44%
===========================================
Files 161 166 +5
Lines 4905 5113 +208
Branches 2224 2295 +71
===========================================
+ Hits 3564 3693 +129
- Misses 1221 1299 +78
- Partials 120 121 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| ]) | ||
| }, | ||
| and: .class) | ||
| ]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Все это дело не читается, пытался добавить в коллекцию, сам не понял, пришлось копипастить
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ясное дело. Упрощение синтаксиса в работе. (см "На что обратить внимание")
Референсный вариант специально временно сохранен чтобы на него можно было опираться.
kombatkos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Настроить так чтобы стек принимал не генераторы, а ConfigurableItem вью.
Упростить реализацию иначе никто пользоваться не будет.
В идеале как в swiftUI HStack(space: 8) { ConfigurableItem }
Если оставить старую реализацию, то можно убрать сабклассы и оставить такое
TableStack(axis: .horizontal) {
ConfigurableItemView
}
|
|
||
| // MARK: - Public properties | ||
|
|
||
| private(set) public var children: [StackCellGenerator] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
должен принимать any ConfigurableItem, идея заключалась в том чтобы на проектах собирать ячейки из ячеек или вьюх. С таким подходом это только будут вью
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Категорически не согласен.
Ячейка тоже UIView. Ей доступен вызов rddm.baseStackCellGenerator метода.
В примере показано
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Но он не принимает такое TextCell.buildView("Some text")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что мешает принимать ConfigurableItem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.buildView производит View. При этом он грузит ее из Nib, если указано.
Это ресурсоемкая задача.
Основа rddm в генераторах, которые инициализируются моделью и производят View по запросу внутри адаптера.
Передача View объектов меняет порядок наполнения адаптера и стоимость (по ресурсам) этого процесса.
Такой шаг также переворачивает метод использования библиотеки. Генераторы уходят на задний план. Это неправильно.
|
|
||
| // MARK: - Model | ||
|
|
||
| public struct Model: AlignmentProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
можно вынести отдельно в extension StackView
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как и говорил вся модель будет под макросом.
Опиши проперти и гуляй.
|
Обновил синтаксис. По-моему уже лучше, но не идеал конечно. 2 проблемы, с которыми столкнулся
Таким образом контекст определяет для какой коллекции нужен генератор. В случае со стеком вернул в примере установку |
3ba1542 to
a5ba3d7
Compare
a5ba3d7 to
4debacb
Compare
d7c7f04 to
bb18efd
Compare
bb18efd to
8779dbc
Compare
33e299e to
a4a499d
Compare
423bc1c to
c9ad719
Compare
5ead114 to
df6434e
Compare
… and transformations
b9ef96d to
7bfcfca
Compare




Что сделано?
StackViewпо стандартам библиотеки компонентовintrisinctContentSizeдля отображенияTitleTableViewCellвнутри стекаBaseCellGeneratorиDiffableCellGeneratorтеперь привязаны одновременно кUITableViewCellиUICollectionCell. Дубли коллекции удалены.Зачем это сделано?
Чтобы уменьшить количество сопровождающих классов при создании сложных ячеек на основе сочетания стека и уже готовых ячеек
На что обратить внимание?
TBD разрешить todo в TableWrappedCell и CollectionWrappedCellДобавлен EmptyViewGenerator для генерации View, но без установки Model
Установка модели будет произведена в ViewWrapper.
поправить расчет стека при внедрении ячейки внутрь стека (нетиповое использование)исправлено добавлением intrinsicContentSize ячейкеTBD generic функция generator для контекстно-зависимого вызова и возможного отбрасываниядобавлены Context для упрощения синтакцисаSomeView.rddm.для упрощения синтаксисапока неудалены, но будут после улучшения синтаксиса билдера. Добавлено все неободимое чтобы приблизить синтаксис к эталонному желаемому варианту.mutatingиPropertyспрячутся за макрос, который ожидает релиза Xcode 15asFoldable.asDiffableно последняя трансформация в текущей реализации "перекроет" первую..Как протестировать?