An auto growing text input bar for messaging apps.

Overview

ALTextInputBar

An auto growing text input bar for messaging apps. Written in Swift.
ALTextInputBar is designed to solve a few issues that folks usually encounter when building messaging apps.

With some text With lots of text

Features

  • Simple to use and configure
  • Automatic resizing based on content
  • Interactive dismiss gesture support

Installation & Requirements

This project requires Xcode 8.0 to run and compiles with swift 3.0

ALTextInputBar is available on CocoaPods. Add the following to your Podfile:

pod 'ALTextInputBar'

Usage

This is the minimum configuration required to attach an input bar to the keyboard.

class ViewController: UIViewController {

    let textInputBar = ALTextInputBar()

    // The magic sauce
    // This is how we attach the input bar to the keyboard
    override var inputAccessoryView: UIView? {
        get {
            return textInputBar
        }
    }

    // Another ingredient in the magic sauce
    override var canBecomeFirstResponder: Bool {
        return true
    }
}

License

ALTextInputBar is available under the MIT license. See the LICENSE file for more info.

Comments
  • Removing left (or right) view when set

    Removing left (or right) view when set

    When changing either the left or right view we currently need to write:

    leftView = nil
    leftView = view
    

    It would be nice if we can simply write:

    leftView = view
    

    What do you think about this?

    I also took the liberty to updated the Example using Swift 3.0 and Xcode 8.

    enhancement 
    opened by ghost 2
  • Update textView properties on didSet

    Update textView properties on didSet

    Several textView properties are not updating properly, because they are only read at initialization (and it's impossible to set them before the view is initialized).

    This PR updates these properties to set themselves in didSet, so they will work as expected.

    Resolves issue #25.

    opened by robtimp 2
  • Update textView properties with didSet

    Update textView properties with didSet

    Several textView properties are not updating properly, because they are only read at initialization (and it's impossible to set them before the view is initialized).

    This PR updates these properties to set themselves in didSet, so they will work as expected.

    opened by robtimp 2
  • Fixed incorrect calculation in roundHeight method.

    Fixed incorrect calculation in roundHeight method.

    The calculation below which is found in the roundHeight() method of ALTextView seems to be incorrect. It should be using textContainerInset.right property instead of textContainerInset.bottom to calculate width for the bounding size.

    let boundingSize = CGSize(width: frame.size.width - textContainerInset.left - textContainerInset.bottom, height: .greatestFiniteMagnitude)
    
    opened by leedsalex 1
  • Make ALTextInputBarDelegate identical to UITextViewDelegate

    Make ALTextInputBarDelegate identical to UITextViewDelegate

    Hello Alex,

    I remove the ALTextInputBarDelegate's textViewShouldReturn method and replaced it with the textView(_:shouldChangeTextInRange:replacementText:) as to reflect the UITextViewDelegate.

    I have thought about a solution to not break code that already use the ALTextInputBar library but nothing came to my mind that seemed correct. One could call both the textViewShouldReturn and the textView(_:shouldChangeTextInRange:replacementText:) but this leaves the question which of the delegate methods is given priority in the case that one returns false and the other true.

    Kind regards, Jessy

    opened by ghost 0
  • Xcode 10 / Swift 4.2 upgrade.

    Xcode 10 / Swift 4.2 upgrade.

    This PR:

    1. Updates to Xcode 10 / Swift 4.2 compatibility.
    2. Removes 3 core library source files from the testing target. Those files were likely added on accident, but it was preventing compilation of the test target. Those files will be imported into the test target like any other library.
    opened by bclymer 0
Releases(1.1.1)
Owner
Alex Littlejohn
iOS Developer/Swiftier/Schwifty
Alex Littlejohn
VKPinCodeView is simple and elegant UI component for input PIN. You can easily customise appearance and get auto fill (OTP) iOS 12 feature right from the box.

Features Variable PIN length Underline, border and custom styles The error status with / without shake animation Resetting the error status manually,

Vladimir Kokhanevich 95 Nov 24, 2022
An auto-layout base UITextView subclass which automatically grows with user input and can be constrained by maximal and minimal height - all without a single line of code

Deprecated This library is no longer maintained and is deprecated. The repository might be removed at any point in the future. MBAutoGrowingTextView A

Matej Balantič 125 Jan 13, 2022
📝 The next in the generations of 'growing textviews' optimized for iOS 8 and above.

NextGrowingTextView The next in the generations of 'growing textviews' optimized for iOS 8 and above. As a successor to HPGrowingTextView, NextGrowing

Muukii 1.7k Dec 25, 2022
Transition from any SwiftUI Text view into an inline navigation bar title when the view is scrolled off-screen, as seen in Apple's TV & TestFlight iOS apps.

SwiftUI Matched Inline Title Transition from any SwiftUI Text view into an inline navigation bar title when the view is scrolled off-screen, as seen i

Seb Jachec 19 Oct 9, 2022
The famous iOS search bar with auto completion feature implemented.

PRESENTATION This search bar will allow you to offer suggestions words to your users when they are looking for something using default iOS search bar.

Boisney Philippe 182 Dec 23, 2022
VMaskTextField is a library which create an input mask for iOS.

VMaskTextField An inputmask helps the user with the input by ensuring a predefined format. This can be useful for dates, numerics, phone numbers etc U

Vinícius Oliveira 384 Jul 20, 2022
A Float Input View with smooth animation and supporting icon and seperator written with Swift

RSFloatInputView Features Smooth animation using CoreText Support optional left icon Support optional seperator Configurable padding, size, fonts and

null 103 Nov 13, 2022
UITextField-based control for (NS)Measurement values input.

MeasurementTextField UITextField-based control for (NS)Measurement values input. Provides type-safe keyboard and picker based input of different measu

Siarhei Fiedartsou 16 Jul 22, 2021
A simple and easily customizable InputAccessoryView for making powerful input bars with autocomplete and attachments

InputBarAccessoryView Features Autocomplete text with @mention, #hashtag or any other prefix A self-sizing UITextView with an optional fixed height (c

Nathan Tannar 968 Jan 2, 2023
Provides a SwiftUI multi-line TextView implementation including support for auto-sizing. (iOS)

TextView Also available as a part of my SwiftUI+ Collection – just add it to Xcode 13+ Provides a SwiftUI multi-line TextView implementation with supp

SwiftUI+ 51 Jan 3, 2023
AEOTPTextField - A beautiful iOS OTP Text Field library, written in Swift with full access customization in UI.

AEOTPTextField - A beautiful iOS OTP Text Field library, written in Swift with full access customization in UI.

Abdelrhman Kamal 79 Jan 3, 2023
A beautiful and flexible text field control implementation of "Float Label Pattern". Written in Swift.

SkyFloatingLabelTextField SkyFloatingLabelTextField is a beautiful, flexible and customizable implementation of the space saving "Float Label Pattern"

Skyscanner 4k Jan 1, 2023
SwiftUI TextEdit View - A proof-of-concept text edit component in SwiftUI & CoreText.

A proof-of-concept text edit component in SwiftUI & CoreText. No UIKit, No AppKit, no UITextView/NSTextView/UITextField involved.

Marcin Krzyzanowski 80 Dec 1, 2022
A SwiftUI TextField with a prompt (or placeholder) that floats above the text field when active or not empty. Requires iOS 15.

FloatingPromptTextField A prompt is the label in a text field that informs the user about the kind of content the text field expects. In a default Tex

Emilio Peláez 43 Nov 3, 2022
Render Markdown text in SwiftUI

MarkdownUI MarkdownUI is a library for rendering Markdown in SwiftUI, fully compliant with the CommonMark Spec. Supported Platforms You can use the Ma

Guille Gonzalez 916 Jan 8, 2023
Focus text field in SwiftUI dynamically and progress through form using iOS keyboard.

Focuser Focuser allows to focus SwiftUI text fields dynamically and implements ability move go through the form using Keyboard for iOS 13 and iOS 14.

Art Technologies 118 Dec 25, 2022
Autocomplete for a text field in SwiftUI using async/await

Autocomplete for a text field in SwiftUI using async/await

Dmytro Anokhin 13 Oct 21, 2022
Currency text field formatter available for UIKit and SwiftUI 💶✏️

CurrencyText provides lightweight libraries for formating text field text as currency, available for both UIKit and SwiftUI. Its main core, the Curren

Felipe Lefèvre Marino 183 Dec 15, 2022
ExpandableText 😎 (SwiftUI) Expand the text with the "more" button

ExpandableText ?? (SwiftUI) Expand the text with the "more" button Get Started import SwiftUI import ExpandableText struct ExpandableText_Test: View

null 35 Dec 26, 2022