NEWBIE can this be used from Objc?
AEDWIP opened this issue · 5 comments
I do not know swift. this is the first time I tried to use it from Objc. I have never used cocopods before.
I think the pods install ran successfully.
what should my header file import statement be?
I tried variations on.
#import "FDWaveformView/FDWaveformView-Swift.h"
the header files are never found. Do I head to tweak my header paths or something. The output from pod install suggested it was updating my project and workspace files?
thanks in advance
Andy
$ find . -name "*.h" |grep FDW
./Pods/Headers/Public/FDWaveformView/FDWaveformView-umbrella.h
./build/Pods.build/Debug-iphonesimulator/FDWaveformView.build/Objects-normal/x86_64/FDWaveformView-Swift.h
./build/Pods.build/Debug-iphonesimulator/FDWaveformView.build/DerivedSources/FDWaveformView-Swift.h
./build/Pods.build/Debug-iphoneos/FDWaveformView.build/Objects-normal/arm64/FDWaveformView-Swift.h
./build/Pods.build/Debug-iphoneos/FDWaveformView.build/DerivedSources/FDWaveformView-Swift.h
./build/Debug-iphonesimulator/FDWaveformView/Swift Compatibility Header/FDWaveformView-Swift.h
./build/Debug-iphonesimulator/FDWaveformView/FDWaveformView-umbrella.h
./build/Debug-iphoneos/FDWaveformView/Swift Compatibility Header/FDWaveformView-Swift.h
./build/Debug-iphoneos/FDWaveformView/FDWaveformView-umbrella.h
$
I found Apples's Mix and Match (swift/objc) guide. Still could not figure out how to import FDWaveformView
You need to adjust your build settings see
then in your *.m file
@import FDWaveformView;
Next challenge is how to programmatically construct a FDWaveformView in Objc. I am using Xcode 9.x target is ios 10.
maybe you can update the readme to make this easier for the next person?
okay next change. Else in Xcode 9 we can not access the swift code from objc
@objcMembers open class FDWaveformView: UIView {
okay next challenge
link error:
Showing All Errors Only
"OBJC_CLASS$__TtC14FDWaveformView14FDWaveformView", referenced from:
adding libFDWaveFromView.a
generates a ton of link errors the first ones are. Note I was already linking against CoreAudio, AVFoundation, ...
ld: warning: Auto-Linking library not found for -lswiftCoreAudio
ld: warning: Auto-Linking library not found for -lswiftAccelerate
ld: warning: Auto-Linking library not found for -lswiftCoreMedia
ld: warning: Auto-Linking library not found for -lswiftAVFoundation
ld: warning: Auto-Linking library not found for -lswiftSwiftOnoneSupport
ld: warning: Auto-Linking library not found for -lswiftos
ld: warning: Auto-Linking library not found for -lswiftCore
ld: warning: Auto-Linking library not found for -lswiftQuartzCore
ld: warning: Auto-Linking library not found for -lswiftCoreImage
ld: warning: Auto-Linking library not found for -lswiftCoreGraphics
ld: warning: Auto-Linking library not found for -lswiftDispatch
ld: warning: Auto-Linking library not found for -lswiftCoreFoundation
ld: warning: Auto-Linking library not found for -lswiftObjectiveC
ld: warning: Auto-Linking library not found for -lswiftUIKit
ld: warning: Auto-Linking library not found for -lswiftMediaPlayer
ld: warning: Auto-Linking library not found for -lswiftDarwin
ld: warning: Auto-Linking library not found for -lswiftMetal
ld: warning: Auto-Linking library not found for -lswiftsimd
ld: warning: Auto-Linking library not found for -lswiftFoundation
Undefined symbols for architecture x86_64:
"protocol descriptor for Swift._ObjectiveCBridgeable", referenced from:
I believe the result is referenced here #113