danielsaidi / RichTextKit

RichTextKit is a Swift SDK that helps you use rich text in Swift and SwiftUI.
MIT License
943 stars 126 forks source link

How to resized image #163

Open TanjimaKothiya opened 7 months ago

TanjimaKothiya commented 7 months ago
func insertImage() {

    let selectedRange = context.selectedRange.location
    let richTextInsertion = RichTextInsertion<ImageRepresentable>.image(selectedImage ?? UIImage(), at: selectedRange, moveCursor: true)
    context.handle(.pasteImage(richTextInsertion))

    context.isEditingText = true

}
danielsaidi commented 7 months ago

Hi @TanjimaKothiya

This is currently not supported. You could inject custom views for this, but resized images are a bit tricky without having a fixed "page size".