I have an iOS app written in Objective-C that I want to convert to Swift. Per Apple's Using Swift with Cocoa and Objective-C, I added a new Swift file with the same name as the Objective-C class it's replacing, put in a stub class declaration, and removed the original Objective-C class from the target.
The error is reporting that a symbol for the class can't be found at link time:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Chunk", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here's my stub class declaration:
import Foundation
@objc class Chunk {
}
Is there some linker setting I can check?
And yes, I have cleaned my project, removed my derived data folder, and confirmed that the Swift file is in the Compile Sources section of the Build Phases.
I've also now reproduced the problem with a brand new project created in Xcode 6.1.1, available at https://github.com/dpassage/Foo.