mozhouqi / kmplaceholdertextview Goto Github PK
View Code? Open in Web Editor NEWA UITextView subclass that adds support for multiline placeholder written in Swift.
License: MIT License
A UITextView subclass that adds support for multiline placeholder written in Swift.
License: MIT License
Thank you for the awesome Pod!
We just migrated to swift 2.2 and we liked how KMPlaceholderTextView had no warnings before. Now we are getting a few, see below. Would it be possible to have a release without warnings? Thank you!
▸ Compiling KMPlaceholderTextView.swift
selector: "textDidChange",
^~~~~~~~~~~~~~~
▸ Compiling KMPlaceholderTextView.swift
selector: "textDidChange",
^~~~~~~~~~~~~~~
Is it possible?
Hi,
现在每次 pod update 了之后,Xcode 会提示说 KMPlaceholderTextView 没有用 Swift 3 的语法,需要convert。不知道是不是只是我的Xcode 这样?
BR
An Chin
Is there a reason
The init method isn't public?
init(frame: CGRect, textContainer: NSTextContainer?)
I'd like to subclass this.
Other than color, it's very common to have a bolded or italic font for the placeholder, which is different from the regular text the user input.
Can you add an option to set the placeholder font?
thanks!
I have an issue when trying to start typing into the textview, if i tap on the textview the keyboard does not show up, only until i tap in the same line that the placeholder is, does not detect the rest of the text view as editable, if i add many text and later try to edit by tapping on that text happens the same, looks like it only accepts touch on an imaginary line on the top of the textview.. Using Swift 3, and the last version of the pod, 1.3.0.
Please add support of SPM
Please add swift package manager support
I tried to deintegrate Pod and install it again
also clean derived data and clean project but no way get the same error in Xcode 10.3
clang: error: no such file or directory: 'KMPlaceholderTextView'
Command Ld failed with a nonzero exit code
Hi
The KMPlaceholderTextView won't give access to the UILabel used, so it's really difficult to setup the backgroundColor. Why do we care about it if it's transparent?. One of the slowest operations is rendering. In my case I'm using a lot of instances of KMPlaceholderTextView so if you use “Color Blended Layers" in the iPhone Simulator, you will see a lot of red areas.
It would be really useful to have access to the background color of the UILabel - through a method- or the UILabel. Right now it's marked as private.
Hi,
I have add UITextView and set to KMPlaceholderTextView and set the placeholder property but whenever I run the app placeholder value can't see and getting the below warning.
Unknown class KMPlaceholderTextView in Interface Builder file.
Failed to set (placeholder) user defined inspected property on (UITextView): [<UITextView 0x799c5000> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key placeholder.
] Failed to set (placeholder) user defined inspected property on (UITextView): [<UITextView 0x79a17800> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key placeholder.
Hi I cannot find how to change placeholder text colour
Would it be possible to add auto layout constraints to adjust the size of the text view based off the size of the placeholder label height. Right now, the placeholder label will go off the view otherwise.
Thank you for useful pod!
We have an issue using it in a storyboard. When adding a height constraint to the it Storyboard shows the warning: Has ambiguous scrollable content height
.
Is there a workaround for that? Or way to fix it?
After investigation and StackOverflow research we think it's because IBDesignable KMPlaceholderTextView has placeholder subview, which UITextView UIScrollView probably takes as content and cause ambiguity.
It would be cool to have the option to add an attributed placeholder like this:
open var attributedPlaceholder: NSAttributedString? {
didSet {
placeholderLabel.attributedText = attributedPlaceholder
}
}
Thanks!
I want to remove text from textfield and show the manual placeholder , is there any way
how to install KMPlaceholderTextView manually without cocoapods?
Hai,
In Empty Textview if I try to paste its not working..when I type some letters after that only it can allow to paste.
KMPlaceholderTextView
1./UIKit.NSNotification.Name:5:23:
'UITextViewTextDidChange' was obsoleted in Swift 4.2
UITextViewTextDidChange' has been renamed to 'UITextView.textDidChangeNotification'
Replace 'UITextViewTextDidChange' with 'UITextView.textDidChangeNotification'
2/UIKit.NSNotification.Name:5:23:
'UITextViewTextDidChange' was obsoleted in Swift 4.2'
'UITextViewTextDidChange' has been renamed to 'UITextView.textDidChangeNotification'
Replace 'UITextViewTextDidChange' with 'UITextView.textDidChangeNotification'
Can you please update this library for swift 5 and Xcode 10.2?
There is a problem when you try to set a text programmatically that will be long just a little bit that the textview. In this case, the textview (not editable) will not scroll.
I solved using a old solution removing constraints and using a frame to the placeholder label.
This is not the right solution, but it works.
Hello!
I'm getting this issue with the latest version...
file:///Users/sulkuatam/src/app/app-ios/Base.lproj/Main.storyboard: error: IB Designables: Failed to update auto layout status: The bundle “$(PRODUCT_NAME)” couldn’t be loaded because its executable couldn’t be located.
Not sure what the issue is... thanks in advance for any help!
We use your library as pod, but pulling from master branch, since pod spec was last updated 2 years ago.
Recently we started getting this error.
It seems that it is a result of moving source files to Sources folder. Podspec file was not change to accommodate this change.
error: IB Designables: Failed to render instance of KMPlaceholderTextView: Rendering the view took longer than 200 ms. Your drawing code may suffer from slow performance.
how can i figure that error?
It seems that setting localization for KMPlaceholderTextView doesn't work. I tried doing it in viewDidLoad() and assigning NSLocalizedString to KMPlaceholderTextView.placeholder and it didn't
苹果更新审核策略,需要添加PrivacyInfo.xcprivacy
It would be nice if this package could be installed via Carthage. You just need to make the build scheme public to make this work. 👍
I use the text view in storyboard named "Mine".And I have the other storyboard.
It is normal if I didn't click the Mine storyboard.
It will show a Error when I clicked Mine storyboard. It is bad.
Error info:
Failed to render and update auto layout status for SuggestionViewController (EBX-d9-iDK): dlopen(KMPlaceholderTextView.framework, 1): no suitable image found. Did find:
KMPlaceholderTextView.framework: required code signature missing for 'KMPlaceholderTextView.framework'
In iOS10 it doesn't show anything, i can set the placeholder text and color in IB but there is no placeholder when i launch the app
Hello, getting the exception on iOS 7.1.2 on iPhone 4, on iOS 8 and 9 everything works good.
Here is text of exception:
Fatal Exception: NSInternalInconsistencyException
Auto Layout still required after executing - layoutSubviews.
KMPlaceholderTextView's implementation of -layoutSubviews needs to call super.
KMPlaceholderTextView.swift:33:31: Cannot override mutable property 'placeholder' of type 'String?' with covariant type 'String'
file:///..../UI/Training.storyboard: error: IB Designables: Failed to render and update auto layout status for RescheduleTrainningViewController (JFO-mQ-3bH): dlopen(KMPlaceholderTextView.framework, 1): Symbol not found: __TMps13OptionSetType
Referenced from: KMPlaceholderTextView.framework
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Overlays/../../../../../../Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/libswiftCore.dylib
in KMPlaceholderTextView.framework
After I upgrade to XCode 8.1 (8B62) using Swift 2.3 and version 1.2.2 of KMPlaceholderTextView
appears a lot of errors like I paste above.
I use "pod 'KMPlaceholderTextView', '~> 1.2.2' ' on podfile.
All views on storyboard that uses KMPlaceholderTextView stay white on XCode.
Received the following error "kmplaceholdertextview required code signature missing" after installing Podfile.
Resolved by adding the following command to the Podfile:
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings.delete('CODE_SIGNING_ALLOWED')
config.build_settings.delete('CODE_SIGNING_REQUIRED')
end
end
Can you please update this library for swift 4.2, Xcode 10 and iOS 12?
The textview display the correct placeholder text (in my case, "Type here") when it is loaded. When I tap into the textview and enter text, then delete the text, the correct placeholder comes back. However, after the keyboard is dismissed, the placeholder text reverts to "Placeholder", which I assume is the default for the KMPlaceholderTextView.
It would be nice if this library would also support swift 2. Maybe in a separate branch?
You can make text aligned left aligned or the middle
how do i set the align mode for placeholder?
Hi,
Can you make a new release with swift4 support?
1.4.0
Thanks.
Hey there,
I've just updated to the latest available CocoaPod and hit some compilation issues due to not yet having upgraded to Swift 3.
Suggest popping some notes in your README
or release notes mentioning it.
Keep up the great work !
During pod installation I get this message:
The platform of the target
Pods(iOS 7.0) is not compatible with
KMPlaceholderTextView (0.1.1)which has a minimum requirement of iOS 8.0.
Yet, in the requirements for the control you say it's 7.0+
What am I doing wrong?
Why doesn't support Arabic and Persian chars???
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.