Skip to content

Instantly share code, notes, and snippets.

@nbhasin2
Last active February 3, 2025 22:37
Show Gist options
  • Save nbhasin2/373c962a7569c2d3a0cc237476894ec1 to your computer and use it in GitHub Desktop.
Save nbhasin2/373c962a7569c2d3a0cc237476894ec1 to your computer and use it in GitHub Desktop.
SwiftUI in Firefox iOS

SwiftUI in Firefox iOS

Decision Tree for SwiftUI vs. UIKit

The following decision tree should be used to determine whether to use SwiftUI or UIKit for new and existing components:
SwiftUI Decision Tree

Existing Implementations (SwiftUI)

The following list shows components that are implemented using SwiftUI and some that have future potential for SwiftUI conversion.

Component Type
Address Autofill SwiftUI
Credit Card Autofill SwiftUI
Splash Screen Animation SwiftUI
Autofill Bottom Sheet SwiftUI
Fakespot Message CardView SwiftUI
Circular Progress View SwiftUI
iOS 14-based Widgets SwiftUI
Settings Page: Sub components like Dark Reader SwiftUI Potential Candidate
Help and support pages (Licenses) SwiftUI Potential Candidate

Additional Considerations

No Accessibility Compromises

Ensure SwiftUI views meet all accessibility requirements before replacing UIKit implementations.

UIHostingController for Hybrid Screens

SwiftUI components should integrate smoothly using UIHostingController where necessary.

Redux Pattern for State Management

Where applicable, consider using a Redux-like state management approach to ensure predictable and scalable UI state handling.

@nbhasin2
Copy link
Author

nbhasin2 commented Feb 3, 2025

Screenshot 2025-02-03 at 5 01 41 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment