Latest 1.0.7
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": "1.0.7",
    "summary": "A simple converter taking a string containing html formatted tags and creating a formatted attributed text",
    "description": "A simple string converter that creates an attributed text from an html formatted string. This way href can be detected and made clickable. The converter takes optional attributes and a custom htmlWrapper.",
    "homepage": "https://github.com/apploft/APLUrlTextView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "swift_versions": [
        "4.2",
        "5.0"
    ],
    "authors": {
        "Famara Kassama": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/apploft/APLHrefStringConverter.git",
        "tag": "1.0.7"
    },
    "source_files": [
        "Classes",
        "Classes/**/*"
    ],
    "exclude_files": "Classes/Exclude",
    "resource_bundles": {
        "APLHrefStringConverter": [
            "Resources/**/*.html"
        ]
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This