From 4adfe1489c4ed02d6d370892fdb138711dee40a5 Mon Sep 17 00:00:00 2001 From: Igor Kislyuk Date: Wed, 18 Oct 2017 02:43:44 +0300 Subject: [PATCH] Update for setting date --- CHANGELOG.md | 5 +++++ Example/UIAnimatedTextField.xcodeproj/project.pbxproj | 8 +++++++- UIAnimatedTextField.podspec | 2 +- UIAnimatedTextField/Source/UIAnimatedTextField.swift | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..446cc81 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 0.2.0 + +- **Fix**: date setting after picker presented. \ No newline at end of file diff --git a/Example/UIAnimatedTextField.xcodeproj/project.pbxproj b/Example/UIAnimatedTextField.xcodeproj/project.pbxproj index edc96d0..3eaf972 100644 --- a/Example/UIAnimatedTextField.xcodeproj/project.pbxproj +++ b/Example/UIAnimatedTextField.xcodeproj/project.pbxproj @@ -173,9 +173,12 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-UIAnimatedTextField_Tests/Pods-UIAnimatedTextField_Tests-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/UIAnimatedTextField/UIAnimatedTextField.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UIAnimatedTextField.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -203,13 +206,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-UIAnimatedTextField_Tests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../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"; + 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; }; /* End PBXShellScriptBuildPhase section */ diff --git a/UIAnimatedTextField.podspec b/UIAnimatedTextField.podspec index 3b94d90..cfa5d4b 100644 --- a/UIAnimatedTextField.podspec +++ b/UIAnimatedTextField.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'UIAnimatedTextField' - s.version = '0.1.13' + s.version = '0.2.0' s.summary = 'UITextField with animated placeholder' s.description = <<-DESC This custom control can be used as a replacement for UITextField. It comes with 5 different text types: simple, password, url, tappable, date. diff --git a/UIAnimatedTextField/Source/UIAnimatedTextField.swift b/UIAnimatedTextField/Source/UIAnimatedTextField.swift index 814bd6f..ef1a775 100644 --- a/UIAnimatedTextField/Source/UIAnimatedTextField.swift +++ b/UIAnimatedTextField/Source/UIAnimatedTextField.swift @@ -418,7 +418,7 @@ open class UIAnimatedTextField: UIView { datePicker.timeZone = TimeZone(secondsFromGMT: 0) datePicker.datePickerMode = .date datePicker.backgroundColor = UIColor.white - datePicker.setDate(currentDate, animated: true) + datePicker.setDate(selectedDate ?? currentDate, animated: true) datePicker.maximumDate = currentDate datePicker.addTarget(self, action: #selector(datePickerValueChanged(_:)), for: .valueChanged)