Latest 1.0
Homepage https://github.com/matteogobbi/MGTextView
License MIT
Platforms ios 6.0, requires ARC
Frameworks UIKit
Authors

MGTextView extends UITextView fixing the Apple bugs and offering a couple of useful functionalities.

In details the 2 bugs it goes to fix are:

  1. Wrong content size: when the contentSize change, it is reculated in the right way;
  2. Wrong scroll (first line cut) when a new line is inserted.

Moreover it offers:

  • Possibility to remove extra spaces like left padding and top/bottom margin (insets) often not used and useless;
  • Possibility to have an auto resizable height, while the user is inserting text.

Info

This code must be used under ARC.
If your code doesn’t use ARC you can mark this source with the compiler flag -fobjc-arc

Example Usage

In the package is included an example to use this class.

Quick usage:

MGTextView *textView = [[MGTextView alloc] initWithFrame:(CGRect){{20.f, 100.f}, {150.f, 60.f}}];
textView.delegate = self;

[self.view addSubview:textView];

Removing extra spaces:

[textView removeExtraSpaces];

Set a dynamic and auto resizable height:

textView.autoResizableHeight = YES;

Contact

Matteo Gobbi

License

MGTextView is available under the MIT license.

Latest podspec

{
    "name": "MGTextView",
    "version": "1.0",
    "summary": "MGTextView extends UITextView fixing the Apple bugs and offering a couple of useful functionalities.",
    "homepage": "https://github.com/matteogobbi/MGTextView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Matteo Gobbi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/matteogobbi/MGTextView.git",
        "tag": "1.0"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source_files": "MGTextView/*.{h,m}",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This