Xcode 6 Interface Designer Does Not Show Custom Class

I have a bug in my Xcode 6.3 interface builder. When I create a new custom class and want to add it to the custom class field of the interface builder. It is unavailable. I use Swift as a language.

What I tried:

  • delete derived data
  • reinstall xcode
  • clear project
  • new project created
  • The class name matches the file name.
  • The superclass class and the interface builder class are the same

Nothing came out ;-( Any idea what this could be?

enter image description here

enter image description here

enter image description here

+5
source share
2 answers

I had the same problem and thought it was a mistake. But that was my misunderstanding.

What is actually going on:

The Custom Class drop-down list shows only those custom classes that are subclasses of the selected feature class.

For example, if we have an imageview object in xib and after selecting it, when we see a drop-down list of a user class, it will show only user classes inherited from (subclass) of UIImageView.

What I did wrong was looking for those user classes that are subclasses of UIView.

In your case, this may not be 100% certain, due to your TimerCVC being a subclass of UICollectionViewController, not a UIViewController.

0
source

TimerCVC is not a subclass of UIViewController

Press ctrl-n β†’ in the left panel, select iOS β†’ Source β†’ Cocoa Touch Class β†’ from the drop-down menu, select UIViewController β†’ And then fill in the name field (automatically Xcode autocomplete with ViewController at the end).

It should look like this:

import UIKit class TimerViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } 
-4
source

All Articles