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.
Post
Replies
Boosts
Views
Activity
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.
My iOS 14 simulators are constantly crashing/rebooting. Console shows a crash inside "NRPairedDeviceRegistry waitForPairingStorePathPairingID" whereas Xcode logs "XPC connection interrupted
Message from debugger: Terminated due to signal 9"
I have tried different simulators, deleted and reset existing one, re-installed the Xcode 12 beta 1 but it's still happening.
Any suggestions how to use the simulators?
Crashed Thread:				0	Dispatch queue: com.apple.main-thread
Exception Type:				EXC_CRASH (SIGKILL)
Exception Codes:			 0x0000000000000000, 0x0000000000000000
Exception Note:				EXC_CORPSE_NOTIFY
Termination Reason:		Namespace LIBXPC, Code 0x4
Application Specific Information:
CoreSimulator 725.10 - Device: iPhone SE (2nd generation) (CAA00201-7B3F-4663-A855-F927586BDDD2) - Runtime: iOS 14.0 (18A5301v) - DeviceType: iPhone SE (2nd generation)
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0	 libsystem_kernel.dylib				 0x00007fff5bb62e36 semaphore_wait_trap + 10
1	 libdispatch.dylib						 0x00007fff20104244 _dispatch_sema4_wait + 16
2	 libdispatch.dylib						 0x00007fff20104743 _dispatch_semaphore_wait_slow + 98
3	 com.apple.private.NanoRegistry 0x00007fff52e2ff74 -[NRPairedDeviceRegistry waitForPairingStorePathPairingID:] + 175
4	 com.apple.BulletinDistributorCompanion 0x00007fff47ede0b5 -[BLTSettingSyncServer init] + 260
5	 com.apple.BulletinDistributorCompanion 0x00007fff47eb41f8 -[BLTSettingSyncInternal connect] + 29
6	 com.apple.BulletinDistributorCompanion 0x00007fff47ecf1f4 -[BLTSettingSync initWithSectionConfiguration:queue:watchKitAppList:] + 134
7	 com.apple.BulletinDistributorCompanion 0x00007fff47ec4e34 -[BLTBulletinDistributor init] + 660
8	 com.apple.BulletinDistributorCompanion 0x00007fff47ec4b8b __43+[BLTBulletinDistributor sharedDistributor]_block_invoke + 16
9	 libdispatch.dylib						 0x00007fff20103dac _dispatch_client_callout + 8
10	libdispatch.dylib						 0x00007fff20105001 _dispatch_once_callout + 20
11	com.apple.BulletinDistributorCompanion 0x00007fff47ec4b79 +[BLTBulletinDistributor sharedDistributor] + 46
12	bulletindistributord					 0x000000010eb16388 0x10eb15000 + 5000
13	libdyld.dylib								 0x00007fff20253941 start + 1