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

I implemented one class based on UIButton (RoundButton) in Swift, and the rest are still in Objective-C. How to access classes with Objective-C and Swift classes in one storyboard?

You can enter RoundButtonthe UIButton Custom Class - Classin the storyboard, but iOS gives the following warning:

Unknown class RoundButton in Interface Builder file.
+4
source share
4 answers

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

Objective-C Swift , Storyboard, (, ), . Storyboard , Xcode :

diff: enter image description here

UIButton diff: enter image description here

Storyboard .

+4

, , (Unknown class MySwiftClass in Interface Builder file.)

Swift UIViewController. , , - init, :

override func initWithNibName:bundle:

... , . , .

Swift UIViewController, . Swift ( "2" ). , ... , .

, , - .

+1

, Objective C. Objective C Swift .

http://i58.tinypic.com/33aqbyu.png

0

Storyboard Xcode 6.0 (6A254o)/iOS 8 Beta 3.

pre-Xcode 6, , Interface Builder, " " "Identity Inspector".

0

Source: https://habr.com/ru/post/1543102/


All Articles