TimelineView, introduced in iOS 15, can be used to change objects on a canvas over
time. The article takes the star shape defined previously and animates rotating the
star shape on the canvas in a SwiftUI view.
TimelineView was introduced in iOS 15 to control how a view can change over time.
This article takes the heart shape defined previously and animates by changing the
path on the canvas in a SwiftUI view.
The canvas view provides a mechanism to draw in SwiftUI. The canvas takes
GraphicsContext and size as parameters to allow immediate mode drawing within the
containing frame. Here we draw system shapes as well as freeform shapes using path
Create an interactive star rating SwiftUI component. This article will use the star
cutout shape with rounded corners as well as elements of the custom slider to create
a star rating component in SwiftUI.
There is limited ability to customise the Slider in SwiftUI as of Xcode 13. These are
three options of presenting a custom view of the Slider in a SwiftUI App. Set the
tint color and background color of the slider; fall back to using the UISliderView
from UIKit or create a custom SliderView from scratch in SwiftUI.
The Star shape used in the Star cutout has sharp corners. This article shows how to
modify the shape to create stars with rounded corners. The radius of the corner can
be set as a parameter to specify the rounding of the outer and inner corners of the star.
Path can be used in SwiftUI to create practically any shape. I found creating a
cutout shape difficult until I found that FillStyle can be used with the even-odd
rule. This article shows how to create a shape outline where the outside can be
colored and the center kept transparent to allow other content to show …
One way to animation the change in text size is to use scale effect, however the text
will appear blurred when scaled up. A custom AnimatableModifier can be used to
smoothly animate the resizing of text in SwiftUI, which results in displaying clear
text at all sizes through the animation.
Roman numerals, from ancient Rome are a way of writing numbers using these letters
from the latin alphabet [I, V, X, L, C, D and M]. Each letter has a fixed integer
value and can be combined to represent any number from 1 to 3999. This article
demonstrates how to convert a integer to the Roman Numeral representation.
A line chart is a graphical representation of changes in some data over time or
between categories. The chart consists of two axes; x-axis is the horizontal axis
representing the time change; and y-axis is the vertical axis representing the
magnitude of the data. This article demonstrates how to create simple line …