From the course: iOS Development: Security

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

The pasteboard spy app

The pasteboard spy app - iOS Tutorial

From the course: iOS Development: Security

Start my 1-month free trial

The pasteboard spy app

- [Instructor] The general pasteboard can be accessed also programmatically. Let's create an app that will do that. I'm going to stop this one. File, New Project. Single View is fine. And I call it PasteboardSpy. Alright, now let's switch to the main storyboard. I'm going to add the UI Label with the text, Pasteboard Content. And I also add a Text View. And I also create a Referencing Outlet called Text View in the View Controller. So let's bring up the matching View Controller and add the outlet for the Text View. Let me close this one and add new Referencing Outlet called Text view. Now, after all these preparations we can retrieve the most recently added string item from the general baseboard. Let me switch to the ViewController. And in the viewDidLoad method, I'm going to create a constant called pasteboardText, and I assign it a value from the UIPasteboard, general and it's string property. It may be nil. So if it's empty, then I simply display the string pasteboard is empty…

Contents