Giter Site home page Giter Site logo

coderxapp / nextgrowingtextview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fluidgroup/nextgrowingtextview

1.0 2.0 0.0 7.76 MB

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

License: MIT License

Ruby 5.60% Swift 89.56% Objective-C 4.84%

nextgrowingtextview's Introduction

NextGrowingTextView

CI Status Version Carthage compatible License Platform

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

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)

Delegates

let growingTextView: NextGrowingTextView

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

Requirements

iOS 8.0+ Swift 4

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.

nextgrowingtextview's People

Contributors

muukii avatar uplikevincent avatar mlight3 avatar simonbs avatar blackjacx avatar gokhanakkurt avatar pinda avatar philippeauriach avatar helptan avatar hiromi2424 avatar ximximik avatar haowenwu avatar

Stargazers

 avatar

Watchers

James Cloos avatar ZHOU DENGFENG 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.