user15242190
user15242190

Reputation:

iOS - Handle an Event: whenever a text is clipped

I'm developing an URL shortner app, the base work is done but I want to add a feature where it automatically shorts an URL (in background) as soon as the user copies a valid URL, I have all the things running except that event whenever a text is clipped.

I have no idea how to build a background service and how to handle the event in swift.

I want something like this.

Upvotes: 0

Views: 199

Answers (1)

Fabio
Fabio

Reputation: 333

You can only get the clipboard while your app is in foreground. So for you being able to see if someone copies something they have to return to your Application. Have a look into this: UIPasteboard - Apple Docs

Upvotes: 1

Related Questions