From 723a11b10b021ea4c61757965fa9c757fededc1d Mon Sep 17 00:00:00 2001 From: Kenneth Tsang Date: Wed, 1 Nov 2017 00:14:32 +0800 Subject: [PATCH] Fixed: duplicate calls to scrollRangeToVisible --- GrowingTextView.podspec | 2 +- Pod/Classes/GrowingTextView.swift | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GrowingTextView.podspec b/GrowingTextView.podspec index 6105dfd..76d72d7 100644 --- a/GrowingTextView.podspec +++ b/GrowingTextView.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "GrowingTextView" - s.version = "0.5.1" + s.version = "0.5.2" s.summary = "UITextView on Swift 3 and Swift 4. Support auto growing, placeholder and length limit." # This description is used to generate tags and improve search results. diff --git a/Pod/Classes/GrowingTextView.swift b/Pod/Classes/GrowingTextView.swift index 9505464..c1287b1 100644 --- a/Pod/Classes/GrowingTextView.swift +++ b/Pod/Classes/GrowingTextView.swift @@ -135,8 +135,9 @@ open class GrowingTextView: UITextView { // Workaround to for incorrect scroll position on Swift4 self.heightConstraint!.constant += 0.0000001 self.isGrowing = false + } else { + self.scrollRangeToVisible(NSMakeRange(-1, 0)) // Scroll to bottom } - self.scrollRangeToVisible(NSMakeRange(-1, 0)) // Scroll to bottom } else { self.scrollRangeToVisible(NSMakeRange(0, 0)) // Scroll to top }