Filters

Hide filters
Platform
Content Type
Difficulty

All Tutorials · 8 Results

Contained in: Supporting SwiftUI with Core Graphics swiftui
iOS & Swift
Supporting SwiftUI with Core Graphics
Learn how to support SwiftUI drawing with Core Graphics! This course picks up where our Drawing in iOS with SwiftUI course left off. You’ll enhance the Open Mind app with help from UIKit and Core Graphics. You’ll learn how to integrate UIKit views with SwiftUI, use UIKit touch…
iOS & Swift

Host a UIView in a SwiftUI View

Upgrade a SwiftUI drawing pad to UIKit. Examine the app architecture and understand how to insert UIKit views in a SwiftUI…
iOS & Swift

Anatomy of a View

Review how the SwiftUI paradigm differs from UIKit. Learn how a view is rendered, and discover Core Animation layers and Core Graphics contexts…
iOS & Swift

Create a CGImage

…them laid out in 3d. On the left, all the views are listed in a hierarchy, and you can see how the SwiftUI views are hosted in a UIWindow. Open up the Object Inspector and you can see that the SwiftUI views are hosted by a UIHostingController…
iOS & Swift

Color Picking from a Bitmap Image

…very simple view. When you’re setting borders and shadows for UIView, you have to do it on the view’s Core Animation layer. SwiftUI has done away with all that, and in SwiftUI we work directly with Views. But here we’re using a UIView, so we change…
iOS & Swift

Build a UIKit Drawing Pad

…user has used several fingers, but in this case we only want the first one. Instead of saving a path, like in the SwiftUI drawing pad, we’re going to draw a stroke directly into the drawingImage. Set up the image with UIGraphicsImageRenderer. drawingImage = UIGraphicsImageRenderer(size: bounds.size).image { context…
iOS & Swift

Create a Thumbnail

…drawing button, draw a picture and then save it. Now, this drawing is huge. We could resize it with SwiftUI modifiers, but as an alternative, I’m going to show you how to render a smaller version of an image. Model.swift We’ll start in the model, again. Create…
iOS & Swift

Drawing with Pencil

When I draw really fast, the lines aren’t smooth, because we’re drawing straight lines between the drag points. Coalesced Touches In the SwiftUI drawing pad, we replaced the stroke after drawing it with a Bezier spline which smoothed out the curve, but Pencil has a clever…