SkillAgentSearch skills...

URLPreview

An NSURL extension for showing preview info of webpages

Install / Use

/learn @itsmeichigo/URLPreview
About this skill

Quality Score

0/100

Supported Platforms

Universal

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

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.

Related Skills

View on GitHub
GitHub Stars199
CategoryDevelopment
Updated1y ago
Forks20

Languages

Swift

Security Score

80/100

Audited on Oct 17, 2024

No findings