Skip to content

Commit fd237ce

Browse files
committed
Sample project update.
Increase version.
1 parent 83d8cb3 commit fd237ce

File tree

5 files changed

+45
-2
lines changed

5 files changed

+45
-2
lines changed

TweeTextField.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Pod::Spec.new do |s|
66
s.name = 'TweeTextField'
7-
s.version = '1.3.2'
7+
s.version = '1.4.0'
88
s.summary = 'Lightweight set of attributed text fields with nice animation'
99
s.description = <<-DESC
1010
This is lightweight library that provides different types of Text Fields based on your needs. I was inspired by https://uimovement.com/ui/2524/input-field-help/.

TweeTextField.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
7C065D3B20E3F02C00B8F983 /* FontAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92A1460B1FEC228900CEADAA /* FontAnimation.swift */; };
1818
7C15066C214BF43D006A7D4C /* WeakTargetProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C15066B214BF43D006A7D4C /* WeakTargetProxy.swift */; };
1919
7C15066D214BF47E006A7D4C /* WeakTargetProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C15066B214BF43D006A7D4C /* WeakTargetProxy.swift */; };
20+
7C15066F214BF500006A7D4C /* AnimatedTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C15066E214BF500006A7D4C /* AnimatedTextField.swift */; };
2021
7CF5909A2125DB5D0015777F /* PasswordTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CF590992125DB5D0015777F /* PasswordTextField.swift */; };
2122
92A1460C1FEC228900CEADAA /* TweePlaceholderTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92A146071FEC228900CEADAA /* TweePlaceholderTextField.swift */; };
2223
92A1460D1FEC228900CEADAA /* TweeBorderedTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92A146081FEC228900CEADAA /* TweeBorderedTextField.swift */; };
@@ -59,6 +60,7 @@
5960
7C065D2D20E3EFCD00B8F983 /* TweeTextField.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TweeTextField.h; sourceTree = "<group>"; };
6061
7C065D2E20E3EFCD00B8F983 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6162
7C15066B214BF43D006A7D4C /* WeakTargetProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeakTargetProxy.swift; sourceTree = "<group>"; };
63+
7C15066E214BF500006A7D4C /* AnimatedTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimatedTextField.swift; sourceTree = "<group>"; };
6264
7CF590992125DB5D0015777F /* PasswordTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordTextField.swift; sourceTree = "<group>"; };
6365
92A146071FEC228900CEADAA /* TweePlaceholderTextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TweePlaceholderTextField.swift; sourceTree = "<group>"; };
6466
92A146081FEC228900CEADAA /* TweeBorderedTextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TweeBorderedTextField.swift; sourceTree = "<group>"; };
@@ -155,6 +157,7 @@
155157
92E7FC3D1FE0374600E58DF5 /* Main.storyboard */,
156158
92E7FC3B1FE0374600E58DF5 /* ViewController.swift */,
157159
7CF590992125DB5D0015777F /* PasswordTextField.swift */,
160+
7C15066E214BF500006A7D4C /* AnimatedTextField.swift */,
158161
);
159162
path = TweeTextField;
160163
sourceTree = "<group>";
@@ -307,6 +310,7 @@
307310
7C065D3920E3F02C00B8F983 /* TweeAttributedTextField.swift in Sources */,
308311
7C065D3A20E3F02C00B8F983 /* TweeActiveTextField.swift in Sources */,
309312
7C065D3B20E3F02C00B8F983 /* FontAnimation.swift in Sources */,
313+
7C15066F214BF500006A7D4C /* AnimatedTextField.swift in Sources */,
310314
7C15066C214BF43D006A7D4C /* WeakTargetProxy.swift in Sources */,
311315
);
312316
runOnlyForDeploymentPostprocessing = 0;

TweeTextField.xcodeproj/xcshareddata/xcschemes/TweeTextField-Sample.xcscheme

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
buildConfiguration = "Debug"
4646
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4747
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
48+
enableAddressSanitizer = "YES"
49+
enableASanStackUseAfterReturn = "YES"
4850
launchStyle = "0"
4951
useCustomWorkingDirectory = "NO"
5052
ignoresPersistentStateOnLaunch = "NO"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Created by Oleg H. on 9/14/18.
2+
// Copyright © 2018 Oleg Gnidets. All rights reserved.
3+
//
4+
5+
import UIKit
6+
7+
class AnimatedTextField: TweeAttributedTextField {
8+
override func awakeFromNib() {
9+
super.awakeFromNib()
10+
11+
NotificationCenter.default.addObserver(
12+
self,
13+
selector: #selector(startEditing),
14+
name: .UITextFieldTextDidBeginEditing,
15+
object: self
16+
)
17+
18+
NotificationCenter.default.addObserver(
19+
self,
20+
selector: #selector(endEditingText),
21+
name: .UITextFieldTextDidEndEditing,
22+
object: self
23+
)
24+
}
25+
26+
@objc private func startEditing() {
27+
placeholderLabel.textColor = .red
28+
}
29+
30+
@objc private func endEditingText() {
31+
if let text = text, !text.isEmpty {
32+
placeholderLabel.textColor = .red
33+
} else {
34+
placeholderLabel.textColor = .gray
35+
}
36+
}
37+
}

TweeTextField/Base.lproj/Main.storyboard

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
</userDefinedRuntimeAttribute>
9696
</userDefinedRuntimeAttributes>
9797
</textField>
98-
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ipt-cn-CA9" customClass="TweeAttributedTextField" customModule="TweeTextField_Sample" customModuleProvider="target">
98+
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ipt-cn-CA9" customClass="AnimatedTextField" customModule="TweeTextField">
9999
<rect key="frame" x="0.0" y="120" width="337.5" height="40"/>
100100
<constraints>
101101
<constraint firstAttribute="height" constant="40" id="ZjG-ZS-5Tb"/>

0 commit comments

Comments
 (0)