Why Swift is not friends with ScriptingBridge.framework?

There is a need for Swift application to communicate with iTunes. Of course, for these goals were chosen ScriptingBridge.framework. Generated header iTunes.h c
sdef /Applications/iTunes.app | sdp -fh --basename iTunes
and added to the project along with Appname-Bridging-Header.h with the line #import "iTunes.h". Also, the project was zelinkova himself ScriptingBridge.framework. However, when it came to direct interaction, for example, an instance of iTunes and read its properties -- the current track, for example:
class iTunesWorker: NSObject {
 var iTunesInstance: iTunesApplication? = SBApplication.applicationWithBundleIdentifier("com.apple.iTunes") as? iTunesApplication

 fetchCurrentTrackInfo func() {
 let currentTrack: iTunesTrack? = iTunesApp?.currentTrack
 let trackName: String? = currentTrack?.name
println(trackName)
}
}

the application have refused to meet with the type error
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_iTunesApplication", referenced from:
__TFC5NowP_14iTunesWorker21fetchCurrentTrackinfofs0_FT_T_ in iTunesWorker.o
__TFC5NowP_14iTunesWorkercfMS0_FT_S0_ in iTunesWorker.o
_get_field_types_iTunesWorker in iTunesWorker.o
"_OBJC_CLASS_$_iTunesTrack", referenced from:
__TFC5NowP_14iTunesWorker21fetchCurrentTrackinfofs0_FT_T_ in iTunesWorker.o
ld: symbol(s) not found for architecture x86_64


Yaw on the Internet did not give any clear solutions to this problem.
September 26th 19 at 06:41
2 answers
September 26th 19 at 06:43
Solution
A lot of what he is not friendly, for example there are issues with coredata.framework. I think you should not hurry and wait for the September official release.
It is clear that this is a beta and all that. However, here too there is an implicit manifestation of a "wet" product. The impression is that the framework, despite the fact that he was attached to the project, for some reason not connected at the Assembly stage, though it is not. Found that you can get out of the situation, getting properties using valueForKey in variables of type of anyobject. - edgardo.Ferry46 commented on September 26th 19 at 06:46
September 26th 19 at 06:45
If still relevant, you can do the following - describe the interaction with iTunes in Obj-C class and then it is already to use from swift. Checked how it works.

Find more questions by tags Objective-CSwift