Apple Text Find & Replace
Implements high-performance find and replace functionality for Apple platform text editors using TextKit 1 and 2.
This skill provides comprehensive guidance for integrating system-standard find and replace features into Apple platform text editors, covering both stock UITextView/NSTextView and custom views. It specializes in advanced TextKit implementations, focusing on non-destructive highlighting via temporary or rendering attributes to avoid polluting the document's undo stack or storage. By utilizing the correct reverse-iteration patterns for 'replace-all' and leveraging platform-specific protocols like UITextSearching and NSTextFinderClient, it ensures crash-free, performant search experiences even in large documents.
主要功能
01Custom view support via UITextSearching protocol
02Reverse-iteration 'Replace All' pattern for data integrity
03Non-destructive highlighting via TextKit rendering attributes
040 GitHub stars
05Native UIFindInteraction and NSTextFinder integration
06Optimization strategies for searching large documents
使用场景
01Performing safe bulk text replacements in TextKit 2 documents
02Implementing search highlights that don't trigger undo entries
03Adding a system-style search bar to a custom iOS code editor