Latest 2.1.0
Homepage https://github.com/itsmeichigo/URLPreview
License MIT
Platforms ios 8.0, requires ARC
Dependencies Kanna
Frameworks UIKit
Authors

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

Requirements

  • Swift 5 & Xcode 10.2
  • This library depends on Kanna

Usage

Pretty simple, all you need is a block:

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.

Latest podspec

{
    "name": "URLPreview",
    "version": "2.1.0",
    "summary": "An NSURL extension for showing preview info of webpages.",
    "description": "You may want to use this if you want to mimick Facebook app's behavior when you post a link on your status.",
    "homepage": "https://github.com/itsmeichigo/URLPreview",
    "screenshots": "https://raw.githubusercontent.com/itsmeichigo/URLPreview/master/ScreenShot.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Huong Do": "[email protected]"
    },
    "social_media_url": "http://twitter.com/itsmeichigo",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/itsmeichigo/URLPreview.git",
        "tag": "2.1.0"
    },
    "source_files": "Source",
    "frameworks": "UIKit",
    "dependencies": {
        "Kanna": [
            "~> 4.0.0"
        ]
    },
    "requires_arc": true,
    "swift_versions": [
        "3.2",
        "4.0",
        "4.2",
        "5",
        "5"
    ],
    "swift_version": "5"
}

Pin It on Pinterest

Share This