Reputation:
I am getting
Type of expression is ambiguous without more context
on the following lines:
NotificationCenter.default.addObserver(self, selector: #selector(willResignActive), name: .UIApplication.willResignActiveNotification , object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(openedAgain), name: .UIApplication.didBecomeActiveNotification, object: nil)
What is the correct syntax?
Upvotes: 3
Views: 657
Reputation: 3256
remove the .
on UIApplication.willResignActiveNotification
.
Your line should look like this:
NotificationCenter.default.addObserver(self, selector: #selector(willResignActive), name: UIApplication.willResignActiveNotification , object: nil)
Upvotes: 9