After converting an Objective-C class (i.e. `MyViewController`) to Swift (while you still have Objective-C files left in your project), we need to ensure that your Objective-C classes still have access to the converted Swift class.
Header (`.h`) files that reference `MyViewController` will have a forward class declaration (i.e. `@class MyViewController`) automatically generated. This is required because you cannot import the Swift Bridging Header from a header (`.h`) file. Otherwise, this would create a circular referencing issue.
Implementation (`.m`) files will be able to access the Swift version of `MyViewController` automatically due to the Swift Bridging Header (`ProjectName-Swift.h`) which is automatically imported from the Precompiled Header (`ProjectName-Prefix.pch`).
Comments
0 comments
Please sign in to leave a comment.