In order to display text from an array in a text view, it's necessary to extract each individual string. This video shows how to get text out of every string in the array and put it inside of the text view with a couple of line breaks in between.
- [Instructor] Now we're changing the job of showText … to display any copied strings from this pastedStrings array. … The first thing to do is to clear out our text views. … Type textView.text, … we're going to to set it equal to an empty string, … so two sets of quotes. … And then we're going to create a loop. … For str, short for string, in pasted strings. … It's going to loop through all those strings … and then it's going to type textview.text.append … and then we want this one that says other. … And then in here we're going to put str. … So it's going to append whatever's in that. … The issue with this is what's going to happen … is there's going to no spacing in between … the items coming from the paste boards, … so they're going to be one right after the other. … What we want is one item and then a couple of line breaks … and then the item. … A simple way to do that is … to put this is of quotes, like that. … And then put a back slash before str … and wrap str in parentheses. …
- Creating an Xcode project
- Navigating the Xcode interface
- Running your first app
- Building layouts with storyboards
- Connecting UI elements to code
- Coding interactivity