devxoul / UITextView-Placeholder

A missing placeholder for UITextView
MIT License
1.48k stars 259 forks source link

" UItextView has no member 'placeholder' " #83

Open AlessandroSchioppetti opened 3 years ago

AlessandroSchioppetti commented 3 years ago
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.

chrisvanbuskirk commented 3 years ago

Second...doesn't work.

TiagoSAmaral commented 3 years ago

it doesn't work either.

alexwhb commented 3 years ago

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

elena-gordienko commented 3 years ago

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.

MoSchaub commented 3 years ago

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"