Draft: Cleaning status bar feature + Refactoring HUD
2 unresolved threads
2 unresolved threads
This MR contains:
- Removal of ThemeFeature that wasn't used
- Creation of a StatusBarFeature which contains a refactor of the old ThemeFeature.
- Refactor of HUDFeature
Edited by Bruno Muniz
Merge request reports
Activity
assigned to @brunomunizaf
14 14 public override func viewDidLoad() { 15 15 super.viewDidLoad() 16 16 view.backgroundColor = Asset.neutralWhite.color 17 hud.update(with: .on(nil)) 17 hud.subject.send(.on(nil)) - Sources/HUDFeature/HUDStatus.swift 0 → 100644
1 public enum HUDStatus: Equatable { 2 case on(String?) 3 case none 4 case error(HUDErrorModel) - Comment on lines +1 to +4
In general, we don't need a
none
case in enums. It's better to use native swift optional for this.enum HUDStatus { case on(String?) case error(HUDErrorModel) }
and to store
HUDStatus
in a property, we can do:var hudStatus: HUDStatus?
where
nil
equals toOptional<HUDStatus>.none
(because swift optional is an enum too) and means there is no HUD to be presented.
Please register or sign in to reply