Drawing in iOS with SwiftUI

Learn about drawing using SwiftUI by creating custom controls using a combination of SwiftUI and Core Graphics. Covers shapes, colors, drawing with Pencil, and how to integrate them into a non-trivial app. By Catie Catterwaul.

2.8 (4) · 2 Reviews

Download materials
Save for later
Comments
Share

Who is this for?

This course is for iOS developers who are familiar with Swift and SwiftUI fundamentals, and would like to create custom user interfaces using SwiftUI.

Covered concepts

  • SwiftUI shapes & colors
  • Custom shapes
  • Custom controls using SwiftUI
  • Canvas view
  • Timeline view

Part 1: Drawing with SwiftUI

01
Shapes 6:55
Toggle description

Start off by going over simple colors and shapes and understand how to add them to your views. Use modifiers to clip views to your chosen shape.

Colors 6:46
Toggle description

Learn about Gradients, how to create your own named colors, and what dark mode means for your colors.

Toggle description

Explore SwiftUI paths, learn to create simple custom shapes, and the many ways of outlining with a stroke.

Toggle description

Dig deeper into SwiftUI paths and draw a custom heart shape with help from Bezier curves and transforms.

Toggle description

Learn how to group your custom shapes with an Enum, and display them all in a grid.

Toggle description

Create data storage for the mind map cells using an environment object, and draw example cells from the model.

Toggle description

Learn how to periodically update and animate views with TimelineView.

Toggle description

Learn how to create gestures to select a mind map cell, drag it, and add a new cell by double-tapping the background.

Part 2: Custom Controls

Toggle description

Create a custom slider with a gradient background, and learn how to send inputs to controls and receive outputs.

Toggle description

Later, you’ll create a sketch pad, so here you’ll create a reusable color picker to allow the selection of different drawing colors.

Toggle description

SF Symbols are fantastic Apple-designed vector icons. But did you know you can create your own SF Symbols? Open up your vector editor and have a go!

Custom Menu 11:34
Toggle description

Learn about rotation and scale effects by creating a circular flyout menu and placing your icons around the edge of a circle.

Toggle description

Install the menu into the app and add custom actions to it. You’ll be able to delete cells and also use your shapes grid to choose the shape of each cell.

Toggle description

In this episode, learn how easy it is to create a simple drawing pad using drag gestures and SwiftUI paths.

Toggle description

To practice installing an existing custom control, install the color picker into the drawing pad and hook it up to the drawing color.

Toggle description

To practice installing an existing custom control, install the color picker into the drawing pad and hook it up to the drawing color.

Instructors

Catie Catterwaul

Contributors

Catie Catterwaul

Instructor

Adriana Kutenko

Illustrator

Abigail Seperidad

Video Editor

Over 300 content creators. Join our team.