ios - swift: weak cannot be applied to an outlet -
i using libzbar scanning qrcode in swift getting these errors.
.
first error weak referencing , second undeclared type. @ first thought haven't included zbarreaderview.h after checking file inspector found files correctly added
i have added zbarreaderview
in objective-c , works fine. have viewed sample project adding embeddedreader
(objectivec).
so want know why getting error , how remove error?
solution:
to import set of objective-c files in same app target swift code, rely on objective-c bridging header expose files swift. xcode offers create header file when add swift file existing objective-c app, or objective-c file existing swift app.
it looks didn't create bridging header. follow apple docs create 1 , import zbarreaderview.h in bridging header.
Comments
Post a Comment