iOS14, UIPasteboard new api, detectPatternsForPatterns:completionHandler:, why not support Regular Expressions

not like before,iOS14 show “noteworthy float window” when getting data from Pasteboard。

It‘s OK to notify user that the app is reading Pasteboard.


iOS14 add new APIs to detect Pasteboard content without showing “noteworthy float window”

detectPatternsForPatterns:completionHandler:
detectPatternsForPatterns:inItemSet:completionHandler:


but these api only detect simple URL pattern which seems little value or interest for developer;

why not making these apis support Regular Expressions detecting。
if so,app can detect what it really need before read,
means less Pasteboard reading,
means less “noteworthy float window” showing,
means better user experience。
My app needs to check UIPasteboard to make sure there's no any unsupported character before user paste it.
After then we need to apply text color for it, but the background color with a line-break messed up the whole UITextView.
So we have to split it to make sure the background color works better.
But there's no paste event in iOS, so I have to check UIPasteboard every time in shouldChangeTextIn delegate.
So the users will see this prompt while they're typing.
It's annoying and making some of my users misunderstood the purpose of accessing UIPasteboard.
Apple should add something like Privacy - Photo Library Additions Usage Description so we can explain why we need it.
Don't just prompt a warning and make users thinking we're like a fraud or something.

iOS14, UIPasteboard new api, detectPatternsForPatterns:completionHandler:, why not support Regular Expressions
 
 
Q