Reading time: 3 min

This recipe shows how to display text with tappable hyperlinks in SwiftUI, and, in doing so, fully support attributed strings, HTML and Markdown in text views on any SwiftUI version. The end result looks like this:

preview

The solution depends on which SwiftUI version you have to support:

  1. SwiftU...

Continue Reading...

Reading time: 1 min

This recipe shows how to use markdown in SwiftUI Text views. The end result looks like this:

preview

This code works starting with SwiftUI 3 (iOS 15, macOS 12). If you're interested in using attributed strings on SwiftUI 1 and 2, check out Text with NSAttributedString recipe or Hyperlinks with Te...

Continue Reading...

Reading time: 3 min

This recipe provides a drop-in replacement for iOS 15 AsyncImage. This allows you to load images from remote sources on any SwiftUI version, with the code being exactly the same (minus the Compat at the end of name :]). The end result looks like this:

preview

AsyncImage and AsyncImageCompat bot...

Continue Reading...

Reading time: 2 min

This recipe shows how to style a TabView in SwiftUI - change its background color, text and icon colors and styles, as well as changing the badge coloring. This solution works on all SwiftUI and iOS versions. The end result looks like this:

preview

The recipe goes as follows:

  1. Set icon, text and...

Continue Reading...

Reading time: 11 min

Here you can find recipes for common tasks you need when working with the new Swift 5.5 concurrency model.

Where applicable, there's before and after comparison that shows how things where done before async/await (mostly with GCD) and how they can be done now.

This list will be updated as S...

Continue Reading...