All Projects → LaurentiuUngur → Luautocompleteview

LaurentiuUngur / Luautocompleteview

Licence: mit
Highly configurable autocomplete view that is attachable to any UITextField

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Luautocompleteview

Xcode One Dark
Atom One Dark theme for Xcode
Stars: ✭ 273 (+396.36%)
Mutual labels:  xcode, cocoapods, carthage, cocoa
Restofire
Restofire is a protocol oriented networking client for Alamofire
Stars: ✭ 377 (+585.45%)
Mutual labels:  xcode, cocoapods, carthage
Swiftysound
SwiftySound is a simple library that lets you play sounds with a single line of code.
Stars: ✭ 995 (+1709.09%)
Mutual labels:  xcode, cocoapods, carthage
Swiftlyext
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types 🚀
Stars: ✭ 31 (-43.64%)
Mutual labels:  xcode, cocoapods, carthage
Maplebacon
🍁🥓 Lightweight and fast Swift library for image downloading, caching and transformations
Stars: ✭ 322 (+485.45%)
Mutual labels:  xcode, cocoapods, carthage
Tbuiautotest
Generating UI test label automatically for iOS.
Stars: ✭ 333 (+505.45%)
Mutual labels:  xcode, cocoapods, carthage
Gradientcircularprogress
Customizable progress indicator library in Swift
Stars: ✭ 407 (+640%)
Mutual labels:  xcode, cocoapods, carthage
Netfox
A lightweight, one line setup, iOS / OSX network debugging library! 🦊
Stars: ✭ 3,188 (+5696.36%)
Mutual labels:  xcode, cocoapods, carthage
Swiftinstagram
Instagram API client written in Swift
Stars: ✭ 570 (+936.36%)
Mutual labels:  xcode, cocoapods, carthage
Sidemenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.
Stars: ✭ 5,267 (+9476.36%)
Mutual labels:  xcode, cocoapods, carthage
Orsserialport
Serial port library for Objective-C and Swift macOS apps
Stars: ✭ 609 (+1007.27%)
Mutual labels:  cocoapods, carthage, cocoa
Microfeatures Guidelines
📦📝 uFeatures guidelines
Stars: ✭ 315 (+472.73%)
Mutual labels:  xcode, cocoapods, carthage
Stevia
🍃 Concise Autolayout code
Stars: ✭ 3,182 (+5685.45%)
Mutual labels:  xcode, cocoapods, carthage
Bfkit Swift
BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.
Stars: ✭ 963 (+1650.91%)
Mutual labels:  xcode, cocoapods, carthage
Anyformatkit
Simple text formatting in Swift
Stars: ✭ 296 (+438.18%)
Mutual labels:  xcode, cocoapods, carthage
Stepslider
StepSlider its custom implementation of slider such as UISlider for preset integer values.
Stars: ✭ 391 (+610.91%)
Mutual labels:  xcode, cocoapods, carthage
Swiftymessenger
Swift toolkit for passing messages between iOS apps and extensions.
Stars: ✭ 48 (-12.73%)
Mutual labels:  xcode, cocoapods, carthage
Audioindicatorbars
AIB indicates for your app users which audio is playing. Just like the Podcasts app.
Stars: ✭ 279 (+407.27%)
Mutual labels:  xcode, cocoapods, carthage
Imageloaderswift
A lightweight and fast image loader for iOS written in Swift.
Stars: ✭ 290 (+427.27%)
Mutual labels:  xcode, cocoapods, carthage
Uitextfield Navigation
🏄‍♂️ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews
Stars: ✭ 436 (+692.73%)
Mutual labels:  xcode, cocoapods, carthage

LUAutocompleteView

Easy to use and highly configurable autocomplete view that is attachable to any UITextField

Build Status Swift 5 Carthage compatible Swift Package Manager compatible Pod Version Pod Platform Pod License

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ sudo gem install cocoapods

CocoaPods 1.7.0+ is required.

To integrate LUAutocompleteView into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'LUAutocompleteView'
end

Then, run the following command:

$ pod install

Carthage

You can use Carthage to install LUAutocompleteView by adding it to your Cartfile:

github "LaurentiuUngur/LUAutocompleteView" ~> 4.0

Then run carthage update.

If this is your first time using Carthage in the project, you'll need to go through some additional steps as explained over at Carthage.

Swift Package Manager

To integrate using Apple's Swift Package Manager, add the following as a dependency to your Package.swift:

.Package(url: "https://github.com/LaurentiuUngur/LUAutocompleteView", majorVersion: 4)

Here's an example of PackageDescription:

import PackageDescription

let package = Package(name: "MyApp",
    dependencies: [
        .Package(url: "https://github.com/LaurentiuUngur/LUAutocompleteView", majorVersion: 4)
    ])

Manually

If you prefer not to use either of the before mentioned dependency managers, you can integrate LUAutocompleteView into your project manually.

Usage

  • Import LUAutocompleteView into your project.
import LUAutocompleteView
  • Assign to textField property the text field to which the autocomplete view you want be attached.
autocompleteView.textField = textField
  • Set as data source and delegate.
autocompleteView.dataSource = self
autocompleteView.delegate = self
  • Implement LUAutocompleteViewDataSource and LUAutocompleteViewDelegate protocols.
// MARK: - LUAutocompleteViewDataSource

extension ViewController: LUAutocompleteViewDataSource {
    func autocompleteView(_ autocompleteView: LUAutocompleteView, elementsFor text: String, completion: @escaping ([String]) -> Void) {
        let elementsThatMatchInput = elements.filter { $0.lowercased().contains(text.lowercased()) }
        completion(elementsThatMatchInput)
    }
}

// MARK: - LUAutocompleteViewDelegate

extension ViewController: LUAutocompleteViewDelegate {
    func autocompleteView(_ autocompleteView: LUAutocompleteView, didSelect text: String) {
        print(text + " was selected from autocomplete view")
    }
}

Customisation

  • Create your custom autocomplete cell by subclassing LUAutocompleteTableViewCell.
  • Override func set(text: String) from LUAutocompleteTableViewCell that is called every time when given text should be displayed by the cell.
import UIKit
import LUAutocompleteView

final class CustomAutocompleteTableViewCell: LUAutocompleteTableViewCell {
    // MARK: - Base Class Overrides

    override func set(text: String) {
        textLabel?.text = text
        textLabel?.textColor = .red
    }
}
  • Assign to autocompleteCell property your custom autocomplete cell.
autocompleteView.autocompleteCell = CustomAutocompleteTableViewCell.self

For more usage details please see example app

Requirements

  • Xcode 10.2+
  • Swift 5.0+
  • iOS 9.0+

Author

License

  • LUAutocompleteView is available under the MIT license.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].