#40 - SwiftUI Custom View Modifiers
Making the code more readable and flexible
Hey iOS developer! 👋
SwiftUI makes it super easy to compose and customise view, but as the UI grows, the same modifiers start appearing everywhere. This is when custom View Modifiers can be a great help.
In this issue, I’ve curated a number of articles about creating custom modifiers - when they really help, and when simpler approach might be a better choice.
Create a Custom View Modifier in SwiftUI
Starting with the basics, here’s a short article covering the creation of a simple custom view modifier. Did you know we can enhance custom modifiers by passing parameters?
Read on Medium
Crafting Effective SwiftUI ViewModifiers
This video tutorial by Stewart Lynch will help us understand deeper how view modifiers work and they can improve code readability.
Watch on YouTube
View Composition using ViewModifiers in SwiftUI
In this article, Antoine van der Lee explains how view components can improve the development process by extracting logic into the reusable components.
Read on Antoine van der Lee blog
Add custom views and modifiers to the Xcode Library
Xcode Library is a great way to drag and drop available SwiftUI views into the Xcode Previews canvas and code.
Did you know you can add your own custom views and modifiers to the Xcode Library?
Watch on Apple Developer
Why a custom ViewModifier is often useless
The convenience of custom View Modifier is undeniable. However, as Vincent Pradeilles shows in his article, in most cases they aren’t really needed, and there are simpler ways to achieve the same view modification result.
Read on Swift with Vincent blog
If you found this Curated iOS issue useful, I’d be happy if you:
Hit the Like button.
Subscribe, if you haven’t already!
Connect with me on LinkedIn.
Until next time!
Artjoms


I created some just yesterday
Hey Artjoms, what do you feel about apple opening up ios for AI app development?