URL Link Preview

Generate data and views for URL/web link previews for iOS -- based on pluggable link preview API services.

Features

The goals of this library are:

  1. To (a) separate the fetching or acquisition of link preview data from (b) the view or UI aspects of the link preview.
  2. To enable the app using the link preview data fetching to not have to disable Application Transport Security (ATS).
  3. To flexibly allow for different web-based API services that fetch link preview data.

The LinkPreview view adapts to different available data:

LargeImage-OneLineTitle

LargeImage-TwoLineTitle

Icon

OnlyURL

Icon-TwoLineTitle

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

Cocoapods

SMLinkPreview is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SMLinkPreview'

or

pod 'SMLinkPreview', :git => 'https://github.com/crspybits/SMLinkPreview.git'

Swift Package Manager

It is also available through the Swift Package Manager. To install, add the following line to your Package.swift file as a dependency:

.package(url: "https://github.com/crspybits/SMLinkPreview.git", from: "0.2.0")

Author

crspybits, [email protected]

GitHub