Skip to content

Commit fad087b

Browse files
authored
Merge pull request #24 from SergeyPetrachkov/master
Swift 4.2 migration
2 parents c05cc5d + a7a074f commit fad087b

9 files changed

Lines changed: 45 additions & 147 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ fastlane/screenshots
6464

6565

6666
*.DS_Store
67+
IDEWorkspaceChecks.plist

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0
1+
4.2

PasswordTextField.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "PasswordTextField"
4-
s.version = "1.1.0"
4+
s.version = "1.1.1"
55
s.summary = "A custom TextField with a switchable icon which shows or hides the password and enforce good password policies"
66
s.description = <<-DESC
77
A custom TextField with a switchable icon which shows or hides the password and enforce good password policies, written in Swift

PasswordTextField.xcodeproj/project.pbxproj

Lines changed: 27 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@
374374
83CBDC211C6B07A5006189C2 /* Frameworks */,
375375
83CBDC221C6B07A5006189C2 /* Headers */,
376376
83CBDC231C6B07A5006189C2 /* Resources */,
377-
1C159FC2C57E85CE6F1E0A9D /* [CP] Copy Pods Resources */,
378377
);
379378
buildRules = (
380379
);
@@ -394,7 +393,6 @@
394393
83CBDC2C1C6B07A5006189C2 /* Frameworks */,
395394
83CBDC2D1C6B07A5006189C2 /* Resources */,
396395
5D9702E29321AF404C3E1044 /* [CP] Embed Pods Frameworks */,
397-
ED98823D5BAE0DBD8D3C4124 /* [CP] Copy Pods Resources */,
398396
);
399397
buildRules = (
400398
);
@@ -414,8 +412,6 @@
414412
83CBDC3F1C6B07B4006189C2 /* Sources */,
415413
83CBDC401C6B07B4006189C2 /* Frameworks */,
416414
83CBDC411C6B07B4006189C2 /* Resources */,
417-
A1E76B0C882A09C17198F349 /* [CP] Embed Pods Frameworks */,
418-
C905789B7821351D0F3066AF /* [CP] Copy Pods Resources */,
419415
);
420416
buildRules = (
421417
);
@@ -434,8 +430,6 @@
434430
83CBDC521C6B07B4006189C2 /* Sources */,
435431
83CBDC531C6B07B4006189C2 /* Frameworks */,
436432
83CBDC541C6B07B4006189C2 /* Resources */,
437-
830B93FF5262C42956B269AA /* [CP] Embed Pods Frameworks */,
438-
DB1113275BB36BBBAC0F26BA /* [CP] Copy Pods Resources */,
439433
);
440434
buildRules = (
441435
);
@@ -455,8 +449,6 @@
455449
83CBDC5D1C6B07B5006189C2 /* Sources */,
456450
83CBDC5E1C6B07B5006189C2 /* Frameworks */,
457451
83CBDC5F1C6B07B5006189C2 /* Resources */,
458-
B09866B731E2395C98BB610E /* [CP] Embed Pods Frameworks */,
459-
8AB51811ACE4FC57A7838A9F /* [CP] Copy Pods Resources */,
460452
);
461453
buildRules = (
462454
);
@@ -475,16 +467,16 @@
475467
isa = PBXProject;
476468
attributes = {
477469
LastSwiftUpdateCheck = 0720;
478-
LastUpgradeCheck = 0800;
470+
LastUpgradeCheck = 1000;
479471
ORGANIZATIONNAME = "Chris Jimenez";
480472
TargetAttributes = {
481473
83CBDC241C6B07A5006189C2 = {
482474
CreatedOnToolsVersion = 7.2.1;
483-
LastSwiftMigration = 0800;
475+
LastSwiftMigration = 1000;
484476
};
485477
83CBDC2E1C6B07A5006189C2 = {
486478
CreatedOnToolsVersion = 7.2.1;
487-
LastSwiftMigration = 0800;
479+
LastSwiftMigration = 1000;
488480
};
489481
83CBDC421C6B07B4006189C2 = {
490482
CreatedOnToolsVersion = 7.2.1;
@@ -570,21 +562,6 @@
570562
/* End PBXResourcesBuildPhase section */
571563

572564
/* Begin PBXShellScriptBuildPhase section */
573-
1C159FC2C57E85CE6F1E0A9D /* [CP] Copy Pods Resources */ = {
574-
isa = PBXShellScriptBuildPhase;
575-
buildActionMask = 2147483647;
576-
files = (
577-
);
578-
inputPaths = (
579-
);
580-
name = "[CP] Copy Pods Resources";
581-
outputPaths = (
582-
);
583-
runOnlyForDeploymentPostprocessing = 0;
584-
shellPath = /bin/sh;
585-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextField/Pods-PasswordTextField-resources.sh\"\n";
586-
showEnvVarsInLog = 0;
587-
};
588565
4A68E2733377810AF9CA9E2B /* [CP] Check Pods Manifest.lock */ = {
589566
isa = PBXShellScriptBuildPhase;
590567
buildActionMask = 2147483647;
@@ -695,111 +672,6 @@
695672
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
696673
showEnvVarsInLog = 0;
697674
};
698-
830B93FF5262C42956B269AA /* [CP] Embed Pods Frameworks */ = {
699-
isa = PBXShellScriptBuildPhase;
700-
buildActionMask = 2147483647;
701-
files = (
702-
);
703-
inputPaths = (
704-
);
705-
name = "[CP] Embed Pods Frameworks";
706-
outputPaths = (
707-
);
708-
runOnlyForDeploymentPostprocessing = 0;
709-
shellPath = /bin/sh;
710-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemoTests/Pods-PasswordTextFieldDemoTests-frameworks.sh\"\n";
711-
showEnvVarsInLog = 0;
712-
};
713-
8AB51811ACE4FC57A7838A9F /* [CP] Copy Pods Resources */ = {
714-
isa = PBXShellScriptBuildPhase;
715-
buildActionMask = 2147483647;
716-
files = (
717-
);
718-
inputPaths = (
719-
);
720-
name = "[CP] Copy Pods Resources";
721-
outputPaths = (
722-
);
723-
runOnlyForDeploymentPostprocessing = 0;
724-
shellPath = /bin/sh;
725-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemoUITests/Pods-PasswordTextFieldDemoUITests-resources.sh\"\n";
726-
showEnvVarsInLog = 0;
727-
};
728-
A1E76B0C882A09C17198F349 /* [CP] Embed Pods Frameworks */ = {
729-
isa = PBXShellScriptBuildPhase;
730-
buildActionMask = 2147483647;
731-
files = (
732-
);
733-
inputPaths = (
734-
);
735-
name = "[CP] Embed Pods Frameworks";
736-
outputPaths = (
737-
);
738-
runOnlyForDeploymentPostprocessing = 0;
739-
shellPath = /bin/sh;
740-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemo/Pods-PasswordTextFieldDemo-frameworks.sh\"\n";
741-
showEnvVarsInLog = 0;
742-
};
743-
B09866B731E2395C98BB610E /* [CP] Embed Pods Frameworks */ = {
744-
isa = PBXShellScriptBuildPhase;
745-
buildActionMask = 2147483647;
746-
files = (
747-
);
748-
inputPaths = (
749-
);
750-
name = "[CP] Embed Pods Frameworks";
751-
outputPaths = (
752-
);
753-
runOnlyForDeploymentPostprocessing = 0;
754-
shellPath = /bin/sh;
755-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemoUITests/Pods-PasswordTextFieldDemoUITests-frameworks.sh\"\n";
756-
showEnvVarsInLog = 0;
757-
};
758-
C905789B7821351D0F3066AF /* [CP] Copy Pods Resources */ = {
759-
isa = PBXShellScriptBuildPhase;
760-
buildActionMask = 2147483647;
761-
files = (
762-
);
763-
inputPaths = (
764-
);
765-
name = "[CP] Copy Pods Resources";
766-
outputPaths = (
767-
);
768-
runOnlyForDeploymentPostprocessing = 0;
769-
shellPath = /bin/sh;
770-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemo/Pods-PasswordTextFieldDemo-resources.sh\"\n";
771-
showEnvVarsInLog = 0;
772-
};
773-
DB1113275BB36BBBAC0F26BA /* [CP] Copy Pods Resources */ = {
774-
isa = PBXShellScriptBuildPhase;
775-
buildActionMask = 2147483647;
776-
files = (
777-
);
778-
inputPaths = (
779-
);
780-
name = "[CP] Copy Pods Resources";
781-
outputPaths = (
782-
);
783-
runOnlyForDeploymentPostprocessing = 0;
784-
shellPath = /bin/sh;
785-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemoTests/Pods-PasswordTextFieldDemoTests-resources.sh\"\n";
786-
showEnvVarsInLog = 0;
787-
};
788-
ED98823D5BAE0DBD8D3C4124 /* [CP] Copy Pods Resources */ = {
789-
isa = PBXShellScriptBuildPhase;
790-
buildActionMask = 2147483647;
791-
files = (
792-
);
793-
inputPaths = (
794-
);
795-
name = "[CP] Copy Pods Resources";
796-
outputPaths = (
797-
);
798-
runOnlyForDeploymentPostprocessing = 0;
799-
shellPath = /bin/sh;
800-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldTests/Pods-PasswordTextFieldTests-resources.sh\"\n";
801-
showEnvVarsInLog = 0;
802-
};
803675
/* End PBXShellScriptBuildPhase section */
804676

805677
/* Begin PBXSourcesBuildPhase section */
@@ -902,14 +774,22 @@
902774
CLANG_CXX_LIBRARY = "libc++";
903775
CLANG_ENABLE_MODULES = YES;
904776
CLANG_ENABLE_OBJC_ARC = YES;
777+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
905778
CLANG_WARN_BOOL_CONVERSION = YES;
779+
CLANG_WARN_COMMA = YES;
906780
CLANG_WARN_CONSTANT_CONVERSION = YES;
781+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
907782
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
908783
CLANG_WARN_EMPTY_BODY = YES;
909784
CLANG_WARN_ENUM_CONVERSION = YES;
910785
CLANG_WARN_INFINITE_RECURSION = YES;
911786
CLANG_WARN_INT_CONVERSION = YES;
787+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
788+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
789+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
912790
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
791+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
792+
CLANG_WARN_STRICT_PROTOTYPES = YES;
913793
CLANG_WARN_SUSPICIOUS_MOVE = YES;
914794
CLANG_WARN_UNREACHABLE_CODE = YES;
915795
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -952,14 +832,22 @@
952832
CLANG_CXX_LIBRARY = "libc++";
953833
CLANG_ENABLE_MODULES = YES;
954834
CLANG_ENABLE_OBJC_ARC = YES;
835+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
955836
CLANG_WARN_BOOL_CONVERSION = YES;
837+
CLANG_WARN_COMMA = YES;
956838
CLANG_WARN_CONSTANT_CONVERSION = YES;
839+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
957840
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
958841
CLANG_WARN_EMPTY_BODY = YES;
959842
CLANG_WARN_ENUM_CONVERSION = YES;
960843
CLANG_WARN_INFINITE_RECURSION = YES;
961844
CLANG_WARN_INT_CONVERSION = YES;
845+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
846+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
847+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
962848
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
849+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
850+
CLANG_WARN_STRICT_PROTOTYPES = YES;
963851
CLANG_WARN_SUSPICIOUS_MOVE = YES;
964852
CLANG_WARN_UNREACHABLE_CODE = YES;
965853
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -1005,7 +893,8 @@
1005893
PRODUCT_NAME = "$(TARGET_NAME)";
1006894
SKIP_INSTALL = YES;
1007895
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1008-
SWIFT_VERSION = 4.0;
896+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
897+
SWIFT_VERSION = 4.2;
1009898
};
1010899
name = Debug;
1011900
};
@@ -1025,7 +914,8 @@
1025914
PRODUCT_BUNDLE_IDENTIFIER = com.greenpixels.PasswordTextField;
1026915
PRODUCT_NAME = "$(TARGET_NAME)";
1027916
SKIP_INSTALL = YES;
1028-
SWIFT_VERSION = 4.0;
917+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
918+
SWIFT_VERSION = 4.2;
1029919
};
1030920
name = Release;
1031921
};
@@ -1039,7 +929,8 @@
1039929
PRODUCT_BUNDLE_IDENTIFIER = com.greenpixels.PasswordTextFieldTests;
1040930
PRODUCT_NAME = "$(TARGET_NAME)";
1041931
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1042-
SWIFT_VERSION = 3.0;
932+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
933+
SWIFT_VERSION = 4.2;
1043934
};
1044935
name = Debug;
1045936
};
@@ -1052,7 +943,8 @@
1052943
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1053944
PRODUCT_BUNDLE_IDENTIFIER = com.greenpixels.PasswordTextFieldTests;
1054945
PRODUCT_NAME = "$(TARGET_NAME)";
1055-
SWIFT_VERSION = 3.0;
946+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
947+
SWIFT_VERSION = 4.2;
1056948
};
1057949
name = Release;
1058950
};

