From b463eb995bc0f69b704c9dcbdbeeb1c2614cd460 Mon Sep 17 00:00:00 2001 From: Jishnu Raj T <38908155+jriosdev@users.noreply.github.com> Date: Thu, 26 May 2022 18:41:16 +0530 Subject: [PATCH 1/5] Swift Packages Update Swift Packages Update --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index cf82706..888baad 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,19 @@ To run the example project, clone the repo, and run `pod install` from the Examp 4. Change the maximum height of the List and the height of each Row ## Installation + +### Swift Package Manager + +The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. + +Once you have your Swift package set up, adding iOSDropDown as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. + +```swift +dependencies: [ + .package(url: "https://github.com/jriosdev/iOSDropDown.git", .upToNextMajor(from: "0.4.0")) +] +``` + ### CocoaPods Use [CocoaPods](http://www.cocoapods.org). From 895593ac8d7f1683f8c4fa54c19ff80af4b9a2bd Mon Sep 17 00:00:00 2001 From: Jishnu Raj T <38908155+jriosdev@users.noreply.github.com> Date: Mon, 30 May 2022 11:31:34 +0530 Subject: [PATCH 2/5] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 888baad..9a82180 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,16 @@ Closures //You can Do anything when iOS DropDown listDidDisappear } ``` + + Custom filter fuction + + ```swift + // overridable function for filter action + + func searchFilter(text: String, searchText: String) -> Bool { + // you can add custom filter fuctions as your need, like other than english ..etc + } + ``` ## Customizes iOSDropDown 🖌 From 79970152b7873100308aba95ede0f18d313683b9 Mon Sep 17 00:00:00 2001 From: Jishnu Raj T <38908155+jriosdev@users.noreply.github.com> Date: Sat, 16 Jul 2022 16:31:12 +0530 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a82180..4473a66 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Watch Video on : [![](https://raw.githubusercontent.com/jriosdev/iOSDropDown/master/images/1.gif)](images/1.gif) ### Customizing [![](https://raw.githubusercontent.com/jriosdev/iOSDropDown/master/images/2.gif)](images/2.gif) -### hideOptionWhenSelect = false + From 3d680602c3bd721738ed404c154efe2ee35a9ed8 Mon Sep 17 00:00:00 2001 From: Rahul Roy <64432712+Roy0Anonymous@users.noreply.github.com> Date: Wed, 11 Jan 2023 06:18:26 +0530 Subject: [PATCH 4/5] Added Enable and Disable Arrow Functions --- Classes/iOSDropDown.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Classes/iOSDropDown.swift b/Classes/iOSDropDown.swift index e71f9af..79d45d5 100644 --- a/Classes/iOSDropDown.swift +++ b/Classes/iOSDropDown.swift @@ -338,6 +338,14 @@ open class DropDown : UITextField{ public func listDidDisappear(completion: @escaping () -> ()) { TableDidDisappearCompletion = completion } + + public func enableArrow() { + self.rightViewMode = .always + } + + public func disableArrow() { + self.rightViewMode = .never + } } From 67ef8865e419276b736966f54e8f3ed7453d3927 Mon Sep 17 00:00:00 2001 From: Prakash Rautela Date: Tue, 6 Jun 2023 12:11:55 +0530 Subject: [PATCH 5/5] Selection Issue For Searched Text --- iOSDropDown/Classes/iOSDropDown.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iOSDropDown/Classes/iOSDropDown.swift b/iOSDropDown/Classes/iOSDropDown.swift index 3e2a177..126ef3b 100644 --- a/iOSDropDown/Classes/iOSDropDown.swift +++ b/iOSDropDown/Classes/iOSDropDown.swift @@ -428,8 +428,11 @@ extension DropDown: UITableViewDataSource { extension DropDown: UITableViewDelegate { public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - selectedIndex = (indexPath as NSIndexPath).row - let selectedText = dataArray[selectedIndex!] + + let currentIndex = (indexPath as NSIndexPath).row + let selectedText = dataArray[currentIndex] + selectedIndex = isSearchEnable ? (optionArray.firstIndex(of: selectedText) ?? currentIndex) : currentIndex // Correct Index For Searched Text + tableView.cellForRow(at: indexPath)?.alpha = 0 UIView.animate(withDuration: 0.5, animations: { () -> Void in