Arrays can hold lists of objects, including strings from the pasteboard. This video shows how to get strings from the pasteboard and how to store them into an array.
- [Instructor] Now that we've made our app … so that it can paste from the Pasteboard … every time it becomes active, … let's look at pasting multiple strings, that is, … when we have a new thing … that we've copied from the Pasteboard … that instead of replacing what's already there, … it adds to it, so we're going to head back … to our view controller class … and in here we're going to create an array. … So we'll create a new line here. … A few lines below that text view line, … I'm going to create a variable called pasted strings … and the datatype for that is going to be a string array. … So after pasted strings, a colon … and then string in square braces … and we're going to set that equal to an empty array … by typing open and closed square braces, … and now we're going to do is an add text, … we're going to make a modification. … The first thing we're going to do is say … if we don't have anything in the Pasteboard, … then we don't want to proceed with this method. … We can do that using something called a guard statement. …
- Creating an Xcode project
- Navigating the Xcode interface
- Running your first app
- Building layouts with storyboards
- Connecting UI elements to code
- Coding interactivity