Swift Heroes 2024

Swift Heroes 2024

Your big head component spoils your code
2024-04-18 , Auditorium

I aim to share strategies to avoid unnecessary parameter expansion, which results in components with a "big head" in complex SwiftUI environments. Whenever there's a minor fix to a single parameter, you're forced to edit the component itself and test all cases to determine potential side effects. More parameters mean more dependencies, ultimately consuming more resources. My approach emphasises the strategic use of the declarative framework to separate responsibilities.

The first solution employs the decorator pattern with the Swift Environment. For instance, Swift Charts enables the addition of functionalities through modifiers without overburdening the chart initialisation. I will demonstrate how to create type-erased content and apply numerous view conditions as building blocks, akin to AnyChartContent's functionality.

The second solution utilises generics and the template pattern for both customisation and validation, exemplified by a custom TextField component that supports a wide range of inputs on both the UI and logic fronts. This will illustrate how to use generics to effectively manage UI conditions.

This session offers practical insights and code examples, aimed at improving the maintainability of SwiftUI components.

Gyuree serves as the iOS team lead at a fintech enterprise in South Korea, where she has significantly contributed to the development of nearly 20 Swift packages and a suite of financial product applications, primarily utilising SwiftUI and Combine, accounting for 99% of the codebase.
Since SwiftUI was in its early stages, Gyuree has pioneered the development of comprehensive loan and investment solutions entirely devoid of UIKit. The loan processing workflow integrates 4 verification mechanisms (telephone number and device authentication, ID card validation, bank account validation, and facial recognition via camera) and employs automated scraping techniques to collect an extensive array of user financial data, encompassing income details, residential history, vehicle ownership, existing mortgages, and digital contract executions with electronic signatures. Throughout the implementation phase, she navigated numerous challenges to uphold and enhance the application's stability and user experience, maintaining the integrity essential for financial applications.
The Swift packages she contributed to are known for their adaptability and deep abstraction. The design system, named PurpleUI, strictly follows the SOLID principles. Adding a navigation module with the coordinator pattern, validation with the builder pattern, enhanced event logging using PreferenceKey, and more, shows the team's and her dedication to being the best in SwiftUI and Combine. Her broad experience in using design patterns and clean architecture with declarative programming shows her skill. Driven by a passion for sharing knowledge, Gyuree is eager to connect with developers worldwide to share her insights on advanced SwiftUI techniques and building strong iOS applications.