From the course: Building a Note-Taking App for iOS 11 with Swift
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Show and hide the software keyboard
From the course: Building a Note-Taking App for iOS 11 with Swift
Show and hide the software keyboard
- [Instructor] So I mentioned earlier that we can show the software keyboard with Command + K or Hardware, Keyboard, Toggle Software Keyboard in the simulator application. Without the software keyboard showing, if you select an item and you click inside of the text field, you don't get that software keyboard. If you press Command + K, though, you get it to show up. So if I go back to my main notes, I select a note again, the keyboard doesn't show up until I select my note. So what if we wanted that text view to be selected automatically and the keyboard to pop up right away so the user can just start typing text into the text view? Let's look at how that works. I'll stop the app and return to Xcode in DetailViewController.swift. So what we're going to do is handle the method in here with viewWillAppear. So every time the view's about to appear, we're going to select that text view and make it show the keyboard. So let's handle that right below viewDidLoad. So it's viewWillAppear. And…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
Set a delegate for the table view3m 22s
-
Transition to a second view controller7m 11s
-
Create a custom class for a view controller3m 41s
-
Send data to the second view controller7m 50s
-
Send data back to the original view controller7m 34s
-
Show and hide the software keyboard2m 18s
-
Change title sizes2m 7s
-
-