Reading time: 6 min

This recipe shows how to implement a custom Slider in SwiftUI. The default Slider view isn't particularly customisable, so any stepping outside the norm requires custom code.

Here's what the end result will look like:

  • On the top you have the default Slider.
  • In the middle there's our cust...

Continue Reading...

Reading time: 1 min

This quick recipe shows how to measure a SwiftUI View, i.e get its size at runtime. This is useful when your layout depends on a particular view's dimensions.

So the trick is to embed a GeometryReader in the view's background or overlay. The resulting GeometryProxy's size will the that o...

Continue Reading...

Reading time: 1 min

This recipe shows how to implement shake gesture detection in SwiftUI. The result looks like this (you'll have to image the phone being shaken :)):

Preview

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

The recipe is as follows:

  1. Override UIWindow's motionEnded for motion...

Continue Reading...

Reading time: 3 min

This recipe shows how to style a SwiftUI Form. Forms are a great way to quickly compose a UI for collecting data, such as an enrolment form or a settings panel, but fully styling them can be a bit a tricky.

The end result will look like this:

row

Starting position

OK, let's start with a an exe...

Continue Reading...

Reading time: 2 min

This recipe shows how to let your users draw with mouse/finger in SwiftUI. The result will look like this:

ezgif-1-69965200c46e

This recipe is a part of our Road to DigitalSignatureView series, which explores various components vital to functioning of our SwiftUIDigitalSignature component.

You can find...

Continue Reading...