From f1432497b293d8a0447284061563d51021da173b Mon Sep 17 00:00:00 2001 From: jayelzaghmoutt Date: Mon, 27 May 2024 23:54:05 +0300 Subject: [PATCH] Update Place Holder Visibility: Code review --- JNMentionTextView.podspec | 4 ++-- .../Extensions/JNMentionTextView+UITextViewDelegate.swift | 6 +++--- .../Classes/JNMentionTextView/JNMentionTextView.swift | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/JNMentionTextView.podspec b/JNMentionTextView.podspec index a367abc..53d3a2d 100644 --- a/JNMentionTextView.podspec +++ b/JNMentionTextView.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "JNMentionTextView" - s.version = "1.0.2" + s.version = "1.0.3" s.summary = "JNMentionTextView is a UITextView replacement supporting the mention feature for iOS applications." s.description = "A UITextView drop-in replacement supporting special characters such as [ #, @ ] and regex patterns, written in Swift." s.homepage = "https://github.com/JNDisrupter" @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.platform = :ios s.platform = :ios, "11.0" - s.swift_versions = ['5.8', '5.8.1'] + s.swift_versions = ['5.10'] s.source = { :git => "https://github.com/JNDisrupter/JNMentionTextView.git", :tag => "#{s.version}" } s.source_files = "JNMentionTextView/**/*.{swift}" end diff --git a/JNMentionTextView/Classes/JNMentionTextView/Extensions/JNMentionTextView+UITextViewDelegate.swift b/JNMentionTextView/Classes/JNMentionTextView/Extensions/JNMentionTextView+UITextViewDelegate.swift index 5f9da69..1538bd3 100644 --- a/JNMentionTextView/Classes/JNMentionTextView/Extensions/JNMentionTextView+UITextViewDelegate.swift +++ b/JNMentionTextView/Classes/JNMentionTextView/Extensions/JNMentionTextView+UITextViewDelegate.swift @@ -171,7 +171,7 @@ extension JNMentionTextView: UITextViewDelegate { self.mentionDelegate?.textViewDidChange?(textView) // Update placeholder label visibility - self.updatePlaceholderLabelVisibility() + self.updatePlaceholderVisibility() } /** @@ -195,7 +195,7 @@ extension JNMentionTextView: UITextViewDelegate { self.mentionDelegate?.textViewDidBeginEditing?(textView) // Update placeholder label visibility - self.updatePlaceholderLabelVisibility() + self.updatePlaceholderVisibility() } /** @@ -209,7 +209,7 @@ extension JNMentionTextView: UITextViewDelegate { } // Update placeholder label visibility - self.updatePlaceholderLabelVisibility() + self.updatePlaceholderVisibility() } /** diff --git a/JNMentionTextView/Classes/JNMentionTextView/JNMentionTextView.swift b/JNMentionTextView/Classes/JNMentionTextView/JNMentionTextView.swift index 560ec8c..2aa99cd 100644 --- a/JNMentionTextView/Classes/JNMentionTextView/JNMentionTextView.swift +++ b/JNMentionTextView/Classes/JNMentionTextView/JNMentionTextView.swift @@ -106,14 +106,14 @@ public class JNMentionTextView: UITextView { /// Text override open var text: String! { didSet { - self.updatePlaceholderLabelVisibility() + self.updatePlaceholderVisibility() } } /// Attributed text override open var attributedText: NSAttributedString! { didSet { - self.updatePlaceholderLabelVisibility() + self.updatePlaceholderVisibility() } } @@ -195,7 +195,7 @@ public class JNMentionTextView: UITextView { /** Update placeholder visibility */ - public func updatePlaceholderLabelVisibility() { + func updatePlaceholderVisibility() { guard self.placeholderLabel != nil else { return } // Is placeholder hidden @@ -244,7 +244,7 @@ public class JNMentionTextView: UITextView { self.addSubview(self.placeholderLabel!) // Update placeholder label visibility - self.updatePlaceholderLabelVisibility() + self.updatePlaceholderVisibility() } /**