Reading time: 2 min

This recipe shows how to implement a timeline list in SwiftUI. Timeline list has a line, usually on the side, that connects rows / cells tied to the same date. The end result looks like this:

Screenshot%202021-11-18%20at%2013.38.17

The example list in this recipe deals with a simple structure that represents an appointment, defi...

Continue Reading...

Reading time: 2 min

This recipe shows how to remove / hide list separator in SwiftUI. This is tricky because each SwiftUI version has its own solution. The end result looks like this:

Simulator%20Screen%20Shot%20-%20iPhone%20SE%20%282nd%20generation%29%20-%202021-11-20%20at%2021.19.12

This recipe will first show the solutions for each SwiftUI version and then present a custom component that works on any vers...

Continue Reading...

Reading time: 4 min

This recipe shows how to implement a radial /circular / arc menu in SwiftUI. A radial menu positions its elements on an arc at a set distance from an anchor view. It is also commonly used in conjunction with a floating action button. The end result looks like this:

preview

In this recipe, the radi...

Continue Reading...

Reading time: 1 min

This recipe shows how to implement a floating action button (FAB) in SwiftUI. This is a simple component, common in Android apps, that sits in the bottom-right corner of the screen, floating above the rest of the content. The end result looks like this:

preview

The recipe goes as follows:

  • The FAB...

Continue Reading...

Reading time: 1 min

This recipe shows how to add a SwiftUI List with alternating row colors. The end result looks like this:

preview_list

The tricks is to wrap an array of data in an indexed ForEach nested within a List and use the index to set different listRowBackground:

struct AlternatingRowsList...

Continue Reading...