Giter Site home page Giter Site logo

furkanvijapura / vpautocomplete Goto Github PK

View Code? Open in Web Editor NEW

This project forked from insideapple/vpautocomplete

1.0 1.0 0.0 201 KB

A simple Auto Complete UITextField also support UITableView written in swift 4.2

License: MIT License

Ruby 1.96% Swift 98.04%

vpautocomplete's Introduction

VPAutoComplete

VPAutoComplete is Autocomplete for textField It is written in swift 4 and support UITableView

Demo

Project containing Example for implemented it in ViewController and UITableView. I used IQKeyBoardManager for working with scroll as well

Requirment

Xcode 9 and iOS 11.0 Code is written in swift 4.2

Example

A step by step series of examples that tell you have to get a development env running

For UIViewController

        let dropDown = VPAutoComplete()
        dropDown.dataSource = ["Data 1", "Data 2", "Data 3"]
        dropDown.onTextField = textField // Your TextField
        dropDown.onView = self.view // ViewController's View
        //        dropDownTop.showAlwaysOnTop = true //To show dropdown always on top.
        dropDown.show { (str, index) in
            print("string : \(str) and Index : \(index)")
            self.textField.text = str
        }

Quick Run

         _ = VPAutoComplete.init(onTextField: textField, dataSource: ["Data 1", "Data 2", "Data 3"], onView: self.view, completionHandler: { (str, index) in
         print("string : \(str) and Index : \(index)")
         self.textField.text = str
         })

For UITableView in cellForRowAt

        let dropDown = VPAutoComplete()
        dropDown.dataSource = ["One", "Two", "Three","Foure"]
        dropDown.onTextField = cell.textField // Your TextField 
        dropDown.isSearchBig = false // High Light search Text
        dropDown.show(onTableView: tableView, atIndexPath: indexPath) { (str, index) in
            cell.textField = str
        }
        

Installation

Copy VPAutoComplete-Source folder in Your project and start using

Authors

  • Vivek Padaya

License

This project is licensed under the MIT License - see the LICENSE.md file for details

vpautocomplete's People

Contributors

insideapple avatar

Stargazers

FURKAN VIJAPURA avatar

Watchers

James Cloos avatar

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.