Giter Club home page Giter Club logo

nextgrowingtextview's Introduction

NextGrowingTextView

Version Carthage compatible License Platform FOSSA Status

The next in the generations of 'growing textviews' optimized for iOS 8 and above.

example1

As a successor to HPGrowingTextView, NextGrowingTextView was redesigned from scratch to provide the most elegant architecture for iOS 8 and above.

Most autoresizing textviews are implemented with UITextView subclasses. The problem with that approach is that each iOS version changed UITextView's layout behavior, and so most of the implementations are laden with iOS version-specific workarounds to fix bugs and errant behavior. With NextGrowingTextView, the battle with the framework is now over.

NextGrowingTextView approaches the problem differently by wrapping UITextView within a UIScrollView and aligning the textView to the scrollView's contentSize.

- public NextGrowingTextView: UIScrollView
    - internal NextGrowingInternalTextView: UITextView

๐Ÿ’ก
You want also to need to display a user-interface on top of the keyboard?
muukii/Bureau enables you to show your user-interface on top of the keyboard in the easiest way.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Properties

public class Delegates {
  public var willChangeHeight: (CGFloat) -> Void
  public var didChangeHeight: (CGFloat) -> Void
}

public var delegates: Delegates
public override init(frame: CGRect)

Use isFlashScrollIndicatorsEnabled to enable/disable flash scroll indicators while text view height is less than max height.

Delegates

let growingTextView: NextGrowingTextView

growingTextView.delegates.didChangeHeight = { [weak self] height in
  guard let `self` = self else { return }
  // Do something
}

Requirements

iOS 9.0+ Swift 4.2+

Installation

CocoaPods

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

$ gem install cocoapods

CocoaPods 0.39.0+ is required to build NextGrowingTextView

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

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

pod 'NextGrowingTextView'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate NextGrowingTextView into your Xcode project using Carthage, specify it in your Cartfile:

github "muukii/NextGrowingTextView"

Run carthage update to build the framework and drag the built NextGrowingTextView.framework into your Xcode project.

Author

muukii, [email protected]

License

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

FOSSA Status

nextgrowingtextview's People

Contributors

muukii avatar uplikevincent avatar mlight3 avatar simonbs avatar ntnmrndn avatar haowenwu avatar ximximik avatar menayousif avatar hiromi2424 avatar fossabot avatar helptan avatar takumatt avatar shima11 avatar philippeauriach avatar akhrameev avatar pinda avatar igorkulman avatar gokhanakkurt avatar blackjacx 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.