Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsmeichigo/URLPreview
An NSURL extension for showing preview info of webpages
https://github.com/itsmeichigo/URLPreview
Last synced: 3 months ago
JSON representation
An NSURL extension for showing preview info of webpages
- Host: GitHub
- URL: https://github.com/itsmeichigo/URLPreview
- Owner: itsmeichigo
- License: mit
- Created: 2016-01-07T04:14:02.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-08-27T04:38:30.000Z (about 4 years ago)
- Last Synced: 2024-04-24T20:02:25.541Z (6 months ago)
- Language: Swift
- Homepage:
- Size: 269 KB
- Stars: 200
- Watchers: 8
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - URLPreview - An NSURL extension for showing preview info of webpages. (Parsing / Other Parsing)
- awesome-ios-star - URLPreview - An NSURL extension for showing preview info of webpages. (Parsing / Other Parsing)
README
# URLPreview
An NSURL extension for showing preview info of webpages.
You may want to use it if you want to mimick Facebook app's behavior when you post a link on your status.
![Screenshot](https://raw.githubusercontent.com/itsmeichigo/URLPreview/master/ScreenShot.png)
## Requirements
- Swift 5 & Xcode 10.2
- This library depends on [Kanna](https://github.com/tid-kijyun/Kanna)## Usage
Pretty simple, all you need is a block:
```Swift
if let url = NSURL(string: urlTextField.text!) {
url.fetchPageInfo({ (title, description, previewImage) -> Void in
// do whatever you want here
}, failure: { (errorMessage) -> Void in
print(errorMessage)
})
} else {
print("Invalid URL!")
}
```## Contributing
Contributions for bug fixing or improvements are welcome. Feel free to submit a pull request.
## Licence
URLPreview is available under the MIT license. See the LICENSE file for more info.