Many shapes and patterns can be created using Path and Canvas in SwiftUI. It would be
great to be able to save these as images in the Photo Library. This is possible using
UIKit, by first converting the SwiftUI View to UIImage and then saving this image to
I discovered a bug in the game I had written on Tic Tac Toe. When the board is in a
certain state, the system did not take the obvious winning move. It still won the
game, but with an extra move required. This article details how to write a failing
unit test to reproduce the issue and how to update the minimax …
A tab bar is presented at the bottom of the screen in iOS apps and is used for
navigation between the major sections of an app. TabView is used in SwiftUI
to easily add multiple tabs to the main view.
It is said that use of Canvas to create complex shapes can provide better performance
in SwiftUI. This article compares performance of scrolling through multiple instances
of the same card pattern created using shape, canvas or image.
I discovered, when playing around with the rounded-corner star shape, that the same
basic shape could be used to create a cog shape. This article demonstrates the
creation of the cog shape and the use of timelineview to animate its rotation in
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