2

I have created a custom framework in swift 3 to store all of my classes, xib, controllers and ui controls. I can generated it, but when I add it to a project I have access to everything except in storyboard.

For example I have a class named 'MyCustomCell' which is a subclass of 'UITableViewCell' in 'MyCustomFramework'.

So on my storyboard, when I want to set a custom class for a UITableViewCell, I write 'MyCustomCell' on the custom class field. But the module not change and 'MyCustomFramework' is not in the list.

I don't know what to do.

I can write manually the module name and it's works, but I have acces to my @IBOutlet define in my class 'MyCustomCell'

Here my class 'MyCustomCell':

import UIKit
import Foundation

open class MyCustomCell: UITableViewCell {

    @IBOutlet open var titleLabel: UILabel?
    @IBOutlet open var subtitleLabel: UILabel?

    open func setup(obj: MyObject) {

        if let title = obj.title {
            titleLabel?.text = title
        }

        if let subtitle = obj.subtitle {
            subtitleLabel?.text = subtitle
        }

    }

}

Do you have any idea ?

-- EDIT --

I've find that all @IBOutlet, @IBInspectable and other thing like that are not reachable from my final project.

And my module are not accessible too. I can compile but can't link every @IB... to a storyboard.

1 Answers1

0

You must set the module option just under where you set the class to your cell in storyboard.

Custom Class Menu:

Class: yourclass Module: framework

Hope it helps!

Lucas Palaian
  • 374
  • 2
  • 12
  • Thanks for your answer. I know that. But I can't see any IBOutlet which are defined on my 'MyCustomCell', so I can't link my UILabel with the titleLabel defined in my class. Did you know how correct that ? And in XCode my module are never visible. XCode never propose to me to set 'MyCustomFramework' as a module. – Kévin Sibué Jan 25 '17 at 13:37
  • There are 2 posible solutions on this link: https://stackoverflow.com/questions/29500227/getting-error-no-such-module-using-xcode-but-the-framework-is-there – Lucas Palaian Jan 25 '17 at 13:44