0

Prior to Xcode 11 I could easily attach a view (label, switch, e.t.c) to an IBOutlet defined on a superclass, if I had the inspector window open and command clicked to my view (In this case a subclass of a UITableViewCell subclass it would open the superclass in the inspector window and I could attach to the IBOutlet. In Xcode 11 however it seems that when command clicking through to the "definition" this opens in the LHS panel, which replaces my storyboard or xib file with the views superclass.

Is there any way to open the superclass alongside the xib/storyboard any more in Xcode 11? My framework is a pre-compiled framework so I can't access the source files to open them in a new panel in Xcode.

Thought it might be wise to include a class hierarchy

LargeHeaderTableViewCell -> TableViewCell -> UITableViewCell

TableViewCell is within a pre-compiled framework (Installed using Carthage)

Edit:

To frustrate matters further... I can get the class definition of TableViewCell open next to my xib file (In a panel), however it seems you can only attach to IBOutlets in the assistant editor, not in a standard Xcode panel/tab/whatever you call it.

1 Answer 1

0

Found an answer (eventually) in here

I realize that this question was posted a while ago, but since I just struggled with the same issue and finally came up with a solution, I figured I would still post my findings...

I understand the problem to be as follows (at least that's the one I solved):

How to have class A inherit from class B, with each class having its own XIB file with the some common IBOutlet properties? The goal being to be able to have the super class handle the actions related to the IBOutlets that are common to its subclass(es), while still being able to use Interface Builder to design the interface for the subclass(es).*

In order to do so:

Make the IBOutlet connections in the superclass from the superclass' XIB files Make the IBOutlet connections in the subclass from the subclass' XIB files, with the same IBOutlet property names as in the superclass for the ones you need to inherit. Delete the declaration of the IBOutlet variables in the subclass

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.