Giter VIP home page Giter VIP logo

searchtextfield's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

searchtextfield's Issues

Suggestions do not show up in Simulator

Inline suggestions work fine, but the dropdown does not work in the simulator.
Attached is a screenshot of the example app running on Simulator (iPhone 6 iOS 10.3)

simulator screen shot jul 28 2017 11 25 10 am

SearchTextField becomeFirstResponder() does not work

Hi !
I have an issue with a SearchTextField.

My ViewController contains 2 IBOutlets:

  • a standard UITextField (mailTextField)
  • a SearchTextField (schoolTextField)

When I press return when editing the first textField, I want the SearchTextField to become the first responder.

Here is my code:

        
        if textField == mailTextField {
            
            guard (mailTextField.text?.isValidEmail) == true else {
                self.mailTextField.resignFirstResponder()
                displayAlert(title: "Erreur", message: "L'adresse e-mail saisie ne semble pas valide")
                return false
            }
            
            if school == nil {
                self.schoolTextField.becomeFirstResponder()
            } else {
                self.mailTextField.resignFirstResponder()
            }
            
        } else if textField == schoolTextField {
            self.schoolTextField.resignFirstResponder()
        }
        return true
    }

So, when self.schoolTextField.becomeFirstResponder() is called, this SearchTextField should become the first responder and begin editing.
I debugged and put a few prints. What happens is that the SearchTextField actually becomes the first responder (didBeginEditing is called), but then resignFirstResponder() is called on it (not by anything in my VC, I removed everything to make sure of that). And then didEndEditing is called on it.

In viewDidAppear, if I put self.schoolTextField.becomeFirstResponder(), it works perfectly ...
Also, if the SearchTextField is the first responder and then in textFieldShouldReturn, I put self.mailTextField.becomeFirstResponder(), it also works perfectly.

Apparently, the problem appears when having a standard UITextField as the first reponder and calling becomeFirstResponder() on the SearchTextField.

Thanks for your help.

Get the filtered results

Is there a way to get filtered results?
In the itemSelectionHandler, I get position and item. But the position is as per the filtered list & not the original list. Here filtered list means the list which is formed after the user enters a character on the textfield and original list means the list of items supplied to the textfield for filtering.

Please help with the above issue.

[Feature Request] Carthage Support

It would be nice to import this as a framework with Carthage, because this is a good, regularly updated project and not everyone is using CocoaPods or likes manually integrating it.

Suggestions not showing at all!

I downloaded the example project, and the country and acronym suggestions are not showing at all.
Only the inline suggestions are working. Maybe you messed the working part when you added the inline feature
Your project is really cool, I would really like to use it, so if you could please look into it.
Thanks in advance

Suggestions Appear below the keyboard? ... and adjustment of the view due to keyboardWill Show is reset

first of all I thank you for that library it is a must have one. However, I have two issues with the library and they are as follows:
1st:
the suggestions table appear below the keyboard... but since the text field is nearly in the lower middle I prefer to show the table above the textField
2nd:
since I want the user to see the contents while typing I shift the textField view upwards... and it remains there until a choice from the suggestions table is Made.. the shifted view is reset to its original place behind the keyboard
3rd:
I know I only said 2, but can I have the option to resize the suggestion table width (not by resizing the textField itself)

One Last Comment: in the inline Mode: How can I accept the text without writing all of it

Custom Search Result Cell?

Your library is exactly what I need, however, is there a way to specify a custom table cell to be used as a search result? I want to customize the UI of the result a bit more than what is standard (more than just title, subtitle, image, etc.)

Adjusting the width?

Is there a way to adjust the auto-complete suggestion list? I tried setting the size when I create the object with CGRect but it didn't work.

[Feature] highlight all occurrence in result list

Hi,

do you know if it's possible to add highlight (set pattern search bold in result list) on all occurrence of the pattern in each line string ?

example :

  • user search for 'es'
  • in list we have : 'test', 'test test'
  • Each 'es' are highlighted

Regards,

S0r4

results appearing if I set text on textfield

If I programmatically set the text on the text field, I am finding that the filtered list of matching results appear below the text field.

Is there a way to stop the list appearing when text is set programmatically?

ps love the control - and great work.

Dropdown not appearing on newest version

Hey great framework here. I was testing the version you released yesterday. The dropdown with options does not seem to appear anymore. I implemented the simple example and also pulled down and ran your example project and no dice. The new feature "show the first matched result as placeholder (inline mode)" works great though.

Could not change theme font

In SearchTextFieldTheme we can't set custom font
For example when I use UIFont(name: "BNazanin", size: 10)! in init of SearchTextFieldTheme the tableview does not appear for suggestion

received thread error EXC_BAD_ACCESS

to reproduce:

opened new Xcode project
installed pod ver 1.0.10

code in view controller:

import UIKit
import SearchTextField

class ViewController: UIViewController {

@IBOutlet weak var mySearchTextField: SearchTextField!


override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
    
   
    
    // Set the array of strings you want to suggest
    mySearchTextField.filterStrings(["Red", "Blue", "Yellow"])
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

}

