URLLivePreview - A small project that utilizes LPLink for SwiftUI projects

Overview

URLLivePreview

URLLivePreview is a swift Package to add a preview of a URL site. This package integrates LPLinkView and LinkPresentation.

Examples

Usage

Installation

Add URLLivePreview package to your project.

In Xcode File -> Add Packages... then enter my project GitHub URL: https://github.com/arbyruns/URLLivePreview

Quick Start

import URLLivePreview
URLPreview(linkViewParameters: LinkViewParameters(url: "https://github.com/arbyruns/URLLivePreview", width: .infinity, height: 250, alignment: .center))

List View

Create your links as Strings.

struct Link: Identifiable {
    var id = UUID()
    var string: String
}

    let links: [Link] = [
            "https://github.com/arbyruns/URLLivePreview",
            "https://github.com/arbyruns?tab=repositories"
    ]
        .map{Link(string: $0)}

Then within a List and a ForEach and pass Links.

Complete Example

import SwiftUI
import URLLivePreview

struct Link: Identifiable {
    var id = UUID()
    var string: String
}


struct ContentView: View {
    let links: [Link] = [
            "https://github.com/arbyruns/URLLivePreview",
            "https://github.com/arbyruns?tab=repositories"
    ]
        .map{Link(string: $0)}

    var body: some View {
                List {
                    ForEach(links){ link in
                        URLPreview(linkViewParameters: LinkViewParameters(url: link.string, width: .infinity, height: 250, alignment: .center))
                    }
                }
                .listStyle(.inset)
    }
}
You might also like...
A platform to showcase your side projects/apps

A platform to discuss/showcase your side projects What is this? Inspired by this twitter thread Indie Apps Showcases is a platform for indie app devel

Redux abstractions for BetterMe projects and iOS community

ReduxCore Redux abstractions on Swift for BetterMe projects and iOS community Installation CocoaPods You can install ReduxCore via CocoaPods by adding

Base projects for Devpass' Dev Sprints

Modularization Challenge - iOS ⚙️ In this challenge, we will refactor an iOS application separating the functionality into independent, interchangeabl

NewsAPI-Project - News API Project For iOS
NewsAPI-Project - News API Project For iOS

NewsAPI-Project Es necesario descargar y realizar un pod install para ejecutar e

A multiplatform SwiftUI project demonstrating various SwiftUI features.

WikiDemo A multiplatform SwiftUI project demonstrating various SwiftUI features, including creating a master-detail interface. It's a multiplatform ve

SwiftUI-MSALSample - Sample project to login with MSAL using SwiftUI
SwiftUI-MSALSample - Sample project to login with MSAL using SwiftUI

SwiftUI-MSALSample I could not find a good walkthrough on how to implement MSAL

Watchos-navlink-swiftui-bug - Example Project to demonstrate bug in SwiftUI when NavigationLink is activated inside a TabView
This SwiftUI project is a result of the third 'milestone' in "Hacking With Swift's 100 Days of SwiftUI".

exercise-tracker This SwiftUI project is a result of the third 'milestone' in "Hacking With Swift's 100 Days of SwiftUI". In this exercise tracking ap

Jetpack Compose and SwiftUI based Kotlin Multiplatform project
Jetpack Compose and SwiftUI based Kotlin Multiplatform project

BikeShare Jetpack Compose and SwiftUI based Kotlin Multiplatform sample project (based on CityBikes API). Running on iOS (SwiftUI) macOS (SwiftUI) And

Owner
Rob Evans
Rob Evans
SwiftUI Projects from Udemy SwiftUI Masterclass

SwiftUI Masterclass Repos: AsyncImage (N/A) Fructus (finished): an app for getting information about different fruits. Data comes from json files. Afr

Patrick Spafford 1 Mar 3, 2022
A small SwiftUI based chat client for IRC, using swift-nio-irc

NeoIRC A simple Internet Relay Chat client implemented using SwiftNIO and SwiftUI. Inspired by: For maximum NIO someone (I’m tempted) should adopt NIO

The Noze Consortium 18 Jun 22, 2022
small iOS & ipadOS application written in SwiftUI and Combine, that fetches twitter users and tweets using Twitter's api

HomeTwitter Small iOS & ipadOS application written in SwiftUI and Combine, that fetches twitter users and tweets using Twitter's api. This is just a s

Sorin Miroiu 1 May 13, 2022
Droplet is a very small SwiftUI application that runs in the menubar and allows a file to be dropped onto the popover.

A Mac OS menubar application that allows drag-and-drop file uploading to an S3 bucket with a presigned URL copied to the clipboard. Work in progress.

Josh McArthur 11 Sep 8, 2022
Examples projects using SwiftUI released by WWDC2019. Include Layout, UI, Animations, Gestures, Draw and Data.

SwiftUI Examples About Examples projects using SwiftUI & Combine. Include Layout, UI, Animations, Gestures, Draw and Data. See projects files in Files

Ivan Vorobei 4.2k Jan 6, 2023
All the projects from 100 Days of SwiftUI, as taught by Paul Hudson (Hacking with Swift)

100 Days of SwiftUI 19 projects of increasing complexity built with SwiftUI. These projects were built as part of an iOS development course taught by

Emmanuel Chucks 7 Dec 4, 2022
A small macOS menubar app designed to hide the dock on selected spaces.

HideMyDock A small macOS menubar app designed to hide the dock on selected spaces. Installation Manually You can download the latest version of .dmg f

Alexander Ushaev 42 Jan 2, 2023
App07 - This is part of the 31 days of small Xcode apps for January 2022

App07 This is part of the 31 days of small Xcode apps for January 2022 Multiplic

Christopher M. 0 Jan 8, 2022
WhatsNext-Live - A small utility app for macOS showing upcoming calendar entries in a menubar popover

What's Next A small utility app for macOS using SwiftUI and EventKit to show you

Philipp 2 Jun 29, 2022
Small app trying to recreate the Github's repos section from the iOS app with RxSwift and .nibs

Github Profile Repos Small app trying to recreate the Github's repos section from the iOS app with RxSwift and .nibs. This project is currently in pro

Leonardo 1 Apr 5, 2022