mirror of
https://github.com/zhigang1992/CCHLinkTextView.git
synced 2026-05-01 05:12:10 +08:00
Update README.md
This commit is contained in:
28
README.md
28
README.md
@@ -3,12 +3,9 @@ CCHLinkTextView
|
||||
|
||||
[](https://travis-ci.org/choefele/CCHLinkTextView)  
|
||||
|
||||
`CCHLinkTextView` makes it easy to embed links inside a `UITextView` and receive events for short and long taps. It looks and behaves similar to table cells used in popular Twitter apps such as Twitterrific or Tweetbot.
|
||||
`CCHLinkTextView` makes it easy to embed links inside a `UITextView` and receive events for short and long taps. It looks and behaves similar to table cells used in popular Twitter apps such as Twitterrific or Tweetbot. `CCHLinkTextView` is available under the MIT license.
|
||||
|
||||
Need to talk to a human? Follow @claushoefele on Twitter.
|
||||
|
||||
<a href="https://twitter.com/claushoefele" class="twitter-follow-button" data-show-count="false">Follow @claushoefele</a>
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
||||
Need to talk to a human? [Follow @claushoefele on Twitter](https://twitter.com/claushoefele).
|
||||
|
||||
## Alternatives
|
||||
|
||||
@@ -16,14 +13,15 @@ When using iOS 7's built-in link detection via `NSLinkAttributeName`, you will f
|
||||
|
||||
![Animated GIF landscape]()
|
||||
|
||||
|
||||
In contrast to `UITextView`, `CCHLinkTextView` works great in `UITableView`s – even with `userInteractionEnabled` set to `YES` – because touches outside links are passed through to the `UITableView`. In addition, `CCHLinkTextView` provides events for short and long taps.
|
||||
|
||||
Compared to `OHAttributedLabel` and `TTTAttributeLabel`, `CCHLinkTextView` is written for iOS 7 using TextKit functionality. This makes for a simpler implementation avoiding custom drawing code using CoreText.
|
||||
|
||||
In contrast to `STTweetLabel`, `CCHLinkTextView` is a subclass of `UITextView` because `UILabel` has limited TextKit support and adding this functionality can be quite hacky. `CCHLinkTextView` supports all of `UITextView`'s features and can also be used from within storyboards. Whereas `STTweetLabel` places its links on certain hotwords, you can mark any text range as a link with `CCHLinkTextView`.
|
||||
|
||||
## Installation
|
||||
## Usage
|
||||
|
||||
### Installation
|
||||
|
||||
Use [CocoaPods](http://cocoapods.org) to integrate `CCHLinkTextView` into your project. Minimum deployment target is iOS 7.0 because this project uses Text Kit functionality.
|
||||
|
||||
@@ -31,12 +29,18 @@ Use [CocoaPods](http://cocoapods.org) to integrate `CCHLinkTextView` into your p
|
||||
platform :ios, '7.0'
|
||||
pod "CCHLinkTextView"
|
||||
```
|
||||
### Creating `CCHLinkTextView`s
|
||||
|
||||
## Usage
|
||||
### Setting up links
|
||||
|
||||
- By default, `CCHLinkTextView` is noneditable. Setting `isEditable` to `YES` will turn off link detection.
|
||||
- Links can have custom styles
|
||||
- UIAppearance support
|
||||
- NSTextChecking/data detectors
|
||||
### Embedding `CCHLinkTextView`s into table view cells
|
||||
|
||||
## License (MIT)
|
||||
|
||||
Copyright (C) 2014 Claus Höfele
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Reference in New Issue
Block a user