Search code examples
iosswiftlocalnotification

Use of unresolved identifier 'UIMutableUserNotificationAction'


I have a separate Singleton class containing LocalNotification registration and Action setup code. I am getting

Use of unresolved identifier error

Added all classes to XCTest target as well.

enter image description here


Solution

  • Just import the UIKit framework

    import UIKit
    
    class ViewController: UIViewController {
    
        override func viewDidLoad() {
            super.viewDidLoad()
    
            let mutNotification = UIMutableUserNotificationAction()
            mutNotification.identifier = "Y"
        }
    }