Open NullIsOne opened 1 year ago
Warnings | |
---|---|
:warning: | Oops! We have found some issues. It's better to fix them to keep code clean |
Severity | File | Reason |
---|---|---|
Warning | BakgroundStyle.swift:32 | Shorthand syntactic sugar should be used, i.e. Int? instead of Optionalsyntactic_sugar ) |
Warning | BorderStyle.swift:42 | Shorthand syntactic sugar should be used, i.e. Int? instead of Optionalsyntactic_sugar ) |
Error | ComponentsOverviewTableViewController.swift:26 | Line should be 145 characters or less: currently 589 characters (line_length ) |
Generated by :no_entry_sign: Danger Swift against b75c607e3522baae33d837353a9c615e057711ac
Patch coverage: 13.33%
and project coverage change: -40.02%
:warning:
Comparison is base (
cbf811a
) 72.66% compared to head (ea60f8c
) 32.64%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Обновил синтаксис. По-моему уже лучше, но не идеал конечно.
2 проблемы, с которыми столкнулся
it.viewNib(type: TitleTableViewCell.self, model: "1")
против
TitleTableViewCell.rddm.viewGenerator(with: "1", and: .nib)
Надо оценить насколько это интуитивно.Таким образом контекст определяет для какой коллекции нужен генератор. Генераторы создаются через контекст.
В случае со стеком вернул в примере установку children
вместо выноса в отдельный параметр, чтобы исключить неочевидные ошибки и конфликты при построении стека и для более древовидной структуры.
Очередное обновление и сразу 2 варианта синтаксиса.
it.gen(CellOrViewType.self, model: Model)
Полностью рабочий, но читаемость все еще далека.CellOrViewType.build(in: Context, with: Model)
По сути extension к предыдущему решению.
Есть проблема с TableCell классами. Они не выходят на создание baseGenerator из-за чего получаем TableWrappedCell<SomeOtherCell>
вместо генератора для SomeOtherCell
.Пока склоняюсь ко второму варианту, но его еще надо починить.
Кстати, оба варианта (плюс предыдущий) заваливают варнингами типа такого Это напоминает о том, что если уж надо какую-то верстку из ячейки запинуть в стек, то лучше отрефакторить, вынеся необходимый кусок во вью. Отобразить ячейку возможно, но могут быть проблемы с ресайзом, что впринципе и показывает a11y аудит.
Убрал ready for review и поставил blocker.
Изменений много. Их надо влить чтобы не мучаться потом с конфликтами.
Синтаксис оригинала достигнут. Добавлена возможность декорировать и трансформировать генераторы.
Тесты на Xcode 15 с performAccessibilityAudit успешны.
Что сделано?
StackView
по стандартам библиотеки компонентовintrisinctContentSize
для отображенияTitleTableViewCell
внутри стекаBaseCellGenerator
иDiffableCellGenerator
теперь привязаны одновременно кUITableViewCell
иUICollectionCell
. Дубли коллекции удалены.Зачем это сделано?
Чтобы уменьшить количество сопровождающих классов при создании сложных ячеек на основе сочетания стека и уже готовых ячеек
На что обратить внимание?
TBD разрешить todo в TableWrappedCell и CollectionWrappedCellДобавлен EmptyViewGenerator для генерации View, но без установки Model Установка модели будет произведена в ViewWrapper.TBD generic функция generator для контекстно-зависимого вызова и возможного отбрасываниядобавлены Context для упрощения синтакцисаSomeView.rddm.
для упрощения синтаксисапока неудалены, но будут после улучшения синтаксиса билдера. Добавлено все неободимое чтобы приблизить синтаксис к эталонному желаемому варианту.mutating
иProperty
спрячутся за макрос, который ожидает релиза Xcode 15asFoldable.asDiffable
но последняя трансформация в текущей реализации "перекроет" первую..Как протестировать?