At some point, you may want to clear the pasteboard of your application. This brief video shows how to do just that and how to reset your app to its original state.
- [Instructor] To finish off our application we're going … to go to the trash, that is the trash was pressed method. … So when the user wants to clear out the paste board, … we're going to reset the app to its initial state. … That involves removing everything from the pasted strings … array so pastedStrings.removeAll. … Emptying out the text view so textView.text I'll set that … equal to empty string. … And then finally we're going to remove all of the persistent … storage data. … So UserDefaults.standard.removeObjectforKey … and then we'll use the DATA_KEY key … to remove all of the saved data. … So let's confirm that that button works. … Run the application and you're going to see items loaded up. … There we go our two saved items, hit the trash can, … and now they're gone. … If we tab back over to X Code, closing the running … application and then run it again, you should notice … that there is no data saved or rather the data that we see … is only the single last thing that we copied …
- Creating an Xcode project
- Navigating the Xcode interface
- Running your first app
- Building layouts with storyboards
- Connecting UI elements to code
- Coding interactivity