PasswordTextField.xcodeproj/xcshareddata/xcschemes/PasswordTextField.xcscheme

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,8 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "YES"
30-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3131
<Testables>
3232
<TestableReference
3333
skipped = "NO">

PasswordTextField/BundleUtil.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ open class BundleUtil:NSObject{
1414

1515

1616
/// Gets the bundle property for the pod
17-
open static var bundle:Bundle{
17+
public static var bundle:Bundle{
1818

1919
get{
2020

PasswordTextField/PasswordTextField.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ open class PasswordTextField: UITextField {
2020
case Always = "always"
2121
case Never = "never"
2222

23-
var textViewMode: UITextFieldViewMode {
23+
var textViewMode: UITextField.ViewMode {
2424
switch self{
2525

2626
case .Editing:

PasswordTextField/SecureTextToggleButton.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ open class SecureTextToggleButton: UIButton {
3636
open var showSecureTextImage:UIImage = UIImage(named: "visibility_on", in:BundleUtil.bundle, compatibleWith: nil)!{
3737

3838
didSet{
39-
self.setImage(showSecureTextImage.withRenderingMode(UIImageRenderingMode.alwaysTemplate),for: UIControlState())
39+
self.setImage(showSecureTextImage.withRenderingMode(UIImage.RenderingMode.alwaysTemplate),for: UIControl.State())
4040
}
4141

4242
}
@@ -104,7 +104,7 @@ open class SecureTextToggleButton: UIButton {
104104
self.tintColor = imageTint
105105

106106
//Sets the aspect fit of the image
107-
self.contentMode = UIViewContentMode.scaleAspectFit
107+
self.contentMode = UIView.ContentMode.scaleAspectFit
108108
self.backgroundColor = UIColor.clear
109109

110110
//Initialize the component with the secure state
@@ -120,7 +120,7 @@ open class SecureTextToggleButton: UIButton {
120120
*/
121121
func setVisibilityOn()
122122
{
123-
self.setImage(showSecureTextImage.withRenderingMode(UIImageRenderingMode.alwaysTemplate),for: UIControlState())
123+
self.setImage(showSecureTextImage.withRenderingMode(UIImage.RenderingMode.alwaysTemplate),for: UIControl.State())
124124
}
125125

126126

@@ -129,7 +129,7 @@ open class SecureTextToggleButton: UIButton {
129129
*/
130130
func setVisibilityOff()
131131
{
132-
self.setImage(hideSecureTextImage.withRenderingMode(UIImageRenderingMode.alwaysTemplate),for: UIControlState())
132+
self.setImage(hideSecureTextImage.withRenderingMode(UIImage.RenderingMode.alwaysTemplate),for: UIControl.State())
133133
}
134134

135135
/**

Podfile.lock

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ DEPENDENCIES:
66
- Nimble
77
- Quick
88

9+
SPEC REPOS:
10+
https://github.com/cocoapods/specs.git:
11+
- Nimble
12+
- Quick
13+
914
SPEC CHECKSUMS:
1015
Nimble: 7f5a9c447a33002645a071bddafbfb24ea70e0ac
1116
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
1217

1318
PODFILE CHECKSUM: 6d90a9b3b6c93b3f5f9de2f373a228d541a7a5a3
1419

15-
COCOAPODS: 1.4.0
20+
COCOAPODS: 1.5.3

0 commit comments

Comments
 (0)