From the course: iOS Lean Controllers: 2 Controls, Views, Extensions, and Networking
Unlock this course with a free trial
Join today to access over 22,400 courses taught by industry experts.
Adding the custom initializer to configure place holder text
From the course: iOS Lean Controllers: 2 Controls, Views, Extensions, and Networking
Adding the custom initializer to configure place holder text
- [Instructor] Alright, welcome back. At present, our add new item, view control, whenever you're gonna use it, it's always going to display the place holder, which is enter shopping list. And, most probably, you want to change that. I mean if you're going to use it in the different view controller, you're going to say add new grocery item. Add new car, add new task, you know? So it's has to be a little bit configurable. So, let's see how we can actually do that. Definitely we will need a new intializer, but what are we going to pass in. So, we can actually pass in the frame, or we can pass in the controller, itself, the parent controller, who is using that, and the place holder text, which we can actually say over here with b string. Let's go ahead and run this, or build it. And, of course we're just gonna say that you're not calling the super.int method. Now, at this particular portion, you say super.int and pass in the frame that you're about to pass, which in this case will be…
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.