Go to swfit (3) Swift to call OC and swfitswift to call oc
To call a custom OC class or open source package in Swift, you just need to do the bridge, create a file named project name-Bridging-Header.h file ,. the H file can import the file you want like in OC, and then the Objective-C Bridging Header in Build Settings, where the value is, enter the header file you created.
1. You can drag the corresponding header file to the input box of the filled value.
2. manually enter the header file path to the input box, such as: JokerMost/Swift-ObjectiveC-Bridge.h
In fact, # define can also be implemented here.
In Swift development, a subclass of UICollectionViewCell is created: ExhibitionCell. The error "No such module 'cocoa 'is returned:
The reason is simple: when creating a new File, you should select the "OS X" project. In fact, you should select the "iOS" project. Delete the error File and create a new File.