swiftui

Rounded corner panels and masks in SwiftUI

May 03, 2020  3 minute read  

I’ve been working on my UI developer skills recently (and I’ve done a few other posts about this as well). If you look at any of the recent design trends on Dribbble or UPLabs, you will see plenty of rounded corners. SwiftUI makes it simple to create rounded corners on all the corners - just add .cornerRadius(radius) as a modifier to the view. What happens when you only want a couple of corners rounded? For this, you need to dive into custom shapes and masks. Let’s set up a view to exper...

Handle location and geocoding with SwiftUI

November 05, 2019  5 minute read  

I’m continuing on my Weather app research in SwiftUI. My next problem is this: How do I get the current location (as a longitude / latitude) and a place (like a city) in my app such that the UI is updated when location updates happen? It turns out that this is a fairly easy problem, but it does come with some knowledge that you just have to know. Here is the list: How can I update the UI based on programmatic changes to the value? How can I listen for location updates? How can I c...

Create a bubble background in SwiftUI

November 02, 2019  3 minute read  

I’m continuing to explore SwiftUI, trying to recreate user interfaces that I see on design labs. The latest one is a task list app, found on Uplabs, and created by Rudi Hartano. I liked the design so I decided to replicate it from the Adobe XD file that he provided. One of the pieces he uses is a bubble background: The Adobe XD file shows me that I can use a linear gradient between two colors. However, there are also two slightly translucent circles on the top of it. If I were in Andr...

Why SwiftUI might just convert me to an iOS developer

October 31, 2019  9 minute read  

Confession time. I hated iOS development. First, there was Objective-C (which was a nightmare of epic proportions for cryptic syntax), then there was the Storyboards. Both of them forced you into using what is quite possibly the worst IDE on the market today (XCode), all so you could fit into the Apple ecosystem walled garden, where everything is controlled. Then Swift came along, so I took another look. I loved the direction that Swift was going, but Storyboards and the unintuitive IDE ...