Skip to content

Commit f7df6ce

Browse files
author
Raul Riera
committed
Initial support for iOS 11
1 parent 4b7cc51 commit f7df6ce

File tree

13 files changed

+42
-35
lines changed

13 files changed

+42
-35
lines changed

TextFieldEffects/TextFieldEffects.xcodeproj/project.pbxproj

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,17 @@
218218
isa = PBXProject;
219219
attributes = {
220220
LastSwiftUpdateCheck = 0700;
221-
LastUpgradeCheck = 0820;
221+
LastUpgradeCheck = 0900;
222222
ORGANIZATIONNAME = "Raul Riera";
223223
TargetAttributes = {
224224
4CB3B6CD1AA8DEA7000AFA56 = {
225225
CreatedOnToolsVersion = 6.2;
226-
LastSwiftMigration = 0800;
226+
LastSwiftMigration = 0900;
227227
};
228228
4CBF766C1A71AF7700073B6A = {
229229
CreatedOnToolsVersion = 6.1.1;
230-
LastSwiftMigration = 0800;
230+
DevelopmentTeam = R64MTWS872;
231+
LastSwiftMigration = 0900;
231232
};
232233
};
233234
};
@@ -348,7 +349,7 @@
348349
PRODUCT_NAME = "$(TARGET_NAME)";
349350
SKIP_INSTALL = YES;
350351
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
351-
SWIFT_VERSION = 3.0;
352+
SWIFT_VERSION = 4.0;
352353
};
353354
name = Debug;
354355
};
@@ -369,7 +370,7 @@
369370
PRODUCT_NAME = "$(TARGET_NAME)";
370371
SKIP_INSTALL = YES;
371372
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
372-
SWIFT_VERSION = 3.0;
373+
SWIFT_VERSION = 4.0;
373374
};
374375
name = Release;
375376
};
@@ -381,14 +382,20 @@
381382
CLANG_CXX_LIBRARY = "libc++";
382383
CLANG_ENABLE_MODULES = YES;
383384
CLANG_ENABLE_OBJC_ARC = YES;
385+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
384386
CLANG_WARN_BOOL_CONVERSION = YES;
387+
CLANG_WARN_COMMA = YES;
385388
CLANG_WARN_CONSTANT_CONVERSION = YES;
386389
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
387390
CLANG_WARN_EMPTY_BODY = YES;
388391
CLANG_WARN_ENUM_CONVERSION = YES;
389392
CLANG_WARN_INFINITE_RECURSION = YES;
390393
CLANG_WARN_INT_CONVERSION = YES;
394+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
395+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
391396
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
397+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
398+
CLANG_WARN_STRICT_PROTOTYPES = YES;
392399
CLANG_WARN_SUSPICIOUS_MOVE = YES;
393400
CLANG_WARN_UNREACHABLE_CODE = YES;
394401
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -432,14 +439,20 @@
432439
CLANG_CXX_LIBRARY = "libc++";
433440
CLANG_ENABLE_MODULES = YES;
434441
CLANG_ENABLE_OBJC_ARC = YES;
442+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
435443
CLANG_WARN_BOOL_CONVERSION = YES;
444+
CLANG_WARN_COMMA = YES;
436445
CLANG_WARN_CONSTANT_CONVERSION = YES;
437446
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
438447
CLANG_WARN_EMPTY_BODY = YES;
439448
CLANG_WARN_ENUM_CONVERSION = YES;
440449
CLANG_WARN_INFINITE_RECURSION = YES;
441450
CLANG_WARN_INT_CONVERSION = YES;
451+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
452+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
442453
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
454+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
455+
CLANG_WARN_STRICT_PROTOTYPES = YES;
443456
CLANG_WARN_SUSPICIOUS_MOVE = YES;
444457
CLANG_WARN_UNREACHABLE_CODE = YES;
445458
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -472,6 +485,7 @@
472485
buildSettings = {
473486
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
474487
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
488+
DEVELOPMENT_TEAM = R64MTWS872;
475489
GCC_PREPROCESSOR_DEFINITIONS = (
476490
"DEBUG=1",
477491
"$(inherited)",
@@ -480,7 +494,7 @@
480494
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
481495
PRODUCT_BUNDLE_IDENTIFIER = "com.raulriera.$(PRODUCT_NAME:rfc1034identifier)";
482496
PRODUCT_NAME = "$(TARGET_NAME)";
483-
SWIFT_VERSION = 3.0;
497+
SWIFT_VERSION = 4.0;
484498
};
485499
name = Debug;
486500
};
@@ -489,12 +503,13 @@
489503
buildSettings = {
490504
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
491505
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
506+
DEVELOPMENT_TEAM = R64MTWS872;
492507
INFOPLIST_FILE = TextFieldsDemo/Info.plist;
493508
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
494509
PRODUCT_BUNDLE_IDENTIFIER = "com.raulriera.$(PRODUCT_NAME:rfc1034identifier)";
495510
PRODUCT_NAME = "$(TARGET_NAME)";
496511
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
497-
SWIFT_VERSION = 3.0;
512+
SWIFT_VERSION = 4.0;
498513
};
499514
name = Release;
500515
};

