From the course: iOS App Development: Accessibility

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Making custom objects accessible

Making custom objects accessible - iOS Tutorial

From the course: iOS App Development: Accessibility

Start my 1-month free trial

Making custom objects accessible

- [Narrator] Our elevation views are inaccessible by default and in the last video, we learned how to create UI accessibility elements to represent them, so they can be discovered by assistive technologies. There's another approach we could've taken though, and it will require us to write a lot less code, and our individual elevation views will be responsible for their own accessibility details. Since our elevation views are sub-classes of UI views, and since the UI accessibility protocol is an informal protocol, the only thing we need to do is to mark them as accessible elements. We'll start in the ElevationWrapper.swift file, and we'll start by deleting the contents of our configureAccessibility method, starting on line 51, and all the way through 71. We'll leave that as is for now. Save that, and let's start on our ElevationLengthView. We'll override the awakeFromNib method on line 22. In this method, we'll simply declare ourselves as accessible. Let's go ahead and give ourselves…

Contents