Eugene Trapeznikov
Eugene Trapeznikov

Reputation: 3240

Objective C to Swift bridging <<error type>>

I have Objective-C class, which I want to use in Swift. I use it with singleton sharedInstance and shortcut which was created in swift. But when I type this shortcut, I see <<error type>> in autocomplete and no color syntax and no autocompletion helping.

If I call any function on this shortcut, such as TripPlannerKit.tripName app will work fine, but it is really hard to type when you have huge methods.

How to import Objective-C with full syntax support?

enter image description here

My briding file is really simple

#import "Project-Prefix.pch"

#import "TripPlannerManager.h"

And this is my Global.swift where I create shortcuts for using Objective-C singletons

import Foundation

//=== managers & kits

let TripPlannerKit = TripPlannerManager.sharedInstance()

Upvotes: 1

Views: 494

Answers (1)

Eugene Trapeznikov
Eugene Trapeznikov

Reputation: 3240

I found it!

Product -> Clean
Product -> (Alt+) Clean, for Clean Build Folder
Window -> Projects -> Choose your project -> Delete derived data

Then your project will be reindexed by XCode and everything will work.

Upvotes: 2

Related Questions