Hide keyboard but show list

Hello guys and thanks for your work...

I need to doesn't´t show the keyboard ontap, so only display the list... I try it delegating

extension X: UITextFieldDelegate {
func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
return false
}

but doesn't works, just no appear nothing, no list (startvisible = true)

Any idea? Thanks!

property placeholder textColor

How to change the placeholder property textColor of the placeholder if it is as fileprivate, this requires it to change the color of the field when I make field validations.

Results showing up under other controls

I have a TableView with multiple rows and when I have your control in one of the rows and the suggestions come up it displays under the other rows thus making it not viewable. Do you have any suggestions to fix this. I have tried to bring the subview to the front but that does not work and I also tried setting the zPosition of the control higher than others and it still seems to not work.

[feature request] Adding a delimiter character

It would be great to be able to make the list only activate when a certain character is typed, say the "@" character. I realize this is a bit of a deviation from the original goal of the code.

Manually add file, syntax errors

Hi,

Has anyone by any chance , had seen errors for the SearchTextField.swift errors.
When i drag to project, it gives me syntax errors of the file. ANy help would be really appreciated.

font style not working properly issue

had modify the font size to 18 by using. "emailTextField.theme.font = UIFont.systemFont(ofSize: 18)". The suggestion character which consists in my emailtextfield still remain the default size while other character become 18.

change height of search TableView

Hi, is there a way to change the height of the search tableview? So that i can put it in a tableviewcell and it is contained by the cell height?

right to left support

I want the list of countries to appear from right to left.
How would /i go about to do that?

thanks

Hit Return Key when textfield is not empty will clear the content of the textfield

If I am typing with the tableview showing, the first filtered result will be chosen and put into the textfield if I hit return key. However, if I click the textfield again without typing and hit the return key. Since there are no filtered results, the following method will produce empty string and the existing content of the textfield will be cleared.

open func textFieldDidEndEditingOnExit() {
        self.text = filteredResults.first?.title
}

Simple search not working after 'pod install' in XCode 8

Simple search with the distro that came after Pod install does not work (Xcode 8.3.3 (8E3004b) :

...
Installing SearchTextField (1.1.4)

**
// Connect your IBOutlet...
@IBOutlet weak var mySearchTextField: SearchTextField!

// Set the array of strings you want to suggest
mySearchTextField.filterStrings(["Red", "Blue", "Yellow"])

**

The only way I could make this work was by copying the class from the example project directly into my project, under Pods/SeachTextField.

I see that the latest version is 1.1.6, but 'pod install' downloads 1.1.4, not sure why.

Multi Search in text

Hi,
actually this is a good component and it's very needed. good job. but when I used it in my application I used it to Seach in contact list and it's working fine as I mentioned in First image, BUT when I'm trying to Seach on another name it's not working as I mentioned in Second image. So can I use this to search in more one like in my application I'm trying to add users to to send mail to them so I need to add for ex 3 users. please advise and thanks for your support

first search
second search

Proposals disappearing right away (the second time searchTF is used)

The first time I use the searchTextField, the proposals are displayed nicely
simulator screen shot 6 mars 2017 a 18 04 39

But the second time I display the searchTF, the proposals appear, and then disappear right away before I have time to select an entry.
simulator screen shot 6 mars 2017 a 18 05 08

Maybe an issue with userStoppedTypingHandler ?
This didn't happen in release 1.0.4, then I upgraded to 1.0.9 and the issue appeared.

Thanks !

Nothing get selected while using gesture recogniser ?

In View Controller :

viewDidLoad()
{
                    self.ClientList.itemSelectionHandler = {item in
                        let title = item.title
                        print("Title Name of List = "+title)
                        self.ClientList.text=title
                        self.view.endEditing(true)

                    }
self.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: 
Selector("dismissKeyboard")))
}

    func dismissKeyboard()
    {
        ClientList.resignFirstResponder()
        self.view.endEditing(true)

    }

FilterItems frame not changing when scrolling

I have put SearchTextField in a UIScrollVeiw. but the problem is when scroll view scrolling FilterItems frame not changing. it works when I reset text in scrollViewDidScroll.

func scrollViewDidScroll(_ scrollView: UIScrollView) {
acronymTextField.text = acronymTextField.text // hack for move filter screen with textfield when scrolling
}

img_8495

Suggestion: when startVisible=true, show full list if user clears the field

I have been playing with your code, which works fantastic by the way.

I really want my users to choose from a list, but I want them to be able to override if they really need to, and filter quickly. So, I load up a large list of options and use startVisible=true and all is grand.

However, if they type a few things and then erase back to blank, your current implementation does not reload the list.

Just needed to make 1 small change to make this work:

if text!.isEmpty {
            clearResults()
            tableView?.reloadData()
            self.placeholderLabel?.text = ""
        }

Change to:

if text!.isEmpty {
            clearResults()
            tableView?.reloadData()
            filter(true)
            self.placeholderLabel?.text = ""
        }

I'm not sure if this creates other problems, but it seems to work for me!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.