Destecting double tap on Apple Pencil with SwiftUI

Hello,

I am making an app for iPad and I would like to be able to detect when the Apple Pencil is double tapped with my SwiftUI (I am not using PencilKit because I'm not making a drawing app). I saw it was possible with UIKit but didn't quite understand if I could use UIKit functions on SwiftUI.
I just want to perform some action when the Pencil is double tapped, very basic.

If anyone could help me I would really appreciate it !
Thanks by advance,

Cyprien
I saw this link but the code is for UIKit and I'm using SwiftUI which don't work together perfectly. I saw there are ways of using UIKit code with SwiftUI but I didn't understand how to do it in my case.
Destecting double tap on Apple Pencil with SwiftUI
 
 
Q