UITextView-Placeholder icon indicating copy to clipboard operation
UITextView-Placeholder copied to clipboard

" UItextView has no member 'placeholder' "

Open AlessandroSchioppetti opened this issue 3 years ago • 5 comments

Screenshot 2021-02-03 at 10 45 21

I used swift pakage manager, and correctly imported in my project file but It doesn't work.

AlessandroSchioppetti avatar Feb 03 '21 09:02 AlessandroSchioppetti

Second...doesn't work.

chrisvanbuskirk avatar Mar 08 '21 22:03 chrisvanbuskirk

it doesn't work either.

TiagoSAmaral avatar Mar 20 '21 03:03 TiagoSAmaral

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

alexwhb avatar Apr 07 '21 18:04 alexwhb

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.

elena-gordienko avatar Aug 10 '21 10:08 elena-gordienko

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"

MoSchaub avatar Aug 30 '21 19:08 MoSchaub