Reading time: 4 min

This recipe shows how to embed a WKWebView into SwiftUI and have a (somewhat) functional browser in your app! The end result looks like this:

Preview iOS

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

Modelling the behaviour

WKWebView is a powerful and intricate component that d...

Continue Reading...

Reading time: 3 min

This recipe shows how to customize a Progress view by implementing a custom ProgressViewStyle. You'll implement a circular progress bar that supports both definite and indefinite progress. The end result will look like this:

Preview

Progress view and ProgressViewStyle were introduced in SwiftU...

Continue Reading...

Reading time: 1 min

Here's a simple recipe to help you draw Arc shapes in SwiftUI. For some reason, arcs still aren't a part of the standard Shape package, but fortunately, wrapping them isn't too difficult. The end result looks like this:

Screenshot%202021-08-11%20at%2012.48.33

As you can see, the arcs can be stroked and filled just like any other S...

Continue Reading...

Reading time: 1 min

This recipe shows how to implement a custom Toggle via ToggleStyle. The particular ToggleStyle you'll implement will make a Toggle look like a checkbox. The end result will look like this:

Screenshot%202021-08-10%20at%2017.01.08

OK, here's the code for the custom ToggleStyle. It maps the ToggleStyleConfiguration onto a...

Continue Reading...

Reading time: 2 min

Here at SwiftUIRecipes.com, we're proud to announce the SwiftUI Recipes Companion app!

This FREE app allows you to view community-sourced recipes and includes an XCode Source Editor extension, allowing you to insert the recipe code straight into your own!

You can preview its content and...

Continue Reading...