kishor0011 kishor0011 - 15 days ago 6
Swift Question

SWRevealViewController not working because Value of type 'XX-ViewController' has no member 'revealViewController'

I added SWRevealViewController.h and SWRevealViewController.m by using drag and drop. Bridging header pop up not came.

I have 3 pod files also. So I just want to check whether error is coming because of 'Header file not added' or by another pod files. My code is below.

override func viewDidLoad() {
super.viewDidLoad()


openSlideMenuView.target = self.revealViewController()
}


Error is below :-

Value of type 'HomeViewController' has no member 'revealViewController'

Answer
  1. Add SWRevealViewController.h and SWRevealViewController.m by using drag and drop.

  2. Add a new file to Xcode (File > New > File), then select “Swift_bridge_header” and click “Header File“.

  3. add import "SWRevealViewController.h" to Swift_bridge_header.h

  4. Drag the Swift_bridge_header.h on the project navigator into Objective-C Bridging Header(Please see the following image, it is in Build Settings)

enter image description here

Then it will be working fine.

Comments