From the course: iOS App Development: Accessibility
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Creating custom restrictions - iOS Tutorial
From the course: iOS App Development: Accessibility
Creating custom restrictions
- [Instructor] In this video, we're going to take a look at how we, as developers, can create custom restrictions that our users can set while running our app within a guided access session. We'll need to start in our AppDelegate by adopting the UIGuidedAccessRestrictionDelegate on line 12. Next, let's open up a new line on line 11 and let's add a simple struct that will allow us to easily refer to our custom restriction. We'll call our struct a GuidedAccessRestrictions. And for now it'll have one member. It'll be a static constant that we'll call FavoriteRestriction and we'll set that to a string. We'll use reverse DNS notation to ensure it's unique throughout the entire system. In order to create custom restrictions we'll need to implement three methods and populate one variable property. Go ahead and scroll to the very bottom and open up a new line on line 47. The property we need to override is the guidedAccessRestrictionIdentifiers property. We'll pass it an array of our custom…
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.