[SPT-1480] RDDM Accessibility optimizations#239
Conversation
SwiftLint found issues
Generated by 🚫 Danger Swift against 72f69d7 |
NullIsOne
left a comment
There was a problem hiding this comment.
преаппрув
хороший генерик
| } | ||
| /// a reference value from object. | ||
| /// - parameter keyPath: specified keypath from value would be taken. | ||
| public static func from<T>(_ object: T, keyPath: KeyPath<T, ValueType?>) -> Self { |
There was a problem hiding this comment.
Вот тут хорошо что от привязки к NSObject ушли.
Это ограничивало варианты источников
There was a problem hiding this comment.
Да, теперь работает с любым объектом, можно передавать свои классы и указывать их поля)
Осталось:
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## release/7.4 #239 +/- ##
================================================
+ Coverage 36.56% 63.26% +26.70%
================================================
Files 143 151 +8
Lines 5303 5491 +188
Branches 2437 2497 +60
================================================
+ Hits 1939 3474 +1535
+ Misses 3283 1886 -1397
- Partials 81 131 +50
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
f40ba86 to
02f5b2c
Compare
|
Апдейт
|
|
Апдейт ✅ придумать удобный способ задания UIAccessibilityCustomActions Осталось |
|
Переделал включенный по-умолчанию acessibilityPlugin |
| open var modifierType: AccessibilityModifierType = AccessibilityItemModifier.self | ||
|
|
||
| required public init( | ||
| parentView: UIView, |
There was a problem hiding this comment.
тут required будет мешать, надо отдельный инит required public init(parentView: UIView) добавить, а стратегии и так open
required нужен, чтобы обязательно инициализировать через super.init(accessibilityContainer: parentView) - без него итем не будет корректно отображаться (опыт с прошлого проекта)
There was a problem hiding this comment.
имею в виду один инит required public init(parentView: UIView), а второй как сейчас, но не required
There was a problem hiding this comment.
добавил not required init
| public extension AccessibilityStrategyProvider { | ||
| var valueStrategy: AccessibilityStringStrategy { .ignored } | ||
| var traitsStrategy: AccessibilityTraitsStrategy { .ignored } | ||
| var actionsStrategy: AccessibilityActionsStrategy { .ignored } |
There was a problem hiding this comment.
Это хорошо, .ignored не хватало, позволят использовать стандартное accessibilityActions при необходимости
| return | ||
| } | ||
|
|
||
| item.isAccessibilityElement = !item.isAccessibilityIgnored |
There was a problem hiding this comment.
Не совсем уверен нужно ли тут убирать isAccessibilityElement
There was a problem hiding this comment.
Нашему контейнеру не нужно быть AccessibilityElement.
Если помнишь по опыту TDW AccessibilityElement, который содержит AccessibilityElement перекрывает child элементы.
При отладке на проекте это подтвердилось и с AccessibilityContainer.
| // MARK: - Private Properties | ||
|
|
||
| private lazy var adapter = collectionView.rddm.baseBuilder | ||
| .add(plugin: .accessibility()) |
There was a problem hiding this comment.
Этот контроллер не рабочий
0a4f73b to
72f69d7
Compare


Что сделано?
Зачем это сделано?
На что обратить внимание?
Пример:
Если раньше стратегии задавались очень длинно и нагроможденно
то теперь станет это проще