Buttons are some of the most frequently used components in our apps.
It’s important to make them look appropriate to the action they trigger. They should be consistent and accessible across the app and give visual feedback to users.
In my previous article, I talked about view modifiers and how they can be used to create a stylish UI for our SwiftUI apps.
Here, I’ll present how to apply them to create reusable styles for buttons. It’s going to be a long and enjoyable ride.
Creating a button in SwiftUI is pretty simple. …
Maintaining UI consistency while keeping your codebase clean is a must-have. But how can we achieve that in SwiftUI?
Developing a pet/serious project is the perfect way to learn a new framework or paradigm. SwiftUI is no exception to this truth.
While doing that, I stumbled upon having to use the same components on several screens: titles, subtitles, and buttons. Having mini UI libraries inside the project for different UI building blocks helps a lot.
In SwiftUI we can use the existing UI components (e.g.,
Button) with our own shared styles through view modifiers.
A view modifier…
This is how I learned to implement an equivalent of
onChange in SwiftUI controls to update other
Almost a year after SwiftUI was released, I decided to give it a go. I started to get my hands dirty by implementing basic UI controls (like
TextField) and learning how to manipulate view states.
I quickly faced the challenge of updating an
@State variable based on another
@State variable’s changes.
And, yes, the property observers that we know (like
willSet) don't work in
After some research (which took longer than I expected), I learned…
You’re building two mobile apps (iOS and Android) using React Native. The apps get approved in their stores. How do you know if your customers are enjoying your creation and find it useful? You don’t unless you find a way to get insights and understand how your apps are used.
First, one has to decide what library should be used. Fortunately, there are some great choices that make it easy to integrate, like: