Reading time: 2 min

This quick tip shows how to speed up your SwiftUI development by simply breaking the code of your Views into smaller chunks. This results in:

  • Faster Source Editor operation, i.e syntax highlighting and error/warnings checks will come in faster.
  • Faster preview build and refresh time.
  • Fast...

Continue Reading...

Reading time: 4 min

This recipe shows how to zoom an image in SwiftUI using the pinch/magnify gesture. The image is zoomed in or out at the midpoint between the fingers, supports dragging and double tap to zoom in or reset. The end result looks like this:

preview

The recipe goes as follows:

  1. Use a custom UIVIew wi...

Continue Reading...

Reading time: 6 min

This recipe shows how to play a YouTube video in SwiftUI. The end result looks like this:

Preview iOS

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

This recipe shows only a part of the YouTubePlayer component's functionality, namely that to load a video, play and pause it. Thi...

Continue Reading...

Reading time: 1 min

This recipe shows how to style the progress indicator while using the refreshable on SwiftUI List. The end result looks like this:

preview

This recipe works with the refreshable modifier, which is only available in SwiftUI 3 (iOS 15, macOS 12). If you're interested in custom refresh indicators...

Continue Reading...

Reading time: 1 min

This recipe shows how to set visibility of a SwiftUI view. You can show it, hide it, or remove it from the view hierarchy entirely. The end result looks like this:

preview

We'll adopt a good practice from Android and model the view visibility like this:

enum ViewVisibility: CaseIterable {
  case v...

Continue Reading...