Reading time: 1 min

This recipe shows how to implement a multiline text field in SwiftUI that expands automatically. The end result looks like this:

preview1

This feature is available starting in SwiftUI 4 (iOS 16, macOS 12.4).

To allow a TextField to grow as its content text grows, use the axis initializer pa...

Continue Reading...

Reading time: 2 min

This recipe shows a more advanced SwiftUI bar chart that shows min, max and average for each data point. The end result looks like this:

Screenshot%202022-06-21%20at%2008.36.14

Charts framework is available starting in SwiftUI 4 (iOS 16, macOS 12.4).

Let's start off by creating a simple structure that represent air tempera...

Continue Reading...

Reading time: 3 min

This recipe shows how to add a style SwiftUI Charts using Apple's new Charts Framework. You can change the colors, line styles and visibility of all parts of the chart, including its plot area, marks and axes. The end result looks like this:

Screenshot%202022-06-20%20at%2018.16.59

Charts framework is available starting in S...

Continue Reading...

Reading time: 1 min

This quick recipe shows how to convert AxisValue to a Text using Apple's new Charts Framework. The end result looks like this:

Screenshot%202022-06-20%20at%2020.02.01

Charts framework is available starting in SwiftUI 4 (iOS 16, macOS 12.4).

When you construct X or Y axis in SwiftUI charts using chartXAxis or chartYAx...

Continue Reading...

Reading time: 4 min

This recipe shows how to add a Scan Line / Lollipop to a Chart to SwiftUI using Apple's new Charts Framework. It allows you to read data from the chart depending on its position using tap and drag gestures. The end result looks like this:

preview

Charts framework is available starting in SwiftU...

Continue Reading...