Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Why is func textView(_ textView: TextView, deletedAttachment attachment: MediaAttachment) in the TextViewAttachmentDelegate protocol being called when the user taps on the source code button and comes back to the editor view from html ?

Ouverte
#1,287 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
25/100
Type d'issue
Bug
Clarté
À clarifier
Activité
À l'abandon
Stack technique
swift
Domaine
mobile

Piste de recherche

Commencez par le protocole TextViewAttachmentDelegate et la transition du bouton sourcecode décrite dans l’issue. Reproduisez le passage de HTML à UITextView sans modifier le HTML, puis déterminez quand deletedAttachment est appelé. Le travail est terminé lorsque le callback est expliqué ou qu’un callback de suppression intempestif est empêché, tout en préservant les callbacks pour les suppressions réelles d’attachments.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Hello, thanks for your help. This is a great library. I need to have a model object that represents the pictures in a AztecEditor view. So I need to keep the pictures in the aztecview and the model in sync. There is no problem for the model creation after selecting a picture for insertion, but I need a way to also delete from the model the pictures that get deleted by the user. I came across this in the implementation of the TextViewAttachmentDelegate protocol:

func textView(_ textView: TextView, deletedAttachment attachment: MediaAttachment) {},

that looks exactly what I need. The problem is, I have verified that this delegate method gets called also when switching from html editor to UITextView using the 'sourcecode' button. This breaks my logic. Is there a special reason why the method is called when switching from html to UITextView without even touching the html text before pressing the button ? Many thanks for your help.

Langage dominant
Swift
Étoiles
667
Forks
153
Merge moyen
2 j 6 h
PR mergées (30 j)
4

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de wordpress-mobile/AztecEditor-iOS

Toutes les issues de wordpress-mobile/AztecEditor-iOS

Issues similaires

Plus d'issues Swift

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.