Progress Dialog / HUD in SwiftUI
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...
Map with Annotations in SwiftUI
Reading time: 6 min
This recipe shows how to add a Map View using SwiftUI. It also shows how to add pins/markers/annotations to the map, allowing for mixing of different map annotation types.
The end result will look like this:
If you just want something you can use right away, you can find the full code h...
ScrollViewReader + onChange = Responsive Tabs
Reading time: 2 min
This recipe shows how to combine ScrollViewReader
and onChange(of:perform:)
to jump to the selected item in a scrollable view. We'll use this method to update our top tabs and make them fully visible when selected. You can see the end result here:
Both the ScrollViewReader
and onC...
Material Indefinite Loading Bar in SwiftUI
Reading time: 1 min
This recipe shows how to implement an indefinite loading bar in SwiftUI. This kind of view is common in Android Material Design as it's sleek and takes up less space than a conventional, circular LoadingView
. The end result looks like this:
The code for this is quite simple:
- Render a
Re...
Pager / Swiper View in SwiftUI
Reading time: 3 min
This recipe shows how to implement a swipeable pager view in SwiftUI. The end result will look like this:
A pager view lays its child views out as pages - single, currently selected child view occupies the entire pager. The user can swipe left or right to move through different pages.
First...