Skip to content

[Refactor] Reduce code duplication for iOS 14 support

Changelog

  • Replaced iOS14CompatibilityAlertView with a more general View+iOS14Compatibility.swift
  • Added modifiers mimicking SwiftUI 3 alert and refreshable to reduce code duplication
    • Unfortunately, we don't have access to SwiftUI.Button's internal workings, so we have to introduce _Button
    • However, we can still use Button to construct either SwiftUI.Button or _Button depending on the arguments

What happens when we drop iOS 14 support?

  1. Delete View+iOS14Compatibility.swift
  2. Done

Testing

Manually tested on iOS 14.5 and iOS 15 simulators for all alerts.

Known Issues

  • Pull to refresh refreshable remains unimplemented for iOS 14
Edited by Apollo Zhu

Merge request reports

Loading