0

Tried this solution: No Method declared with Objective-C Selector for Notification UIKeyboardWillShowNotification and UIKeyboardWillHideNotification

but still doesn't work

Tried previous solution and even recommended Swift 3 implementation

enter image description here

Note: I added pictures because my code are on the same file/class but theyre in different places and theres a lot of code in between.

Basically I created another Class (Non-UIViewController) that sends a Notification to the ViewController Class and followed suggestions from my Xcode and Stackoverflow.

The methods are just to move to another viewcontroller from current viewcontroller, I used notificationcenter because I was reusing a lot of the same methods and just created a class that had the same functions called loginHandler and this uses notification center to send notifications

Community
  • 1
  • 1
mding5692
  • 806
  • 1
  • 10
  • 34
  • `#selector(redirectToHome)` should suffice, but the long form is `#selector(ViewController.redirectToHome(notification:))` unless you change your func to `func redirectToHome(_ notification: Notification)`. – vacawama Mar 18 '17 at 18:51
  • You don't need the `@objc` if you are a subclass of something that is descended from `NSObject` like `UIViewController` for instance. – vacawama Mar 18 '17 at 19:00
  • You're right, works now, thanks – mding5692 Mar 18 '17 at 20:46

0 Answers0