Reputation:
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.
Upvotes: 0
Views: 199
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