swift: documentation for proper import name?

This bites me a lot. I'm looking at the documentation for, say, UNUserNotificationCenter.

And NOWHWERE but NOWHERE do I see anything that says, "hey, on platform *** you should import YYY to use this class."

Am I just not looking in the right place in Apple documentation to find this? Surely, somewhere at the top level of documentation, it must tell you want the proper package to import is, per platform?

Answered by Claude31 in 798633022

If you search for Notifications in the doc, you will get a suggested reference with a link to User notifications.

Other items in the list point to 2 frameworks:

import UserNotifications  
import UserNotificationsUI  

It may not be necessary to import. Do you get an error message ?

If so, you may have to declare the class as conforming to UNUserNotificationCenterDelegate

You can file a bug report against documentation.

If you search for Notifications in the doc, you will get a suggested reference with a link to User notifications.

Other items in the list point to 2 frameworks:

import UserNotifications  
import UserNotificationsUI  

It may not be necessary to import. Do you get an error message ?

If so, you may have to declare the class as conforming to UNUserNotificationCenterDelegate

You can file a bug report against documentation.

swift: documentation for proper import name?
 
 
Q