ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - nathantannar4/InputBarAccessoryView: A simple and easily customizable InputAccessoryView for making powerful input bars with autocomplete and attachments
A simple and easily customizable InputAccessoryView for making powerful input bars with autocomplete and attachments - nathantannar4/InputBarAccessoryView
Visit Site

GitHub - nathantannar4/InputBarAccessoryView: A simple and easily customizable InputAccessoryView for making powerful input bars with autocomplete and attachments

GitHub - nathantannar4/InputBarAccessoryView: A simple and easily customizable InputAccessoryView for making powerful input bars with autocomplete and attachments

Image

InputBarAccessoryView

Features

  • Autocomplete text with @mention, #hashtag or any other prefix
  • A self-sizing UITextView with an optional fixed height (can be replaced with any other view)
  • Image paste support
  • Autocomplete attributed text highlighting
  • Reactive components that respond to given events
  • Top/Bottom/Left/Right InputStackViews that act as toolbars to place buttons
  • Drop in attachment view for file/photo management
  • Plugin support for your own InputPlugins
  • Compatible with all iPhones and iPads
  • RTL Support

Installation via Swift Package Manager (SPM)

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. Once you have your Swift package set up, adding InputBarAccessoryView as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/nathantannar4/InputBarAccessoryView.git", .upToNextMajor(from: "6.0.0"))
]

You can also add it via Xcode SPM editor with URL:

https://github.com/nathantannar4/InputBarAccessoryView.git

Requirements

iOS 14.0+ Swift 6

The latest iOS 13 release is v6.5.1

The latest iOS 12 release is v5.5.0

CocoaPods and RxExtensions were removed in 6.0.0

The latest iOS 11 release is v5.1.0

The latest Swift 5.0 release is v5.1.0

The latest Swift 4.2 release is v4.2.2

Documentation

Getting Started

See the Example project to see how you can make the iMessage, Slack, Facebook and GitHawk input bars!

Example Usage

Featured In

Add your app to the list of apps using this library and make a pull request.

See Also

iMessage style TypingIndicator for chat apps

Latest Releases

7.0.0

  • Breaking change: Drop iOS 13 support
  • Breaking change: Move to Swift 6, fully support Swift concurrency

6.5.0

  • Bump Swift version to 5.10
  • Perform layout changes on main thread

6.4.0

  • Fixed bottom gap calculations for embedded controllers

6.3.0

  • Fixed the gap between keyboard and input bar when used on pagesheet/formsheet on iPad
  • Fixed crash after adding image attachment

6.2.0

  • Remove canBecomeFirstResponder on InputTextView to fix UITextViewDelegate methods not being called

6.1.1

  • Fixed warning for Xcode 14

6.1.0

  • #230 Added additionalInputViewBottomConstraintConstant to KeyboardManager as a way for providing additional bottom constraint constant offset for inputAccessoryView. Example implementation can be found in AdditionalBottomSpaceExampleViewController

6.0.0

  • Breaking change: Drop iOS 12 support
  • Breaking change: Drop CocoaPods support & RxSwift extension (it was available only via CocoaPods)
  • KeyboardManager will not update position of inputAccessoryView from interactive dismiss panGesture when the keyboard is floating
  • Update docs

See CHANGELOG for more details and older releases.

Find a bug? Open an issue!

Layout

The layout of the InputBarAccessoryView is made of of 4 InputStackView's and an InputTextView. The padding of the subviews can be easily adjusted by changing the padding and textViewPadding properties. The constraints will automatically be updated.

It is important to note that each of the InputStackView 's to the left and right of the InputTextView are anchored by a width constraint. This way the InputTextView will always fill the space inbetween in addition to providing methods that can easily be called to hide all buttons to the right or left of the InputTextView by setting the width constraint constant to 0. The bottom and top stack views are not height constraint and rely on their intrinsicContentSize

func setLeftStackViewWidthConstant(to newValue: CGFloat, animated: Bool)

func setRightStackViewWidthConstant(to newValue: CGFloat, animated: Bool)

Reactive Hooks

Each InputBarButtonItem has properties that can hold actions that will be executed during various hooks such as the button being touched, the UITextView text changing and more! Thanks to these easy hooks with a few lines of code the items can be easily resized and animated similar to that of the Facebook messenger app.

// MARK: - Hooks
    
public typealias InputBarButtonItemAction = ((InputBarButtonItem) -> Void)    
    
private var onTouchUpInsideAction: InputBarButtonItemAction?
private var onKeyboardEditingBeginsAction: InputBarButtonItemAction?
private var onKeyboardEditingEndsAction: InputBarButtonItemAction?
private var onKeyboardSwipeGestureAction: ((InputBarButtonItem, UISwipeGestureRecognizer) -> Void)?
private var onTextViewDidChangeAction: ((InputBarButtonItem, InputTextView) -> Void)?
private var onSelectedAction: InputBarButtonItemAction?
private var onDeselectedAction: InputBarButtonItemAction?
private var onEnabledAction: InputBarButtonItemAction?
private var onDisabledAction: InputBarButtonItemAction?

Author

Nathan Tannar - https://nathantannar.me Jakub Kaspar - https://jakubkaspar.dev

License

Distributed under the MIT license. See LICENSE for more information.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory