
Learn how to build a group drawing app for SharePlay, using the Group Activities framework, PencilKit, and Swift 5.5 async/await to share a canvas on a FaceTime call.
Learn to build an iOS 15 group drawing app with Xcode 13, leveraging SharePlay powered by the Group Activities framework and Group Activities API, using UIKit and PencilKit.
This course targets learners with basic iOS development skills and Swift knowledge, familiar with UIKit; even with SwiftUI experience, you can follow along. It emphasizes learn-by-doing with detailed, step-by-step explanations.
Set up iOS 15 SharePlay environment on Mac with Xcode 13 or later, obtain Group Activities entitlement through Apple Developer Program membership, and test on iOS 15 via FaceTime call.
Create an Xcode project for an iOS app named GroupDraw, selecting the app template, storyboard interface, and Swift language, then choose a save location.
Add a drawing canvas with PencilKit to enable any-input drawing in the iOS 15 SharePlay app. Configure PKCanvasView and auto layout to cover the screen.
Add a PKToolPicker to the drawing app to provide brushes, pens, erasers, and colors, with the canvas view as the first responder and observers for tool changes.
Add a clear button in the navigation bar to reset the drawing canvas by assigning a new PKDrawing to canvasView, via handleClearCanvas.
Add undo and redo buttons to the drawing app, implement handleUndoStroke and handleRedoStroke, track removed strokes with removedStrokes, and enable or disable buttons based on canvas activity using PKCanvasViewDelegate methods.
Explore SharePlay, iOS 15's feature for synchronized experiences on a FaceTime call, powered by the Group Activities framework, enabling music playback, video streaming, and screen sharing with others.
Explore the group activities framework powering SharePlay, enabling app-specific activities and a synchronized FaceTime canvas. Ensure end-to-end encryption and enable group activities in Xcode with an active Apple Developer Program.
Define a custom group activity by adding the Group Activities entitlement, implementing GroupActivity with metadata in GroupDrawActivity, and wiring session management for a shared drawing experience on iOS 15.
Add start and end group activity buttons as right bar button items, implement the start and end handlers, and move undo and redo to the left bar button items.
Configure and manage group sessions with the group activities framework to synchronize drawing activity across devices and use group session messenger to transmit drawing data between participants.
Configure group session by initializing a GroupSessionMessenger, subscribing to activeParticipants, and joining the session, and define GroupDrawMessageType with join, stroke, undo, and clear to exchange canvas and drawing updates.
Send the current drawing canvas to new participants and on each new stroke using GroupSessionMessenger, by configuring the group session and sending a PKDrawing derived from the last stroke.
Learn to receive data from other participants using GroupSessionMessenger, iterate messages asynchronously, and handle join, draw, undo, and clear to update the canvas and send the current canvas state.
Implement and test group activity in a SharePlay drawing app by configuring a session, awaiting prepareForActivation(), handling activation results, and starting or ending the activity via a FaceTime call.
Implement undo, redo, and clear for a group canvas by sending undo, redo, and clear messages to all participants via GroupSessionMessenger.
At WWDC 2021, Apple announced a new exciting feature called SharePlay, which lets you enjoy activities together with your friends connected on a FaceTime call. With SharePlay, users can watch their favourite movies with friends, listen music or even enjoy your app together.
This course will help you understand everything you need to know about SharePlay and GroupActivities framework so that you can build your own SharePlay compatible app for iOS 15. This course will guide you through all the steps of building a group drawing app from scratch.
We will use UIKit framework for building the app user interface. In most cases we will be adding UI elements programatically instead of using Storyboard. If you have some experience with SwiftUI, but never used UIKit before, you should still be able to follow along and learn the skills taught in this course.
We will be using PencilKit framework for adding drawing canvas and also combine framework a little bit. You don’t need to have prior experience in PencilKit or Combine, we will explain everything you need to know.
This course follow learn by doing approach. You will learn every concept by writing code yourself and see that in action.
SharePlay is a new exciting feature, which opens up the possibility of many cool apps. By enrolling in this course, you get a serious head start over other developers building SharePlay apps.
This course is for someone who has at least some basic level of iOS development skill with Swift. You don’t need to be an expert iOS developer or don’t need to be expert at any framework. But we assume that you already started learning iOS development. If you have never tried iOS development before, then I would recommend you to take a beginner iOS course first before trying this one.