From 610b95c7852208d51060a1d0bee4c808828a44ca Mon Sep 17 00:00:00 2001 From: Danilo Date: Mon, 5 Feb 2018 18:36:01 +0100 Subject: [PATCH] fix public declarations --- .swift-version | 1 + DPPickerManager/Class/DPPickerManager.swift | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 .swift-version diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..9f55b2c --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +3.0 diff --git a/DPPickerManager/Class/DPPickerManager.swift b/DPPickerManager/Class/DPPickerManager.swift index 203d64b..2579beb 100644 --- a/DPPickerManager/Class/DPPickerManager.swift +++ b/DPPickerManager/Class/DPPickerManager.swift @@ -8,11 +8,11 @@ import UIKit -typealias DPPickerCompletion = (_ cancel: Bool) -> Void -typealias DPPickerDateCompletion = (_ date: Date?, _ cancel: Bool) -> Void -typealias DPPickerValueIndexCompletion = (_ value: String?, _ index: Int, _ cancel: Bool) -> Void +public typealias DPPickerCompletion = (_ cancel: Bool) -> Void +public typealias DPPickerDateCompletion = (_ date: Date?, _ cancel: Bool) -> Void +public typealias DPPickerValueIndexCompletion = (_ value: String?, _ index: Int, _ cancel: Bool) -> Void -class DPPickerManager: NSObject, UIPickerViewDelegate, UIPickerViewDataSource { +public class DPPickerManager: NSObject, UIPickerViewDelegate, UIPickerViewDataSource { static let shared = DPPickerManager() @@ -139,15 +139,15 @@ class DPPickerManager: NSObject, UIPickerViewDelegate, UIPickerViewDataSource { // MARK: - Picker Delegates - internal func numberOfComponents(in pickerView: UIPickerView) -> Int { + public func numberOfComponents(in pickerView: UIPickerView) -> Int { return pickerValues?.count == 0 ? 0 : 1 } - internal func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { + public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return pickerValues?.count ?? 0 } - internal func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { + public func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { return pickerValues?[row] }