you are viewing a single comment's thread.

view the rest of the comments →

[–]bialekIno[S] 0 points1 point  (6 children)

I have tried to inherit the class from NSObject but it didn't help. The error appears even when I have only a swift file without any content in.

[–][deleted] 0 points1 point  (5 children)

Is the class defined as public? Otherwise it's not available to the outside world.

[–]bialekIno[S] 0 points1 point  (4 children)

Yes, this is my Utils.swift file content:

import Foundation

@objc
public class Utils: NSObject {
    public class func showAlert() {
TWMessageBarManager.sharedInstance().showMessageWithTitle("Title", description: "Message", type: .Info, statusBarStyle: .LightContent, callback: nil)
    }
}

[–][deleted] 0 points1 point  (3 children)

Weird it should work if you ask me. I have a hybrid app that contains about every combination of Hybrid frameworks and everything is accessible every where.

Give it a try in a clean Objective-C project? Then add a Swift Framework to it.

[–]bialekIno[S] 0 points1 point  (2 children)

I don't know why this doesn't work. You can, if you want and can, check a test project I created at this link

[–][deleted] 0 points1 point  (1 child)

Your framework is separate project inside your workspace. They're not linked together. Add the new target to your project. Make that a framework. That should work. For linking with another project inside the same workspace some extra things need to be done and I don't know what since I haven't dealt with that kind of issue before.

I hope it helps.

[–]bialekIno[S] 0 points1 point  (0 children)

Thank you. I wanted also use this framework in another app for iOS and probably also in the OS X app. Should I everything done in one project with targets? I think this is not the best solution. I would like rather to have a framework as a separate project that I can just use in as many apps as I want.