Skip to content

Commit

Permalink
-- fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaibrahim989 committed Oct 28, 2016
1 parent 0c17a4b commit d636c16
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/MICountryPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ open class MICountryPicker: UITableViewController {
extension MICountryPicker {

override open func numberOfSections(in tableView: UITableView) -> Int {
if searchController.searchBar.isFirstResponder {
if searchController.searchBar.text!.characters.count > 0 {
return 1
}
return sections.count
}

override open func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if searchController.searchBar.isFirstResponder {
if searchController.searchBar.text!.characters.count > 0 {
return filteredList.count
}
return sections[section].countries.count
Expand All @@ -179,7 +179,7 @@ extension MICountryPicker {
let cell: UITableViewCell! = tempCell

let country: MICountry!
if searchController.searchBar.isFirstResponder {
if searchController.searchBar.text!.characters.count > 0 {
country = filteredList[(indexPath as NSIndexPath).row]
} else {
country = sections[(indexPath as NSIndexPath).section].countries[(indexPath as NSIndexPath).row]
Expand Down

0 comments on commit d636c16

Please sign in to comment.