What library can I use to create a drawing app, PencilKit seems quite limited for drawing surprisingly

I can't speak to PenciKit, but I'm actually in the middle of implementing something in UIKit similar to a canvas that requires the ability to drag across multiple views and view hierarchies, and do various operations such as selection, move, copy, delete, transform, etc. I'm having pretty good success having different subclasses of `UIGestureRecognizer` for different tools. Maybe something to consider. I'm fairly experienced with UIKit and CoreGraphics and you will most likely need to drop down to CoreGraphics. One of the main reasons is that in order to get good performance you will want to only redraw what is absolutely necessary and this is easier to do in CoreGraphics. You may consider doing something like this:

import UIKit

protocol Brush: UIGestureRecognizer { }

class PaintBrush: UIPanGestureRecognizer, Brush {

var color: UIColor = .black
var size = CGSize(width: 10, height: 10)

override var state: UIGestureRecognizer.State {
    didSet {
        switch state {
        case .changed:
            paint()
        default:
            break
        }
    }
}

func paint() {
    guard let view else { return }
    // draw in view's layer
}

}

class CanvasView: UIView { var brush: Brush? { didSet { if let oldValue { removeGestureRecognizer(oldValue) } if let brush { addGestureRecognizer(brush) } } } }

/r/swift Thread