Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue 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 ?

Đang mở
#1,287 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
swift
Lĩnh vực
mobile

Hướng nghiên cứu

Bắt đầu với protocol TextViewAttachmentDelegate và quá trình chuyển đổi của nút sourcecode được mô tả trong issue. Tái hiện việc chuyển từ HTML sang UITextView mà không chỉnh sửa HTML, sau đó theo dõi thời điểm deletedAttachment được gọi. Hoàn thành khi giải thích được callback hoặc ngăn chặn callback xóa không mong muốn, đồng thời vẫn giữ các callback cho những lần xóa attachment thực sự.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Swift
Star
667
Fork
153
Merge trung bình
2 ngày 6 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wordpress-mobile/AztecEditor-iOS

Tất cả issue của wordpress-mobile/AztecEditor-iOS

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.