You used to be able to select a drawing, long press to show the edit menu (copy, duplicate, delete, ...), copy the item and paste it after another long press on the canvas. However, since iOS / iPadOS 16.1 long pressing the canvas does not show any menu.
The action still works if you connect an external mouse to your iPad, activate the secondary click functionality and use the right mouse button to click on the canvas. This shows the menu and you can paste the copied drawing.
It seems to be broken in all PencilKit-based apps, including Apple's sample apps. Is there any workaround? This is a major problem for my app and used to work fine since the introduction of PencilKit with iOS 13.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have a ScrollView with several Buttons and a .refreshable modifier. As soon as I pull to refresh and the refresh indicator appears, the tap targets no longer match the visible button positions. For example, tapping button A triggers button B’s action, as if the hit-testing region didn’t move along with the content.
This only happens while the refresh indicator is shown. Before pulling to refresh, everything is correct and afterwards as well. Tested on iOS 18 and 26 (Xcode 16.4, Xcode 26).
Here is a minimal reproducible example:
import SwiftUI
struct ContentView: View {
var body: some View {
ScrollView {
VStack {
Button("Button A") {
print("A")
}
.buttonStyle(.borderedProminent)
Button("Button B") {
print("B")
}
.buttonStyle(.borderedProminent)
Button("Button C") {
print("C")
}
.buttonStyle(.borderedProminent)
Button("Button D") {
print("D")
}
.buttonStyle(.borderedProminent)
Button("Button E") {
print("E")
}
.buttonStyle(.borderedProminent)
}
.frame(maxWidth: .infinity)
}
.refreshable {
try? await Task.sleep(for: .seconds(60))
}
}
}
I am using Xcode 15 beta 5 with iOS 17 beta 4 SDK. By building with the iOS 17 SDK my app got all the new inks which work great. Saving/encoding the PKDrawing to Data also works fine. However if I want to load the same PKDrawing again, on the same simulator or device (i.e., same iOS version) it fails with "Apple Drawing Format is from a future version that is too new.".
From my understanding, reading https://developer.apple.com/documentation/pencilkit/supporting_backward_compatibility_for_ink_types?changes=_2 this is the expected behaviour when trying to load such a PKDrawing on an older iOS version which doesn't support the new ink types.
Here is a short example, which prints the error:
var drawing = PKDrawing()
let strokePoints = [
PKStrokePoint(location: CGPoint(x: 0, y: 0), timeOffset: 0, size: CGSize(width: 3.0, height: 3.0), opacity: 2, force: 1, azimuth: 1, altitude: 1)
]
let strokePath = PKStrokePath(controlPoints: strokePoints, creationDate: Date())
drawing.strokes.append(PKStroke(ink: .init(.watercolor), path: strokePath))
do {
let data = drawing.dataRepresentation()
let drawing2 = try PKDrawing(data: data)
print("success")
} catch {
print(error)
}
}
Saving & loading a PKDrawing which does not use any of the new ink types works fine.