🎟️ 2025 Edition 8-9 April, Turin: https://swiftheroes.com/2025/tickets/
⏩ Chapter:
00:00 Intro
04:08 Big Head Component
08:18 add more features
10:55 Make something more attractive
14:10 More nil-able parameters
15:39 Challenges of Initialization VS React
17:23 Other Problems
18:18 Part.2 Declarative Thinking
21:04 We need to ABSTRACT te component (SwiftCharts Interface)
23:07 How to not overuse parameter injection
24:04 Define Type-erased protocol
26:37 Create View Modifiers with extension AnyDonutChart
27:55 Use Environmen?
33:25 Big Head VS Long Tail
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 KIM, iOS Role Leader
📍Swift Heroes 2024 was hosted in Turin, 18-19 April. Attended by 400 iOS developer participants and broadcast to an additional 200 Swift enthusiasts across the globe. The agenda covered a range of important iOS developer topics including SwiftUI, the composable architecture, accessibility, developer tools, testing and much more.
All the other talks are coming out, don't miss them...
📌 For more engaging content and expert insights, subscribe to our channel and hit the notification bell. 🛎️
Inform: https://swiftheroes.com/
✅ Tweet: https://twitter.com/swiftheroes_it
✅ Connect: https://www.linkedin.com/showcase/swift-heroes/
✅ Read: https://telegram.me/swiftheroes
#SwiftHeroes #SwiftUI #iOSDevelopment #MobileArchitecture #SwiftEnvironment #BigHeadComponent #DeclarativeUI #TypeErasure #GenericsInSwift #CodeMaintainability #TechConference