UITextView-Placeholder
UITextView-Placeholder copied to clipboard
" UItextView has no member 'placeholder' "

I used swift pakage manager, and correctly imported in my project file but It doesn't work.
Second...doesn't work.
it doesn't work either.
doesn't work for me either. I think it has to do with including the library using Swift PM... and how you are supposed to use a bridge header, but Swift PM does not support mixed sources, so I think you need to expose a Swift interface in order to get this working. ref
I got the same error, when I tried to add the library to my module written in Swift using SPM (Xcode 12.5.1)
I added an import to MyModule.h so that I could use the library in Swift:
#import <UITextView_Placeholder/UITextView+Placeholder.h>
and it produces an error "'UITextView_Placeholder/UITextView+Placeholder.h' file not found".
I checked Frameworks and Libraries for my target – the library is listed there. But UITextView+Placeholder.swiftmodule
is missing from Products folder in Derived Data, though there still is UITextView+Placeholder.o
.
I am not sure what caused the problem – maybe it has something to do with the modulemap implementation.
UPD: I used @AndrewSB's fork, changed import to @import UITextView_Placeholder;
and it fixed the problem.
I just dragged the two files from the Source Directory into my Project and use a bridging header where I import the file like this: #import "UITextVIew+Placeholder.h"