From 08bc48f5b4641732b948a7b442a580f8ebae2bcc Mon Sep 17 00:00:00 2001 From: Andre Nguyen Date: Thu, 10 Jan 2019 18:48:39 +0100 Subject: [PATCH 1/8] Update DatePickerDialog.swift Make dialog view wider (text won't fit otherwise) --- Sources/DatePickerDialog.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/DatePickerDialog.swift b/Sources/DatePickerDialog.swift index 880479d..8426bb0 100644 --- a/Sources/DatePickerDialog.swift +++ b/Sources/DatePickerDialog.swift @@ -73,7 +73,7 @@ open class DatePickerDialog: UIView { /// Handle device orientation changes @objc func deviceOrientationDidChange(_ notification: Notification) { self.frame = UIScreen.main.bounds - let dialogSize = CGSize(width: 300, height: 230 + kDefaultButtonHeight + kDefaultButtonSpacerHeight) + let dialogSize = CGSize(width: UIScreen.main.bounds.size.width - 10, height: 230 + kDefaultButtonHeight + kDefaultButtonSpacerHeight) dialogView.frame = CGRect(x: (UIScreen.main.bounds.size.width - dialogSize.width) / 2, y: (UIScreen.main.bounds.size.height - dialogSize.height) / 2, width: dialogSize.width, From 3afbaef17ed756270604e5a64fa68ff569d97ff1 Mon Sep 17 00:00:00 2001 From: Andre Nguyen Date: Thu, 10 Jan 2019 18:58:37 +0100 Subject: [PATCH 2/8] Update DatePickerDialog.swift update size of dialog view --- Sources/DatePickerDialog.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/DatePickerDialog.swift b/Sources/DatePickerDialog.swift index 8426bb0..5d100da 100644 --- a/Sources/DatePickerDialog.swift +++ b/Sources/DatePickerDialog.swift @@ -159,7 +159,7 @@ open class DatePickerDialog: UIView { /// Creates the container view here: create the dialog, then add the custom content and buttons private func createContainerView() -> UIView { let screenSize = UIScreen.main.bounds.size - let dialogSize = CGSize(width: 300, height: 230 + kDefaultButtonHeight + kDefaultButtonSpacerHeight) + let dialogSize = CGSize(width: UIScreen.main.bounds.size.width - 10, height: 230 + kDefaultButtonHeight + kDefaultButtonSpacerHeight) // For the black background self.frame = CGRect(x: 0, y: 0, width: screenSize.width, height: screenSize.height) From 16758f18da42a9e38bdf00518f84688a532b1695 Mon Sep 17 00:00:00 2001 From: Andre Nguyen Date: Thu, 10 Jan 2019 19:54:52 +0100 Subject: [PATCH 3/8] Update DatePickerDialog.swift date picker size --- Sources/DatePickerDialog.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/DatePickerDialog.swift b/Sources/DatePickerDialog.swift index 5d100da..6c9f004 100644 --- a/Sources/DatePickerDialog.swift +++ b/Sources/DatePickerDialog.swift @@ -220,7 +220,7 @@ open class DatePickerDialog: UIView { let datePicker = UIDatePicker(frame: CGRect(x: 0, y: 30, width: 0, height: 0)) datePicker.setValue(self.textColor, forKeyPath: "textColor") datePicker.autoresizingMask = .flexibleRightMargin - datePicker.frame.size.width = 300 + datePicker.frame.size.width = UIScreen.main.bounds.size.width - 10 datePicker.frame.size.height = 216 return datePicker } From 47849ab173765e6d88581e632011d6995dbb8e66 Mon Sep 17 00:00:00 2001 From: Andre Nguyen Date: Mon, 11 Mar 2019 15:16:02 +0100 Subject: [PATCH 4/8] Update DatePickerDialog.swift Swift 4.2 update --- Sources/DatePickerDialog.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/DatePickerDialog.swift b/Sources/DatePickerDialog.swift index 6c9f004..e59820c 100644 --- a/Sources/DatePickerDialog.swift +++ b/Sources/DatePickerDialog.swift @@ -24,7 +24,7 @@ open class DatePickerDialog: UIView { // MARK: - Variables private var defaultDate: Date? - private var datePickerMode: UIDatePickerMode? + private var datePickerMode: UIDatePicker.Mode? private var callback: DatePickerCallback? var showCancelButton: Bool = false var locale: Locale? @@ -86,7 +86,7 @@ open class DatePickerDialog: UIView { cancelButtonTitle: String = "Cancel", defaultDate: Date = Date(), minimumDate: Date? = nil, maximumDate: Date? = nil, - datePickerMode: UIDatePickerMode = .dateAndTime, + datePickerMode: UIDatePicker.Mode = .dateAndTime, callback: @escaping DatePickerCallback) { self.titleLabel.text = title self.doneButton.setTitle(doneButtonTitle, for: .normal) @@ -96,7 +96,7 @@ open class DatePickerDialog: UIView { self.datePickerMode = datePickerMode self.callback = callback self.defaultDate = defaultDate - self.datePicker.datePickerMode = self.datePickerMode ?? UIDatePickerMode.date + self.datePicker.datePickerMode = self.datePickerMode ?? UIDatePicker.Mode.date self.datePicker.date = self.defaultDate ?? Date() self.datePicker.maximumDate = maximumDate self.datePicker.minimumDate = minimumDate @@ -107,12 +107,12 @@ open class DatePickerDialog: UIView { guard let appDelegate = UIApplication.shared.delegate else { fatalError() } guard let window = appDelegate.window else { fatalError() } window?.addSubview(self) - window?.bringSubview(toFront: self) + window?.bringSubviewToFront(self) window?.endEditing(true) NotificationCenter.default.addObserver(self, selector: .deviceOrientationDidChange, - name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil) + name: UIDevice.orientationDidChangeNotification, object: nil) /* Anim */ UIView.animate( From d1389e0ea247b2e421817c08dfd6d6ab73c03d7d Mon Sep 17 00:00:00 2001 From: Andre Nguyen Date: Mon, 8 Jul 2019 13:36:36 +0200 Subject: [PATCH 5/8] use swift 4.2 --- DatePickerDialog.xcodeproj/project.pbxproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DatePickerDialog.xcodeproj/project.pbxproj b/DatePickerDialog.xcodeproj/project.pbxproj index b9e981f..0478696 100644 --- a/DatePickerDialog.xcodeproj/project.pbxproj +++ b/DatePickerDialog.xcodeproj/project.pbxproj @@ -230,6 +230,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -471,7 +472,7 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -492,7 +493,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; From 3ddd58c89cf70a75c346cdfbfb1a5fcfbfa4956d Mon Sep 17 00:00:00 2001 From: Andre Nguyen Date: Tue, 16 Jul 2019 11:28:54 +0200 Subject: [PATCH 6/8] update deployment target and swift version --- DatePickerDialog.xcodeproj/project.pbxproj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DatePickerDialog.xcodeproj/project.pbxproj b/DatePickerDialog.xcodeproj/project.pbxproj index 0478696..df19b77 100644 --- a/DatePickerDialog.xcodeproj/project.pbxproj +++ b/DatePickerDialog.xcodeproj/project.pbxproj @@ -459,13 +459,14 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; + COPY_PHASE_STRIP = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = squimer.DatePickerDialog; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -481,13 +482,14 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; + COPY_PHASE_STRIP = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Sources/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = squimer.DatePickerDialog; PRODUCT_NAME = "$(TARGET_NAME)"; From 94f1059757f06e464a7c369b4f705da794eee99b Mon Sep 17 00:00:00 2001 From: Andre Nguyen Date: Thu, 28 May 2020 14:50:49 +0200 Subject: [PATCH 7/8] update swift 5 --- DatePickerDialog.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DatePickerDialog.xcodeproj/project.pbxproj b/DatePickerDialog.xcodeproj/project.pbxproj index df19b77..3bd1035 100644 --- a/DatePickerDialog.xcodeproj/project.pbxproj +++ b/DatePickerDialog.xcodeproj/project.pbxproj @@ -473,7 +473,7 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -495,7 +495,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; From 1cf7aaec3ebef49ffdd89f1d41bd244644fd9c3c Mon Sep 17 00:00:00 2001 From: Andre Nguyen Date: Thu, 17 Sep 2020 21:42:54 +0200 Subject: [PATCH 8/8] Update project.pbxproj update to swift 5.3 --- DatePickerDialog.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DatePickerDialog.xcodeproj/project.pbxproj b/DatePickerDialog.xcodeproj/project.pbxproj index 3bd1035..ae7e355 100644 --- a/DatePickerDialog.xcodeproj/project.pbxproj +++ b/DatePickerDialog.xcodeproj/project.pbxproj @@ -473,7 +473,7 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 5.3; }; name = Debug; }; @@ -495,7 +495,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 5.0; + SWIFT_VERSION = 5.3; }; name = Release; };