Skip to main content Skip to secondary navigation

Spring 2020 WWDC

Main content start

Spring quarter is always interesting timing for CS193p since Apple's Worldwide Developers Conference (WWDC) happens right after it ends and usually introduces a lot of new stuff. After the Spring 2020 quarter ended, we incorporated some of those WWDC changes into one of the lecture demos, EmojiArt.  That version is attached below.  However, the version below will be made completely irrelevant by the version from the Spring 2021 iteration of CS193p, so if you are here and the lectures from Spring 2021 have already all shipped, you will want to ignore this page entirely.  The code below must be built using Xcode 12 and builds an application that runs only on iOS 14 and/or Big Sur.

One of the most notable changes to EmojiArt that resulted from the WWDC that occurred right after Spring 2020's CS193p is that it has been converted to be a "pure SwiftUI" app (e.g. no more UIKit code like SceneDelegate) and uses the new DocumentGroup capability.  This turns EmojiArt into a multi-document application and makes it work as a native application on both iOS and on the Mac.  Not much code is required to do this.  In fact, most of what is required is to add undo functionality to EmojiArtDocument (which we are happy to have anyway, of course).  While we're at it, we also now properly store the image data for the background in the document (when necessary, e.g. you use a photo from the camera as the background) instead of the URL-izing workaround (hackery?) from lecture.

The other major change is to the emoji palette UI.  It has been completely reworked to utilize a context menu approach rather than a modal sheet for editing.  This is somewhat of an "experimental" UI for the palette, but is a fun, quite different way of approaching it than we did in lecture.  We ended up doing something similar in lecture in Spring 2021.

New stuff is marked with "// new" comments throughout.

EmojiArt Xcode 12