Latest 0.0.4
Homepage https://github.com/apploft/APLUrlTextView
License MIT
Platforms ios 10.0, requires ARC
Authors

APLUrlTextView

A simple UITextView extensions allowing to add URLs and getting informed when the user selects one of these URLs. You can use the ‘linkTextAttributtes’ of UITextView in order to define the styling of the links being embeded.

Installation

Install via cocoapods by adding this to your Podfile:

pod 'APLUrlTextView', '0.0.2'

Usage

Import header file:

#import "APLUrlTextView.h"
#import "APLHrefString.h"

Use APLUrlTextView like this:

...
self.textView.delegate = self;
...
NSURL *targetURL = [NSURL URLWithString:"..."];
NSRange linkRange = NSMakeRange(...);
[self.textView addLinkToURL:targetURL withRange:linkRange];
...

// Implement the delegate method extending the UITextViewDelegate method
// in order to be informed about URLs being touched by the user
-(void)textView:(APLUrlTextView *)label didSelectLinkWithURL:(NSURL *)url {
  ...
}

Use APLHrefString to parse strings containing 'hrefs' like this "A string with 
<href="http://www.apploft.de">a link</href>" and get a corresponding attributed string plus rnages and urls to be used for the APLUrlTextView.

Latest podspec

{
    "name": "APLHrefStringConverter",
    "version": "0.0.4",
    "summary": "A simple extension of String taking a string containing hrefs and creating clickable MutableStrings",
    "description": "A simple String extension that creates clickable links out of hrefs contained in the String. The result is a mutableString that contains the text and the clickable hrefs at the right positions.",
    "homepage": "https://github.com/apploft/APLUrlTextView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Famara Kassama": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/apploft/APLHrefStringConverter.git",
        "tag": "0.0.4"
    },
    "source_files": [
        "Classes",
        "Classes/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "requires_arc": true
}

Pin It on Pinterest

Share This