Challenge: Proximity Notifications

Register for proximity notifications. Proximity refers to the nearness of the device to the user. It is typically used to tell whether the iPhone is next to the user’s face (as in talking on the phone). When this notification is posted, change the background color of HeavyViewController’s view to dark gray. You will need to turn on proximity monitoring, which is only available on the iPhone:

[​d​e​v​i​c​e​ ​s​e​t​P​r​o​x​i​m​i​t​y​M​o​n​i​t​o​r​i​n​g​E​n​a​b​l​e​d​:​Y​E​S​]​;​

Get iOS Programming: The Big Nerd Ranch Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.