Reputation: 4075
I am planning to add two files from objective C, [PendulumView.h and PendulumView.m] to swift. But if I try to create bridging header, I am unable to create Bridging header. Xcode doesn't ask me "Would you like to create bridging header?". That dialog box also not appeared. If I proceed and I imported my header file, I am receiving error.
(Command + N) -> iOS -> Source -> Objective-C/Header file. No Bridging header is creating. Automatically, .h or .m file is created.
#ifndef pendul_test_pendul_Header_h
#define pendul_test_pendul_Header_h
#import "PendulumView.h"
#endif
override func viewDidLoad() {
super.viewDidLoad()
var pendul_object = PendulumView() //Error Receiving. Unresolved Identifier PendulumView
}
Screen shot is below:
Upvotes: 1
Views: 944
Reputation: 4075
Mistake is completely my side.
What I did?
What should do?
Upvotes: 2
Reputation: 3062
Try go to your project settings. In the Build Settings
tabs go to the search field and search for bridging
. In the following search result you should see: Swift Compiler - Code Generation with a setting for Objective-C Bridging Header
. Change the value to your project path (where your project files are stored in) and you should be good to go.
Upvotes: 0