Scroll UITextView a texto específico

Tengo una uitextview con textos grandes y arriba tengo un campo de búsqueda. Cualquier cosa buscada, me encantaría que uitextview se desplazara a ese texto específico y resalte. Y debo asegurarme de que uitextview se desplaza de tal manera que el texto buscado permanezca en la primera línea

Completé la vista de texto con texto atribuido con algunos atributos. Lo que intenté es obtener el texto antes del texto de destino e intenté obtener el tamaño del mismo agregando los atributos exactos que agregué en el texto de vista de texto al principio.

hizo un CGPoint usando esa altura y configuró el contentOffset de uitextview. Pero la vista de texto no se desplazó cerca del texto de destino. Tal vez mi enfoque es incorrecto ya que no tengo el ancho de la vista de texto cuando configuro los atributos

Mi código es:

func goToBla() {
        if let string = ayatTextView.text {

            if let range = string.range(of: tazweedAyahas[8].text) {
                let firstPart = string[string.startIndex..<range.lowerBound]
                print("before \(tazweedAyahas[5].text) : ")
                print(firstPart)


                if let otherStr = firstPart as? NSString {
                    let paragraphStyle = NSMutableParagraphStyle()
                    paragraphStyle.alignment = .center

                    let size = otherStr.size(withAttributes: [NSAttributedStringKey.paragraphStyle: paragraphStyle,
                                                   NSAttributedStringKey.font: UIFont(name: "me_quran", size: 30)
                        ])

                    let point = CGPoint(x: 0, y: size.height)
                    ayatTextView.setContentOffset(point, animated: true)
                }


            }
        }


    }

Respuestas a la pregunta(1)

Su respuesta a la pregunta