Kévin Sibué
Kévin Sibué

Reputation: 21

iOS Swift 3 Framework - Not reachable in Storyboard

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.

Upvotes: 2

Views: 557

Answers (1)

Lucas Palaian
Lucas Palaian

Reputation: 374

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!

Upvotes: 0

Related Questions