Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 4.2 migration #24

Merged
merged 2 commits into from
Sep 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ fastlane/screenshots


*.DS_Store
IDEWorkspaceChecks.plist
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.2
2 changes: 1 addition & 1 deletion PasswordTextField.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "PasswordTextField"
s.version = "1.1.0"
s.version = "1.1.1"
s.summary = "A custom TextField with a switchable icon which shows or hides the password and enforce good password policies"
s.description = <<-DESC
A custom TextField with a switchable icon which shows or hides the password and enforce good password policies, written in Swift
Expand Down
162 changes: 27 additions & 135 deletions PasswordTextField.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@
83CBDC211C6B07A5006189C2 /* Frameworks */,
83CBDC221C6B07A5006189C2 /* Headers */,
83CBDC231C6B07A5006189C2 /* Resources */,
1C159FC2C57E85CE6F1E0A9D /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -394,7 +393,6 @@
83CBDC2C1C6B07A5006189C2 /* Frameworks */,
83CBDC2D1C6B07A5006189C2 /* Resources */,
5D9702E29321AF404C3E1044 /* [CP] Embed Pods Frameworks */,
ED98823D5BAE0DBD8D3C4124 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -414,8 +412,6 @@
83CBDC3F1C6B07B4006189C2 /* Sources */,
83CBDC401C6B07B4006189C2 /* Frameworks */,
83CBDC411C6B07B4006189C2 /* Resources */,
A1E76B0C882A09C17198F349 /* [CP] Embed Pods Frameworks */,
C905789B7821351D0F3066AF /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -434,8 +430,6 @@
83CBDC521C6B07B4006189C2 /* Sources */,
83CBDC531C6B07B4006189C2 /* Frameworks */,
83CBDC541C6B07B4006189C2 /* Resources */,
830B93FF5262C42956B269AA /* [CP] Embed Pods Frameworks */,
DB1113275BB36BBBAC0F26BA /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -455,8 +449,6 @@
83CBDC5D1C6B07B5006189C2 /* Sources */,
83CBDC5E1C6B07B5006189C2 /* Frameworks */,
83CBDC5F1C6B07B5006189C2 /* Resources */,
B09866B731E2395C98BB610E /* [CP] Embed Pods Frameworks */,
8AB51811ACE4FC57A7838A9F /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -475,16 +467,16 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Chris Jimenez";
TargetAttributes = {
83CBDC241C6B07A5006189C2 = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 1000;
};
83CBDC2E1C6B07A5006189C2 = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 1000;
};
83CBDC421C6B07B4006189C2 = {
CreatedOnToolsVersion = 7.2.1;
Expand Down Expand Up @@ -570,21 +562,6 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
1C159FC2C57E85CE6F1E0A9D /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextField/Pods-PasswordTextField-resources.sh\"\n";
showEnvVarsInLog = 0;
};
4A68E2733377810AF9CA9E2B /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -695,111 +672,6 @@
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";
showEnvVarsInLog = 0;
};
830B93FF5262C42956B269AA /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemoTests/Pods-PasswordTextFieldDemoTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
8AB51811ACE4FC57A7838A9F /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemoUITests/Pods-PasswordTextFieldDemoUITests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
A1E76B0C882A09C17198F349 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemo/Pods-PasswordTextFieldDemo-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
B09866B731E2395C98BB610E /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemoUITests/Pods-PasswordTextFieldDemoUITests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
C905789B7821351D0F3066AF /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemo/Pods-PasswordTextFieldDemo-resources.sh\"\n";
showEnvVarsInLog = 0;
};
DB1113275BB36BBBAC0F26BA /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldDemoTests/Pods-PasswordTextFieldDemoTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
ED98823D5BAE0DBD8D3C4124 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PasswordTextFieldTests/Pods-PasswordTextFieldTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -902,14 +774,22 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -952,14 +832,22 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -1005,7 +893,8 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1025,7 +914,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.greenpixels.PasswordTextField;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -1039,7 +929,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.greenpixels.PasswordTextFieldTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1052,7 +943,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.greenpixels.PasswordTextFieldTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down
2 changes: 1 addition & 1 deletion PasswordTextField/BundleUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ open class BundleUtil:NSObject{


/// Gets the bundle property for the pod
open static var bundle:Bundle{
public static var bundle:Bundle{

get{

Expand Down
2 changes: 1 addition & 1 deletion PasswordTextField/PasswordTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ open class PasswordTextField: UITextField {
case Always = "always"
case Never = "never"

var textViewMode: UITextFieldViewMode {
var textViewMode: UITextField.ViewMode {
switch self{

case .Editing:
Expand Down
8 changes: 4 additions & 4 deletions PasswordTextField/SecureTextToggleButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ open class SecureTextToggleButton: UIButton {
open var showSecureTextImage:UIImage = UIImage(named: "visibility_on", in:BundleUtil.bundle, compatibleWith: nil)!{

didSet{
self.setImage(showSecureTextImage.withRenderingMode(UIImageRenderingMode.alwaysTemplate),for: UIControlState())
self.setImage(showSecureTextImage.withRenderingMode(UIImage.RenderingMode.alwaysTemplate),for: UIControl.State())
}

}
Expand Down Expand Up @@ -104,7 +104,7 @@ open class SecureTextToggleButton: UIButton {
self.tintColor = imageTint

//Sets the aspect fit of the image
self.contentMode = UIViewContentMode.scaleAspectFit
self.contentMode = UIView.ContentMode.scaleAspectFit
self.backgroundColor = UIColor.clear

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


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

/**
Expand Down
7 changes: 6 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ DEPENDENCIES:
- Nimble
- Quick

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Nimble
- Quick

SPEC CHECKSUMS:
Nimble: 7f5a9c447a33002645a071bddafbfb24ea70e0ac
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08

PODFILE CHECKSUM: 6d90a9b3b6c93b3f5f9de2f373a228d541a7a5a3

COCOAPODS: 1.4.0
COCOAPODS: 1.5.3