OC and Swift are 2 in different languages, OC code can only be written with OC files, Swift code can only be written in Swift file, although 2 different languages, but can call each other, but need to do a bridge, is the following 2 files
(Projectnmae-bridging-header.h)
Swift file to invoke OC code you will find that you can not reference the Oc.h file, so you need to use this file, the OC file to bridge, some oc.h files are referenced here, and then you can operate in the Swift file OC code
(projectnmae-swift.h)
OC calls the SWIFT code to refer to this file in the OC file, and you will find that the file is not in your project because it is a hidden file.
If your project is a Oc/swift project, the first time you create a Swift/oc file, you will be prompted with the following
This file will automatically create a (projectnmae-swift.h)/(projectnmae-bridging-header.h) file when you finish clicking it
Bridging file between OC and Swift (PROJECTNMAE-BRIDGING-HEADER.H) (projectnmae-swift.h)