danielsaidi / RichTextKit

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

How to resized image #163

Open TanjimaKothiya opened 3 months ago

TanjimaKothiya commented 3 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 2 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".