TextFieldEffects/TextFieldEffects.xcodeproj/xcshareddata/xcschemes/TextFieldEffects.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0820"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,6 +40,7 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
language = ""
4344
shouldUseLaunchSchemeArgsEnv = "YES">
4445
<Testables>
4546
<TestableReference
@@ -69,6 +70,7 @@
6970
buildConfiguration = "Debug"
7071
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7172
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73+
language = ""
7274
launchStyle = "0"
7375
useCustomWorkingDirectory = "NO"
7476
ignoresPersistentStateOnLaunch = "NO"

TextFieldEffects/TextFieldEffects/AkiraTextField.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import UIKit
1212
An AkiraTextField is a subclass of the TextFieldEffects object, is a control that displays an UITextField with a customizable visual effect around the edges of the control.
1313
*/
1414
@IBDesignable open class AkiraTextField : TextFieldEffects {
15-
16-
private let borderSize: (active: CGFloat, inactive: CGFloat) = (1, 2)
15+
private let borderSize: (active: CGFloat, inactive: CGFloat) = (1, 2)
1716
private let borderLayer = CALayer()
1817
private let textFieldInsets = CGPoint(x: 6, y: 0)
1918
private let placeholderInsets = CGPoint(x: 6, y: 0)

TextFieldEffects/TextFieldEffects/HoshiTextField.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import UIKit
1212
An HoshiTextField is a subclass of the TextFieldEffects object, is a control that displays an UITextField with a customizable visual effect around the lower edge of the control.
1313
*/
1414
@IBDesignable open class HoshiTextField: TextFieldEffects {
15-
1615
/**
1716
The color of the border when it has no content.
1817

TextFieldEffects/TextFieldEffects/IsaoTextField.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import UIKit
1212
An IsaoTextField is a subclass of the TextFieldEffects object, is a control that displays an UITextField with a customizable visual effect around the lower edge of the control.
1313
*/
1414
@IBDesignable open class IsaoTextField: TextFieldEffects {
15-
1615
/**
1716
The color of the border when it has no content.
1817

@@ -67,7 +66,7 @@ import UIKit
6766
// MARK: - TextFieldEffects
6867

6968
override open func drawViewsForRect(_ rect: CGRect) {
70-
let frame = CGRect(origin: CGPoint.zero, size: CGSize(width: rect.size.width, height: rect.size.height))
69+
let frame = CGRect(origin: .zero, size: CGSize(width: rect.size.width, height: rect.size.height))
7170

7271
placeholderLabel.frame = frame.insetBy(dx: placeholderInsets.x, dy: placeholderInsets.y)
7372
placeholderLabel.font = placeholderFontFromFont(font!)
@@ -144,19 +143,18 @@ import UIKit
144143
}
145144

146145
private func performPlaceholderAnimationWithColor(_ color: UIColor) {
147-
148146
let yOffset: CGFloat = 4
149147

150148
UIView.animate(withDuration: 0.15, animations: {
151149
self.placeholderLabel.transform = CGAffineTransform(translationX: 0, y: -yOffset)
152150
self.placeholderLabel.alpha = 0
153151
}) { _ in
154-
self.placeholderLabel.transform = CGAffineTransform.identity
152+
self.placeholderLabel.transform = .identity
155153
self.placeholderLabel.transform = CGAffineTransform(translationX: 0, y: yOffset)
156154

157155
UIView.animate(withDuration: 0.15, animations: {
158156
self.placeholderLabel.textColor = color
159-
self.placeholderLabel.transform = CGAffineTransform.identity
157+
self.placeholderLabel.transform = .identity
160158
self.placeholderLabel.alpha = 1
161159
}) { _ in
162160
self.animationCompletionHandler?(self.isFirstResponder ? .textEntry : .textDisplay)

TextFieldEffects/TextFieldEffects/JiroTextField.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import UIKit
1212
A JiroTextField is a subclass of the TextFieldEffects object, is a control that displays an UITextField with a customizable visual effect around the background of the control.
1313
*/
1414
@IBDesignable open class JiroTextField: TextFieldEffects {
15-
1615
/**
1716
The color of the border.
1817

@@ -75,7 +74,7 @@ import UIKit
7574
updateBorder()
7675
updatePlaceholder()
7776

78-
layer.addSublayer(borderLayer)
77+
layer.insertSublayer(borderLayer, at: 0)
7978
addSubview(placeholderLabel)
8079
}
8180

TextFieldEffects/TextFieldEffects/KaedeTextField.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import UIKit
1212
A KaedeTextField is a subclass of the TextFieldEffects object, is a control that displays an UITextField with a customizable visual effect around the foreground of the control.
1313
*/
1414
@IBDesignable open class KaedeTextField: TextFieldEffects {
15-
1615
/**
1716
The color of the placeholder text.
1817

@@ -65,7 +64,7 @@ import UIKit
6564
// MARK: - TextFieldEffects
6665

6766
override open func drawViewsForRect(_ rect: CGRect) {
68-
let frame = CGRect(origin: CGPoint.zero, size: CGSize(width: rect.size.width, height: rect.size.height))
67+
let frame = CGRect(origin: .zero, size: CGSize(width: rect.size.width, height: rect.size.height))
6968

7069
foregroundView.frame = frame
7170
foregroundView.isUserInteractionEnabled = false

TextFieldEffects/TextFieldEffects/MadokaTextField.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import UIKit
1212
A MadokaTextField is a subclass of the TextFieldEffects object, is a control that displays an UITextField with a customizable visual effect around the edges of the control.
1313
*/
1414
@IBDesignable open class MadokaTextField: TextFieldEffects {
15-
1615
/**
1716
The color of the placeholder text.
1817

@@ -98,7 +97,7 @@ import UIKit
9897
borderLayer.strokeEnd = percentageForBottomBorder()
9998

10099
UIView.animate(withDuration: 0.3, animations: {
101-
self.placeholderLabel.transform = CGAffineTransform.identity
100+
self.placeholderLabel.transform = .identity
102101
}) { _ in
103102
self.animationCompletionHandler?(.textDisplay)
104103
}

TextFieldEffects/TextFieldEffects/MinoruTextField.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import UIKit
1212
A MinoruTextField is a subclass of the TextFieldEffects object, is a control that displays an UITextField with a customizable visual effect around the edges of the control.
1313
*/
1414
@IBDesignable open class MinoruTextField: TextFieldEffects {
15-
1615
/**
1716
The color of the placeholder text.
1817

@@ -74,7 +73,7 @@ import UIKit
7473
updateBorder()
7574
updatePlaceholder()
7675

77-
layer.addSublayer(borderLayer)
76+
layer.insertSublayer(borderLayer, at: 0)
7877
addSubview(placeholderLabel)
7978
}
8079

TextFieldEffects/TextFieldEffects/TextFieldEffects.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extension String {
1212
/**
1313
true if self contains characters.
1414
*/
15-
public var isNotEmpty: Bool {
15+
var isNotEmpty: Bool {
1616
return !isEmpty
1717
}
1818
}
@@ -21,7 +21,6 @@ extension String {
2121
A TextFieldEffects object is a control that displays editable text and contains the boilerplates to setup unique animations for text entry and display. You typically use this class the same way you use UITextField.
2222
*/
2323
open class TextFieldEffects : UITextField {
24-
2524
/**
2625
The type of animation a TextFieldEffect can perform.
2726

@@ -110,14 +109,14 @@ open class TextFieldEffects : UITextField {
110109
/**
111110
The textfield has started an editing session.
112111
*/
113-
open func textFieldDidBeginEditing() {
112+
@objc open func textFieldDidBeginEditing() {
114113
animateViewsForTextEntry()
115114
}
116115

117116
/**
118117
The textfield has ended an editing session.
119118
*/
120-
open func textFieldDidEndEditing() {
119+
@objc open func textFieldDidEndEditing() {
121120
animateViewsForTextDisplay()
122121
}
123122

0 commit comments

Comments
 (0)