From 386be6be95c393e88350e4b1ed67ccead1ef90db Mon Sep 17 00:00:00 2001 From: Kevin McGill Date: Mon, 8 Apr 2019 20:01:15 -0500 Subject: [PATCH] Bug fix if empty data passed (#49) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Check if data for component is not empty * Bump patch 2.0.1 🚀 --- Example/McPicker.xcodeproj/project.pbxproj | 5 ++++- .../xcshareddata/xcschemes/McPicker-Example.xcscheme | 2 +- .../xcshareddata/xcschemes/McPicker_Tests.xcscheme | 2 +- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ McPicker.podspec | 2 +- McPicker/Classes/McPicker.swift | 2 +- 6 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 Example/McPicker.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Example/McPicker.xcodeproj/project.pbxproj b/Example/McPicker.xcodeproj/project.pbxproj index 1e73872..0acc465 100644 --- a/Example/McPicker.xcodeproj/project.pbxproj +++ b/Example/McPicker.xcodeproj/project.pbxproj @@ -212,7 +212,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = CocoaPods; TargetAttributes = { 607FACCF1AFB9204008FA782 = { @@ -231,6 +231,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -406,6 +407,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -462,6 +464,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; diff --git a/Example/McPicker.xcodeproj/xcshareddata/xcschemes/McPicker-Example.xcscheme b/Example/McPicker.xcodeproj/xcshareddata/xcschemes/McPicker-Example.xcscheme index 77c8b84..7e20a94 100644 --- a/Example/McPicker.xcodeproj/xcshareddata/xcschemes/McPicker-Example.xcscheme +++ b/Example/McPicker.xcodeproj/xcshareddata/xcschemes/McPicker-Example.xcscheme @@ -1,6 +1,6 @@ + + + + IDEDidComputeMac32BitWarning + + + diff --git a/McPicker.podspec b/McPicker.podspec index f0dca02..7b33266 100644 --- a/McPicker.podspec +++ b/McPicker.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'McPicker' - s.version = '2.0.0' + s.version = '2.0.1' s.summary = 'McPicker is a customizable, closure driven UIPickerView drop-in solution with animations that is rotation ready.' s.swift_version = '4.2' diff --git a/McPicker/Classes/McPicker.swift b/McPicker/Classes/McPicker.swift index 32396cf..37e27c3 100644 --- a/McPicker/Classes/McPicker.swift +++ b/McPicker/Classes/McPicker.swift @@ -439,7 +439,7 @@ extension McPicker : UIPickerViewDelegate { } public func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { - if component < pickerSelection.count { + if !pickerData[component].isEmpty { self.pickerSelection[component] = pickerData[component][row] self.selectionChangedHandler?(self.pickerSelection, component) }