From 9bb955a4fe294c9bb18dec7c8c2842c0d30f714c Mon Sep 17 00:00:00 2001 From: Igor Kislyuk Date: Mon, 20 Nov 2017 17:48:55 +0300 Subject: [PATCH] Fix bug with animation --- UIAnimatedTextField/Source/UIAnimatedTextField.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/UIAnimatedTextField/Source/UIAnimatedTextField.swift b/UIAnimatedTextField/Source/UIAnimatedTextField.swift index 1b0bb31..e0e3fa8 100644 --- a/UIAnimatedTextField/Source/UIAnimatedTextField.swift +++ b/UIAnimatedTextField/Source/UIAnimatedTextField.swift @@ -349,8 +349,13 @@ open class UIAnimatedTextField: UIView { return } - strongSelf.placeholderLabel.transform = strongSelf.placeholderLabelTransform(state: state) - strongSelf.placeholderLabel.frame = strongSelf.placeholderLabelFrame(state: state) + if strongSelf.isLeftTextAlignment { + strongSelf.placeholderLabel.transform = strongSelf.placeholderLabelTransform(state: state) + strongSelf.placeholderLabel.frame = strongSelf.placeholderLabelFrame(state: state) + } else { + strongSelf.placeholderLabel.frame = strongSelf.placeholderLabelFrame(state: state) + strongSelf.placeholderLabel.transform = strongSelf.placeholderLabelTransform(state: state) + } switch state { case .placeholder: