Reading time: 1 min

This recipe shows how to render a progress dialog / HUD in SwiftUI. The end result looks like this:

This component is available as a Swift Package in this repo.

In order to make this happen, we'll use the custom view dialog from this recipe. If you haven't yet, be sure to check it ou...

Continue Reading...

Reading time: 6 min

Pull to refresh is a common UI pattern, supported in UIKit via UIRefreshControl. (Un)surprisingly, it's also unavailable in SwiftUI.

This recipe shows how to implement this functionality with any ScrollView. It also doesn't rely on UIViewRepresentable. The end result will look like this:

...

Continue Reading...

Reading time: 2 min

This recipe shows how to create a simple file tree using SwiftUI expandable list. This feature is useful for representing any hierarchical data structure, allowing the user to expand and collapse branches to navigate the tree.

The end result looks like this:

ezgif-7-d7434b693fff

This feature is only availabl...

Continue Reading...

Reading time: 1 min

This recipe show how to display a custom dialog in SwiftUI. You can customize the dialog content in any way you want.

Here's what the end result can look like:

This component is available as a Swift Package in this repo.

The custom dialog will be a ViewModifier that wraps the attac...

Continue Reading...

Reading time: 5 min

This recipe is a cheatsheet for various ToolbarItemPlacement values and combinations on iOS. This is useful because:

  1. The namings of the placement values don't necessarily clearly depict where will a ToolbarItem end up.
  2. Some values don't play well with each other. E.g, .primaryAction will...

Continue Reading...