From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Selection in text views

Selection in text views

- [Instructor] UITextViews are scrollable, editable counterparts to UILabels. While you can type and edit within them, you can also make selections within the text view. Let's learn how you make those selections. When you open up the exercise file, you'll find an Xcode project that has a storyboard set up with two buttons, a label, and a text view. I've set the text view to be non-editable in the attributes, so we don't have a keyboard interfering with our exploration. Go ahead, set the simulator to iPhone XR, and go ahead and run that, just as it is, and you'll find that you can actually select text right now, and you can actually use some functions, like share, right now, and those are default. But we're going to define two new ones. One is to select the text and stick it in the label, and the other one is to bold the text, okay. So let's go ahead and stop the app. And I'm going to go over here to view controller, and then we can close up the rest of this stuff 'cause I don't need…

Contents