Reading time: 2 min

This recipe shows how to send mail from SwiftUI. You'll build a MailView by wrapping MessageUI's MFMailComposeViewController in a UIViewControllerRepresentable. You'll be able to:

  • Determine if you can send mail or not.
  • Pass subject, message and recipients to the view via a binding.
  • A...

Continue Reading...

Reading time: 2 min

A Flow Layout is a container that orders its views sequentially, breaking into a new "line" according to the available width of the screen. You can compare it to a left-aligned block of text, where every word is a View. A common use for this layout is to create a tag cloud. The end result look...

Continue Reading...

Reading time: 4 min

This tutorial shows how to create a side menu (or navigation drawer, as it's known on Android), in SwiftUI. It's also a good showcase of using GeometryReader to offset views and DragGesture to detect user gestures. The end result will look like this:

This component is available as a S...

Continue Reading...

Reading time: 1 min

This recipe shows how to add a Splash Screen to your SwiftUI app! You can specify a custom view that will show when your app starts and then dismiss itself automatically after a certain period of time.

The end result looks like this:

ezgif-2-d3d0362f280a

This component is available as a Swift Package in thi...

Continue Reading...

Reading time: 4 min

This recipe shows how to perform a GET request in the background using BGTaskScheduler and BGAppRefreshTaskRequest. For whatever reason, this has way too many gotchas:

  • You can't use Alamofire, you have to use URLSession.
  • You can use URLSessionDataTask, it has to be a URLSessionDownl...

Continue Reading...