When your app enters the foreground and becomes active, whether it's at launch or after being placed in the background and tapped again, an event occurs in code. This video shows how to handle that event and how to accept pasteboard input at that time.
- [Instructor] Our next step is to make it … so that, whenever we open the application … or put in the background … and bring it back into the foreground, … anytime we do that, it's going to grab … text from the pasteboard … and then put it inside of our text view. … The first thing I'm going to do … is create a new method called AddText. … Now, for now, all this is going to do … is call ShowText, but we're going to add to it later on. … So just trust me on this one. … There is value in doing it this way. … It's just something we're not going to see … in this particular movie. … So, with that, let's go over to a different file. … So remember, you can use the Navigator … or you can use the Jump bar. … We looked at using the Jump bar last time, … so let's use the Navigator this time, so show it, … click on SceneDelegate.swift, … and I'm going to hide the Navigator. … And the code you're looking for is called … SceneDidBecomeActive, … which you can read about in the comments here. … This is an event that's triggered …
- Creating an Xcode project
- Navigating the Xcode interface
- Running your first app
- Building layouts with storyboards
- Connecting UI elements to code
- Coding interactivity