clipboard icon indicating copy to clipboard operation
clipboard copied to clipboard

Add hasPattern function

Open hosseinpro opened this issue 4 years ago • 0 comments

Describe the Feature

The Clipboard object has a general function hasString() but it is not enough. It is necessary it has a function like hasPattern that gets a pattern for example in Regular Expression format to check the clipboard content and return true or false. We could implement it on our code and I did it but since iOS 14 every time I get the string to check it with Requgalr Expression, iOS displays X pasted from Y message to the user because I have to get the string before checking.

Possible Implementations

I am not an iOS developer but I think Apple has a function for custom pattern checking in UIPasteboard.DetectionPattern and explains it here:

https://developer.apple.com/documentation/uikit/uipasteboard/detectionpattern/3622466-init

https://developer.apple.com/documentation/uikit/uipasteboard/detectionpattern

hosseinpro avatar Nov 19 '20 19:11 hosseinpro