How to access both Objective-C and Swift classes from same storyboard?

ios, objective-c, swift, uibutton

Solution

It seems that Xcode 6.0 (6A215l) needs to upgrade the Storyboard file to a newer version before it can access Swift classes.

If you replaced an Objective-C class with a Swift class with the same name, you need to open the Storyboard, edit the name of the custom class (like remove the last letter), save the Storyboard and then rename the class back. This will force the Storyboard file to be upgraded to a newer version, and the new Xcode to correctly write the custom class key like this:

Version information diff:

UIButton custom class definition diff:

After these changes in the Storyboard file the warning seems to disappear and the correct custom class is used.

Problem

I have implemented one UIButton-derived class (RoundButton) in Swift and the rest is still in Objective-C. How do I access both Objective-C-based classes and Swift-based classes in the same storyboard? You can type `RoundButton` in a UIButton `Custom Class - Class` field in a Storyboard, but iOS gives the following warning runtime: ``` Unknown class RoundButton in Interface Builder file. ```

Original source